From 1cc7d01c274210ebd5f1c399513dfab05c51327b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Fri, 11 Jul 2025 12:00:23 +0200 Subject: [PATCH] add openapi-python-client generator + client --- .python-version | 1 + README.md | 0 main.py | 6 + poly-ticket-api-client/.gitignore | 23 + poly-ticket-api-client/README.md | 124 +++ .../poly_ticket_api_client/__init__.py | 8 + .../poly_ticket_api_client/api/__init__.py | 1 + .../api/accounting/__init__.py | 1 + ...counting_invoices_actions_refund_create.py | 154 ++++ .../accounting/accounting_invoices_list.py | 253 ++++++ .../accounting_invoices_retrieve.py | 146 ++++ .../api/common/__init__.py | 1 + .../common/common_uploaded_images_create.py | 211 +++++ .../common/common_uploaded_images_destroy.py | 103 +++ .../api/common/common_uploaded_images_list.py | 223 ++++++ .../common_uploaded_images_partial_update.py | 213 +++++ .../common/common_uploaded_images_retrieve.py | 166 ++++ .../api/core/__init__.py | 1 + .../core_api_tokens_actions_me_retrieve.py | 118 +++ .../api/core/core_api_tokens_list.py | 199 +++++ .../api/core/core_api_tokens_retrieve.py | 142 ++++ ...ore_auth_actions_password_change_create.py | 208 +++++ ...core_auth_actions_password_reset_create.py | 204 +++++ ...h_actions_password_reset_request_create.py | 135 ++++ .../core/core_auth_actions_register_create.py | 203 +++++ ...ore_auth_actions_register_verify_create.py | 201 +++++ .../api/core/core_auth_login_create.py | 196 +++++ .../api/core/core_documents_create.py | 187 +++++ .../api/core/core_documents_list.py | 199 +++++ .../api/core/core_documents_retrieve.py | 142 ++++ ...berships_actions_create_by_email_create.py | 133 ++++ .../api/core/core_unitmemberships_create.py | 195 +++++ .../api/core/core_unitmemberships_destroy.py | 93 +++ .../api/core/core_unitmemberships_list.py | 253 ++++++ .../core_unitmemberships_partial_update.py | 217 +++++ .../api/core/core_unitmemberships_retrieve.py | 150 ++++ .../api/core/core_units_create.py | 195 +++++ .../api/core/core_units_list.py | 226 ++++++ .../api/core/core_units_partial_update.py | 213 +++++ .../api/core/core_units_retrieve.py | 150 ++++ .../api/core/core_users_create.py | 191 +++++ .../api/core/core_users_destroy.py | 91 +++ .../api/core/core_users_list.py | 263 +++++++ .../api/core/core_users_partial_update.py | 217 +++++ .../api/core/core_users_retrieve.py | 146 ++++ .../api/events/__init__.py | 1 + .../events_events_actions_duplicate_create.py | 204 +++++ .../events_events_actions_export_create.py | 244 ++++++ .../events_events_actions_moderate_create.py | 146 ++++ .../events_events_actions_node_stocks_list.py | 184 +++++ ...ts_events_actions_public_infos_retrieve.py | 167 ++++ ...vents_actions_request_moderation_create.py | 95 +++ ...ents_events_actions_statistics_retrieve.py | 264 +++++++ ...ts_actions_ticket_office_infos_retrieve.py | 190 +++++ .../api/events/events_events_create.py | 187 +++++ .../api/events/events_events_destroy.py | 91 +++ .../api/events/events_events_list.py | 214 +++++ .../events/events_events_partial_update.py | 213 +++++ .../api/events/events_events_retrieve.py | 142 ++++ .../api/modules_auth/__init__.py | 1 + ...ymous_login_actions_create_login_create.py | 204 +++++ ...les_auth_anonymous_login_modules_create.py | 207 +++++ ...es_auth_anonymous_login_modules_destroy.py | 93 +++ ...dules_auth_anonymous_login_modules_list.py | 220 ++++++ ..._anonymous_login_modules_partial_update.py | 229 ++++++ ...s_auth_anonymous_login_modules_retrieve.py | 150 ++++ .../modules_auth_frontend_logins_list.py | 248 ++++++ .../modules_auth_frontend_logins_retrieve.py | 142 ++++ .../modules_auth_login_methods_list.py | 229 ++++++ ...ken_login_actions_validate_login_create.py | 200 +++++ ..._third_party_token_login_modules_create.py | 207 +++++ ...third_party_token_login_modules_destroy.py | 93 +++ ...th_third_party_token_login_modules_list.py | 220 ++++++ ...arty_token_login_modules_partial_update.py | 231 ++++++ ...hird_party_token_login_modules_retrieve.py | 150 ++++ ...usted_email_actions_create_login_create.py | 131 ++++ ...ted_email_actions_validate_login_create.py | 200 +++++ ...dules_auth_trusted_email_modules_create.py | 207 +++++ ...ules_auth_trusted_email_modules_destroy.py | 93 +++ ...modules_auth_trusted_email_modules_list.py | 220 ++++++ ...th_trusted_email_modules_partial_update.py | 229 ++++++ ...les_auth_trusted_email_modules_retrieve.py | 150 ++++ .../api/modules_basket/__init__.py | 1 + ...ules_basket_billing_informations_create.py | 215 +++++ ...odules_basket_billing_informations_list.py | 274 +++++++ ...es_basket_billing_informations_retrieve.py | 146 ++++ ...nd_baskets_actions_add_to_basket_create.py | 280 +++++++ ..._baskets_actions_generate_ticket_create.py | 232 ++++++ ...skets_actions_remove_from_basket_create.py | 256 ++++++ ...s_actions_validate_extra_infos_retrieve.py | 215 +++++ .../modules_basket_frontend_baskets_create.py | 219 ++++++ .../modules_basket_frontend_baskets_list.py | 282 +++++++ ..._basket_frontend_baskets_partial_update.py | 237 ++++++ ...odules_basket_frontend_baskets_retrieve.py | 175 +++++ .../api/modules_completion/__init__.py | 1 + ...es_completion_completion_started_create.py | 199 +++++ ...irmation_page_extra_text_modules_create.py | 207 +++++ ...rmation_page_extra_text_modules_destroy.py | 93 +++ ...nfirmation_page_extra_text_modules_list.py | 220 ++++++ ..._page_extra_text_modules_partial_update.py | 229 ++++++ ...mation_page_extra_text_modules_retrieve.py | 150 ++++ ...tration_completed_simple_modules_create.py | 209 +++++ ...ration_completed_simple_modules_destroy.py | 93 +++ ...istration_completed_simple_modules_list.py | 220 ++++++ ...completed_simple_modules_partial_update.py | 233 ++++++ ...ation_completed_simple_modules_retrieve.py | 152 ++++ ...il_registration_creation_modules_create.py | 209 +++++ ...l_registration_creation_modules_destroy.py | 93 +++ ...mail_registration_creation_modules_list.py | 220 ++++++ ...tration_creation_modules_partial_update.py | 233 ++++++ ..._registration_creation_modules_retrieve.py | 152 ++++ ...es_completion_pdf_ticket_modules_create.py | 207 +++++ ...s_completion_pdf_ticket_modules_destroy.py | 93 +++ ...ules_completion_pdf_ticket_modules_list.py | 220 ++++++ ...etion_pdf_ticket_modules_partial_update.py | 229 ++++++ ..._completion_pdf_ticket_modules_retrieve.py | 150 ++++ ...ules_completion_redirect_modules_create.py | 207 +++++ ...les_completion_redirect_modules_destroy.py | 93 +++ ...odules_completion_redirect_modules_list.py | 220 ++++++ ...pletion_redirect_modules_partial_update.py | 229 ++++++ ...es_completion_redirect_modules_retrieve.py | 150 ++++ .../api/modules_payments/__init__.py | 1 + ...ts_methods_actions_start_payment_create.py | 271 +++++++ .../modules_payments_methods_list.py | 218 ++++++ ...s_payment_intents_actions_cancel_create.py | 260 ++++++ ...ts_actions_request_status_update_create.py | 260 ++++++ .../modules_payments_payment_intents_list.py | 233 ++++++ ...dules_payments_payment_intents_retrieve.py | 167 ++++ ...modules_payments_payrexx_modules_create.py | 207 +++++ .../modules_payments_payrexx_modules_list.py | 218 ++++++ ...payments_payrexx_modules_partial_update.py | 229 ++++++ ...dules_payments_payrexx_modules_retrieve.py | 150 ++++ ...odules_payments_payrexx_webhooks_create.py | 195 +++++ ...les_payments_pointofsale_modules_create.py | 207 +++++ ...dules_payments_pointofsale_modules_list.py | 220 ++++++ ...ents_pointofsale_modules_partial_update.py | 229 ++++++ ...s_payments_pointofsale_modules_retrieve.py | 150 ++++ ...ules_payments_pointofsale_places_create.py | 207 +++++ ...les_payments_pointofsale_places_destroy.py | 93 +++ ...odules_payments_pointofsale_places_list.py | 218 ++++++ ...ments_pointofsale_places_partial_update.py | 229 ++++++ ...es_payments_pointofsale_places_retrieve.py | 150 ++++ .../api/modules_registrations/__init__.py | 1 + ...ations_access_management_modules_create.py | 207 +++++ ...trations_access_management_modules_list.py | 220 ++++++ ...ccess_management_modules_partial_update.py | 231 ++++++ ...ions_access_management_modules_retrieve.py | 150 ++++ ...rations_access_management_places_create.py | 195 +++++ ...ations_access_management_places_destroy.py | 93 +++ ...strations_access_management_places_list.py | 218 ++++++ ...access_management_places_partial_update.py | 217 +++++ ...tions_access_management_places_retrieve.py | 150 ++++ ...s_registrations_options_accesses_create.py | 199 +++++ ..._registrations_options_accesses_destroy.py | 97 +++ ...les_registrations_options_accesses_list.py | 245 ++++++ ...gistrations_options_accesses_m2m_create.py | 199 +++++ ...istrations_options_accesses_m2m_destroy.py | 97 +++ ...registrations_options_accesses_m2m_list.py | 256 ++++++ ...strations_options_accesses_m2m_retrieve.py | 154 ++++ ...rations_options_accesses_partial_update.py | 213 +++++ ...registrations_options_accesses_retrieve.py | 154 ++++ ...strations_options_availabilities_create.py | 191 +++++ ...trations_options_availabilities_destroy.py | 91 +++ ...gistrations_options_availabilities_list.py | 233 ++++++ ...tions_options_availabilities_m2m_create.py | 215 +++++ ...ions_options_availabilities_m2m_destroy.py | 97 +++ ...rations_options_availabilities_m2m_list.py | 256 ++++++ ...ons_options_availabilities_m2m_retrieve.py | 158 ++++ ...s_options_availabilities_partial_update.py | 217 +++++ ...rations_options_availabilities_retrieve.py | 146 ++++ ...registrations_options_conditions_create.py | 199 +++++ ...egistrations_options_conditions_destroy.py | 97 +++ ...s_registrations_options_conditions_list.py | 226 ++++++ ...tions_options_conditions_partial_update.py | 213 +++++ ...gistrations_options_conditions_retrieve.py | 154 ++++ ...ations_options_extra_info_groups_create.py | 203 +++++ ...tions_options_extra_info_groups_destroy.py | 97 +++ ...trations_options_extra_info_groups_list.py | 226 ++++++ ...ns_options_extra_info_groups_m2m_create.py | 215 +++++ ...s_options_extra_info_groups_m2m_destroy.py | 97 +++ ...ions_options_extra_info_groups_m2m_list.py | 226 ++++++ ..._options_extra_info_groups_m2m_retrieve.py | 158 ++++ ...ptions_extra_info_groups_partial_update.py | 217 +++++ ...ions_options_extra_info_groups_retrieve.py | 158 ++++ ...egistrations_options_extra_infos_create.py | 195 +++++ ...gistrations_options_extra_infos_destroy.py | 95 +++ ..._registrations_options_extra_infos_list.py | 222 ++++++ ...ions_options_extra_infos_partial_update.py | 213 +++++ ...istrations_options_extra_infos_retrieve.py | 150 ++++ ...les_registrations_options_limits_create.py | 199 +++++ ...es_registrations_options_limits_destroy.py | 97 +++ ...dules_registrations_options_limits_list.py | 245 ++++++ ...registrations_options_limits_m2m_create.py | 199 +++++ ...egistrations_options_limits_m2m_destroy.py | 97 +++ ...s_registrations_options_limits_m2m_list.py | 256 ++++++ ...gistrations_options_limits_m2m_retrieve.py | 154 ++++ ...strations_options_limits_partial_update.py | 213 +++++ ...s_registrations_options_limits_retrieve.py | 154 ++++ ...es_registrations_options_modules_create.py | 207 +++++ ...ules_registrations_options_modules_list.py | 220 ++++++ ...trations_options_modules_partial_update.py | 229 ++++++ ..._registrations_options_modules_retrieve.py | 150 ++++ ...options_node_cart_configurations_create.py | 191 +++++ ...ptions_node_cart_configurations_destroy.py | 91 +++ ...s_options_node_cart_configurations_list.py | 214 +++++ ...node_cart_configurations_partial_update.py | 229 ++++++ ...tions_node_cart_configurations_retrieve.py | 146 ++++ ...ions_options_node_configurations_create.py | 191 +++++ ...ons_options_node_configurations_destroy.py | 91 +++ ...ations_options_node_configurations_list.py | 214 +++++ ...ions_node_configurations_partial_update.py | 217 +++++ ...ns_options_node_configurations_retrieve.py | 146 ++++ ...tions_delete_cart_configurations_create.py | 200 +++++ ...tions_ensure_cart_configurations_create.py | 200 +++++ ...ules_registrations_options_nodes_create.py | 187 +++++ ...les_registrations_options_nodes_destroy.py | 91 +++ ...odules_registrations_options_nodes_list.py | 214 +++++ ...istrations_options_nodes_partial_update.py | 213 +++++ ...es_registrations_options_nodes_retrieve.py | 142 ++++ ...egistrations_options_price_rules_create.py | 199 +++++ ...gistrations_options_price_rules_destroy.py | 97 +++ ..._registrations_options_price_rules_list.py | 245 ++++++ ...trations_options_price_rules_m2m_create.py | 203 +++++ ...rations_options_price_rules_m2m_destroy.py | 97 +++ ...istrations_options_price_rules_m2m_list.py | 256 ++++++ ...ations_options_price_rules_m2m_retrieve.py | 158 ++++ ...ions_options_price_rules_partial_update.py | 213 +++++ ...istrations_options_price_rules_retrieve.py | 154 ++++ ...trations_options_promotion_codes_create.py | 187 +++++ ...rations_options_promotion_codes_destroy.py | 91 +++ ...istrations_options_promotion_codes_list.py | 214 +++++ ..._options_promotion_codes_partial_update.py | 213 +++++ ...ations_options_promotion_codes_retrieve.py | 142 ++++ ...registrations_options_statements_create.py | 187 +++++ ...egistrations_options_statements_destroy.py | 91 +++ ...s_registrations_options_statements_list.py | 214 +++++ ...tions_options_statements_partial_update.py | 213 +++++ ...gistrations_options_statements_retrieve.py | 142 ++++ ...dules_registrations_options_tags_create.py | 195 +++++ ...ules_registrations_options_tags_destroy.py | 95 +++ ...modules_registrations_options_tags_list.py | 241 ++++++ ...gistrations_options_tags_partial_update.py | 213 +++++ ...les_registrations_options_tags_retrieve.py | 150 ++++ ...s_selected_nodes_extra_info_groups_list.py | 249 ++++++ ...lected_nodes_extra_info_groups_retrieve.py | 158 ++++ ...rations_selected_nodes_extra_infos_list.py | 253 ++++++ ...lected_nodes_extra_infos_partial_update.py | 217 +++++ ...ons_selected_nodes_extra_infos_retrieve.py | 158 ++++ ...dules_registrations_selected_nodes_list.py | 256 ++++++ ...s_registrations_selected_nodes_retrieve.py | 190 +++++ ...rations_selected_promotion_codes_create.py | 203 +++++ ...ations_selected_promotion_codes_destroy.py | 97 +++ ...strations_selected_promotion_codes_list.py | 241 ++++++ ...tions_selected_promotion_codes_retrieve.py | 158 ++++ .../api/schema/__init__.py | 1 + .../api/schema/schema_retrieve.py | 195 +++++ .../poly_ticket_api_client/client.py | 268 +++++++ .../poly_ticket_api_client/errors.py | 16 + .../poly_ticket_api_client/models/__init__.py | 475 +++++++++++ .../models/access_management_place.py | 151 ++++ .../models/accounting_invoices_list_status.py | 10 + .../models/add_to_basket_node_extra_info.py | 69 ++ .../add_to_basket_node_extra_info_group.py | 83 ++ .../models/api_token.py | 125 +++ .../models/billing_information.py | 212 +++++ .../models/blank_enum.py | 8 + .../models/cancel_error.py | 59 ++ .../models/category_enum.py | 13 + .../models/completion_started.py | 72 ++ .../models/condition.py | 129 +++ ...firmation_page_extra_text_active_module.py | 114 +++ ...firmation_page_extra_text_configuration.py | 111 +++ .../models/core_unitmemberships_list_role.py | 9 + .../models/create_anonymous_login.py | 86 ++ .../models/create_trusted_email_login.py | 96 +++ .../poly_ticket_api_client/models/document.py | 105 +++ .../models/document_type_enum.py | 10 + .../poly_ticket_api_client/models/event.py | 708 +++++++++++++++++ .../models/event_moderation.py | 86 ++ .../models/event_public_infos.py | 221 ++++++ .../models/event_statistics.py | 108 +++ .../event_statistics_invoices_refunded.py | 44 ++ ...vent_statistics_invoices_refunded_value.py | 44 ++ .../event_statistics_invoices_resolved.py | 44 ++ ...vent_statistics_invoices_resolved_value.py | 44 ++ .../models/event_status_enum.py | 11 + ..._events_actions_export_create_file_type.py | 9 + ...actions_statistics_retrieve_granularity.py | 11 + .../models/frontend_basket.py | 200 +++++ .../models/frontend_login.py | 120 +++ .../poly_ticket_api_client/models/invoice.py | 141 ++++ .../models/left_hand_operand_enum.py | 10 + .../models/logical_operator_enum.py | 9 + .../poly_ticket_api_client/models/login.py | 82 ++ .../models/login_jwt.py | 60 ++ .../models/login_method.py | 84 ++ .../models/login_result.py | 60 ++ .../models/mode_enum.py | 12 + .../models/model_form_line_type.py | 19 + .../models/moderation_status_enum.py | 11 + ...dule_auth_anonymous_login_active_module.py | 113 +++ ...dule_auth_anonymous_login_configuration.py | 60 ++ ...h_third_party_token_login_active_module.py | 115 +++ ...h_third_party_token_login_configuration.py | 69 ++ ...module_auth_trusted_email_active_module.py | 113 +++ ...module_auth_trusted_email_configuration.py | 60 ++ ...il_registration_completed_active_module.py | 118 +++ ...il_registration_completed_configuration.py | 158 ++++ ...ail_registration_creation_active_module.py | 118 +++ ...ail_registration_creation_configuration.py | 129 +++ ...ule_completion_pdf_ticket_active_module.py | 113 +++ ...ule_completion_pdf_ticket_configuration.py | 110 +++ ...odule_completion_redirect_active_module.py | 113 +++ ...odule_completion_redirect_configuration.py | 68 ++ .../module_payment_payrexx_active_module.py | 113 +++ .../module_payment_payrexx_configuration.py | 169 ++++ ...ment_payrexx_configuration_global_limit.py | 89 +++ ...ule_payment_payrexx_configuration_limit.py | 105 +++ ...ayment_payrexx_configuration_price_rule.py | 127 +++ ...ule_payment_point_of_sale_active_module.py | 113 +++ ...ule_payment_point_of_sale_configuration.py | 211 +++++ ...oint_of_sale_configuration_global_limit.py | 83 ++ ...yment_point_of_sale_configuration_limit.py | 99 +++ ..._point_of_sale_configuration_price_rule.py | 121 +++ ...tration_access_management_active_module.py | 117 +++ ...dule_registration_options_active_module.py | 113 +++ ...dule_registration_options_configuration.py | 112 +++ ...rations_access_management_configuration.py | 60 ++ ...lidate_extra_infos_retrieve_inline_type.py | 10 + .../poly_ticket_api_client/models/node.py | 158 ++++ .../models/node_access.py | 141 ++++ .../models/node_access_m2m.py | 112 +++ .../models/node_availability.py | 202 +++++ .../models/node_availability_m2m.py | 112 +++ .../models/node_cart_configuration.py | 129 +++ .../models/node_configuration.py | 359 +++++++++ .../models/node_extra_info.py | 257 ++++++ .../models/node_extra_info_group.py | 161 ++++ .../models/node_extra_info_group_m2m.py | 112 +++ .../models/node_limit.py | 180 +++++ .../models/node_limit_m2m.py | 112 +++ .../models/node_limit_usage.py | 84 ++ .../models/node_price_rule.py | 185 +++++ .../models/node_price_rule_m2m.py | 112 +++ .../models/node_stock.py | 147 ++++ .../poly_ticket_api_client/models/node_tag.py | 112 +++ .../models/operator_enum.py | 16 + .../paginated_access_management_place_list.py | 123 +++ .../models/paginated_api_token_list.py | 123 +++ .../paginated_billing_information_list.py | 123 +++ .../models/paginated_condition_list.py | 123 +++ ...tion_page_extra_text_active_module_list.py | 123 +++ .../models/paginated_document_list.py | 123 +++ .../models/paginated_event_list.py | 123 +++ .../models/paginated_frontend_basket_list.py | 123 +++ .../models/paginated_frontend_login_list.py | 123 +++ .../models/paginated_invoice_list.py | 123 +++ .../models/paginated_login_method_list.py | 123 +++ ...auth_anonymous_login_active_module_list.py | 123 +++ ...rd_party_token_login_active_module_list.py | 125 +++ ...e_auth_trusted_email_active_module_list.py | 123 +++ ...gistration_completed_active_module_list.py | 127 +++ ...egistration_creation_active_module_list.py | 127 +++ ...ompletion_pdf_ticket_active_module_list.py | 123 +++ ..._completion_redirect_active_module_list.py | 123 +++ ...dule_payment_payrexx_active_module_list.py | 123 +++ ...ayment_point_of_sale_active_module_list.py | 123 +++ ...on_access_management_active_module_list.py | 127 +++ ...registration_options_active_module_list.py | 123 +++ .../models/paginated_node_access_list.py | 123 +++ .../models/paginated_node_access_m2m_list.py | 123 +++ .../paginated_node_availability_list.py | 123 +++ .../paginated_node_availability_m2m_list.py | 123 +++ .../paginated_node_cart_configuration_list.py | 123 +++ .../paginated_node_configuration_list.py | 123 +++ .../paginated_node_extra_info_group_list.py | 123 +++ ...aginated_node_extra_info_group_m2m_list.py | 123 +++ .../models/paginated_node_extra_info_list.py | 123 +++ .../models/paginated_node_limit_list.py | 123 +++ .../models/paginated_node_limit_m2m_list.py | 123 +++ .../models/paginated_node_list.py | 123 +++ .../models/paginated_node_price_rule_list.py | 123 +++ .../paginated_node_price_rule_m2m_list.py | 123 +++ .../models/paginated_node_tag_list.py | 123 +++ .../models/paginated_payment_intent_list.py | 123 +++ .../models/paginated_payment_method_list.py | 123 +++ ...ated_point_of_sale_place_read_only_list.py | 123 +++ .../models/paginated_poly_ticket_user_list.py | 123 +++ .../models/paginated_promotion_code_list.py | 123 +++ ...ted_selected_node_extra_info_group_list.py | 123 +++ ...paginated_selected_node_extra_info_list.py | 123 +++ .../models/paginated_selected_node_list.py | 123 +++ .../paginated_selected_promotion_code_list.py | 123 +++ .../models/paginated_statement_list.py | 123 +++ .../models/paginated_unit_list.py | 123 +++ .../models/paginated_unit_membership_list.py | 123 +++ .../models/paginated_uploaded_image_list.py | 123 +++ .../models/password_change_success.py | 59 ++ .../models/password_reset_success.py | 59 ++ .../models/patched_access_management_place.py | 158 ++++ .../models/patched_condition.py | 141 ++++ ...firmation_page_extra_text_active_module.py | 124 +++ .../models/patched_event.py | 741 ++++++++++++++++++ .../models/patched_frontend_basket.py | 224 ++++++ ...dule_auth_anonymous_login_active_module.py | 123 +++ ...h_third_party_token_login_active_module.py | 125 +++ ...module_auth_trusted_email_active_module.py | 123 +++ ...il_registration_completed_active_module.py | 128 +++ ...ail_registration_creation_active_module.py | 128 +++ ...ule_completion_pdf_ticket_active_module.py | 123 +++ ...odule_completion_redirect_active_module.py | 123 +++ ...ed_module_payment_payrexx_active_module.py | 123 +++ ...ule_payment_point_of_sale_active_module.py | 123 +++ ...tration_access_management_active_module.py | 127 +++ ...dule_registration_options_active_module.py | 123 +++ .../models/patched_node.py | 171 ++++ .../models/patched_node_access.py | 150 ++++ .../models/patched_node_availability.py | 211 +++++ .../models/patched_node_cart_configuration.py | 132 ++++ .../models/patched_node_configuration.py | 362 +++++++++ .../models/patched_node_extra_info.py | 277 +++++++ .../models/patched_node_extra_info_group.py | 176 +++++ .../models/patched_node_limit.py | 197 +++++ .../models/patched_node_price_rule.py | 209 +++++ .../models/patched_node_tag.py | 120 +++ .../patched_point_of_sale_place_read_only.py | 109 +++ .../models/patched_poly_ticket_user.py | 169 ++++ .../models/patched_promotion_code.py | 120 +++ .../patched_selected_node_extra_info.py | 265 +++++++ .../models/patched_statement.py | 265 +++++++ .../models/patched_unit.py | 146 ++++ .../models/patched_unit_membership.py | 129 +++ .../models/patched_uploaded_image.py | 204 +++++ .../models/payment_intent.py | 178 +++++ .../models/payment_intent_request_update.py | 75 ++ ...yment_intent_request_update_status_enum.py | 10 + .../models/payment_method.py | 101 +++ .../models/payment_start.py | 138 ++++ .../models/payrexx_payment.py | 60 ++ .../models/payrexx_transaction.py | 118 +++ .../models/point_of_sale_place.py | 139 ++++ .../models/point_of_sale_place_read_only.py | 103 +++ .../models/poly_ticket_user.py | 166 ++++ .../models/privacy_level_enum.py | 10 + .../models/promotion_code.py | 112 +++ .../poly_ticket_api_client/models/refund.py | 85 ++ .../models/schema_retrieve_format.py | 9 + .../models/schema_retrieve_lang.py | 9 + .../models/schema_retrieve_response_200.py | 44 ++ .../models/selected_node.py | 140 ++++ .../models/selected_node_creation.py | 136 ++++ .../models/selected_node_deletion.py | 73 ++ .../models/selected_node_extra_info.py | 181 +++++ .../models/selected_node_extra_info_group.py | 108 +++ .../models/selected_node_status_enum.py | 12 + .../models/selected_promotion_code.py | 131 ++++ .../models/statement.py | 258 ++++++ .../ticket_office_article_calculated_price.py | 80 ++ .../models/ticket_office_infos.py | 154 ++++ .../ticket_office_node_configuration.py | 352 +++++++++ .../models/ticket_office_node_extra_info.py | 194 +++++ .../ticket_office_node_extra_info_group.py | 114 +++ .../models/ticket_office_node_limit.py | 99 +++ .../models/ticket_office_node_tag.py | 78 ++ .../poly_ticket_api_client/models/unit.py | 143 ++++ .../unit_member_ship_creation_by_email.py | 104 +++ ...member_ship_creation_by_email_role_enum.py | 9 + .../models/unit_membership.py | 124 +++ .../models/unit_membership_role_enum.py | 9 + .../models/uploaded_image.py | 194 +++++ .../models/user_password_change.py | 83 ++ .../models/user_password_reset.py | 92 +++ .../models/user_password_reset_request.py | 72 ++ .../models/user_registration.py | 140 ++++ .../models/user_verification.py | 84 ++ .../validate_third_party_token_login.py | 82 ++ .../models/validate_trusted_email_login.py | 107 +++ .../models/verification_error.py | 59 ++ .../models/verification_success.py | 59 ++ .../poly_ticket_api_client/models/webhooks.py | 81 ++ .../poly_ticket_api_client/py.typed | 1 + .../poly_ticket_api_client/types.py | 54 ++ poly-ticket-api-client/pyproject.toml | 27 + pyproject.toml | 9 + uv.lock | 398 ++++++++++ 485 files changed, 72495 insertions(+) create mode 100644 .python-version create mode 100644 README.md create mode 100644 main.py create mode 100644 poly-ticket-api-client/.gitignore create mode 100644 poly-ticket-api-client/README.md create mode 100644 poly-ticket-api-client/poly_ticket_api_client/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/accounting/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_actions_refund_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/common/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_actions_me_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_change_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_request_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_verify_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_login_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_actions_create_by_email_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_duplicate_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_export_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_moderate_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_node_stocks_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_public_infos_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_request_moderation_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_statistics_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_ticket_office_infos_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_actions_create_login_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_login_methods_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_actions_validate_login_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_create_login_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_validate_login_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_add_to_basket_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_generate_ticket_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_remove_from_basket_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_completion_started_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_actions_start_payment_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_cancel_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_request_status_update_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_webhooks_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_delete_cart_configurations_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_ensure_cart_configurations_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_partial_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_create.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_destroy.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/schema/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/api/schema/schema_retrieve.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/client.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/errors.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/__init__.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/access_management_place.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/accounting_invoices_list_status.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info_group.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/api_token.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/billing_information.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/blank_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/cancel_error.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/category_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/completion_started.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/condition.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/core_unitmemberships_list_role.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/create_anonymous_login.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/create_trusted_email_login.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/document.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/document_type_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_moderation.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_public_infos.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_statistics.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded_value.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved_value.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/event_status_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_export_create_file_type.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_statistics_retrieve_granularity.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/frontend_basket.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/frontend_login.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/invoice.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/left_hand_operand_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/logical_operator_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/login.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/login_jwt.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/login_method.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/login_result.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/mode_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/model_form_line_type.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/moderation_status_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_global_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_price_rule.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_global_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_price_rule.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_registration_access_management_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/module_registrations_access_management_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve_inline_type.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_access.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_access_m2m.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_availability.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_availability_m2m.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_cart_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group_m2m.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_limit_m2m.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_limit_usage.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule_m2m.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_stock.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/node_tag.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/operator_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_access_management_place_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_api_token_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_billing_information_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_condition_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_confirmation_page_extra_text_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_document_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_event_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_basket_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_login_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_invoice_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_login_method_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_anonymous_login_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_third_party_token_login_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_trusted_email_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_completed_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_creation_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_pdf_ticket_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_redirect_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_payrexx_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_point_of_sale_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_access_management_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_options_active_module_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_cart_configuration_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_configuration_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_m2m_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_tag_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_intent_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_method_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_point_of_sale_place_read_only_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_poly_ticket_user_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_promotion_code_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_group_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_promotion_code_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_statement_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_membership_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/paginated_uploaded_image_list.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/password_change_success.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/password_reset_success.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_access_management_place.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_condition.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_confirmation_page_extra_text_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_event.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_frontend_basket.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_anonymous_login_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_third_party_token_login_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_trusted_email_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_completed_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_creation_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_pdf_ticket_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_redirect_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_payrexx_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_point_of_sale_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_access_management_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_options_active_module.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_access.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_availability.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_cart_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info_group.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_price_rule.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_node_tag.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_point_of_sale_place_read_only.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_poly_ticket_user.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_promotion_code.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_selected_node_extra_info.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_statement.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_unit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_unit_membership.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/patched_uploaded_image.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payment_intent.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update_status_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payment_method.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payment_start.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payrexx_payment.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/payrexx_transaction.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place_read_only.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/poly_ticket_user.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/privacy_level_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/promotion_code.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/refund.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_format.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_lang.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_response_200.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_node.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_node_creation.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_node_deletion.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info_group.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_node_status_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/selected_promotion_code.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/statement.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_article_calculated_price.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_infos.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_configuration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info_group.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_limit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_tag.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/unit.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email_role_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/unit_membership.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/unit_membership_role_enum.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/uploaded_image.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/user_password_change.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset_request.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/user_registration.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/user_verification.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/validate_third_party_token_login.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/validate_trusted_email_login.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/verification_error.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/verification_success.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/models/webhooks.py create mode 100644 poly-ticket-api-client/poly_ticket_api_client/py.typed create mode 100644 poly-ticket-api-client/poly_ticket_api_client/types.py create mode 100644 poly-ticket-api-client/pyproject.toml create mode 100644 pyproject.toml create mode 100644 uv.lock diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..5d64c82 --- /dev/null +++ b/main.py @@ -0,0 +1,6 @@ +def main(): + print("Hello from polyticket-api!") + + +if __name__ == "__main__": + main() diff --git a/poly-ticket-api-client/.gitignore b/poly-ticket-api-client/.gitignore new file mode 100644 index 0000000..79a2c3d --- /dev/null +++ b/poly-ticket-api-client/.gitignore @@ -0,0 +1,23 @@ +__pycache__/ +build/ +dist/ +*.egg-info/ +.pytest_cache/ + +# pyenv +.python-version + +# Environments +.env +.venv + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# JetBrains +.idea/ + +/coverage.xml +/.coverage diff --git a/poly-ticket-api-client/README.md b/poly-ticket-api-client/README.md new file mode 100644 index 0000000..3567213 --- /dev/null +++ b/poly-ticket-api-client/README.md @@ -0,0 +1,124 @@ +# poly-ticket-api-client +A client library for accessing PolyTicket API + +## Usage +First, create a client: + +```python +from poly_ticket_api_client import Client + +client = Client(base_url="https://api.example.com") +``` + +If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: + +```python +from poly_ticket_api_client import AuthenticatedClient + +client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") +``` + +Now call your endpoint and use your models: + +```python +from poly_ticket_api_client.models import MyDataModel +from poly_ticket_api_client.api.my_tag import get_my_data_model +from poly_ticket_api_client.types import Response + +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +``` + +Or do the same thing with an async version: + +```python +from poly_ticket_api_client.models import MyDataModel +from poly_ticket_api_client.api.my_tag import get_my_data_model +from poly_ticket_api_client.types import Response + +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) +``` + +By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl="/path/to/certificate_bundle.pem", +) +``` + +You can also disable certificate validation altogether, but beware that **this is a security risk**. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl=False +) +``` + +Things to know: +1. Every path/method combo becomes a Python module with four functions: + 1. `sync`: Blocking request that returns parsed data (if successful) or `None` + 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking + +1. All path/query params, and bodies become method arguments. +1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) +1. Any endpoint which did not have a tag will be in `poly_ticket_api_client.api.default` + +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from poly_ticket_api_client import Client + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + +def log_response(response): + request = response.request + print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from poly_ticket_api_client import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) +``` + +## Building / publishing this package +This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: +1. Update the metadata in pyproject.toml (e.g. authors, version) +1. If you're using a private repository, configure it with Poetry + 1. `poetry config repositories. ` + 1. `poetry config http-basic. ` +1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` + +If you want to install this client into another project without publishing it (e.g. for development) then: +1. If that project **is using Poetry**, you can simply do `poetry add ` from that project +1. If that project is not using Poetry: + 1. Build a wheel with `poetry build -f wheel` + 1. Install that wheel from the other project `pip install ` diff --git a/poly-ticket-api-client/poly_ticket_api_client/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/__init__.py new file mode 100644 index 0000000..c93381c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing PolyTicket API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/__init__.py new file mode 100644 index 0000000..81f9fa2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/accounting/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_actions_refund_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_actions_refund_create.py new file mode 100644 index 0000000..5ff336d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_actions_refund_create.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.refund import Refund +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + Refund, + Refund, + Refund, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/accounting/invoices/{id}/actions/refund/", + } + + if isinstance(body, Refund): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Refund): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Refund): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Refund, + Refund, + Refund, + ], +) -> Response[Any]: + """Proceed to a refund on an invoice, verifying the status and the validity of the amount. + Calls the method `refund_payment` on the payment module. + + Args: + id (int): + body (Refund): Write only serializer used to provide `refund_amount` and `payment_intent` + to the action `refund` on `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields + are not part of the invoice model. + body (Refund): Write only serializer used to provide `refund_amount` and `payment_intent` + to the action `refund` on `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields + are not part of the invoice model. + body (Refund): Write only serializer used to provide `refund_amount` and `payment_intent` + to the action `refund` on `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields + are not part of the invoice model. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Refund, + Refund, + Refund, + ], +) -> Response[Any]: + """Proceed to a refund on an invoice, verifying the status and the validity of the amount. + Calls the method `refund_payment` on the payment module. + + Args: + id (int): + body (Refund): Write only serializer used to provide `refund_amount` and `payment_intent` + to the action `refund` on `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields + are not part of the invoice model. + body (Refund): Write only serializer used to provide `refund_amount` and `payment_intent` + to the action `refund` on `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields + are not part of the invoice model. + body (Refund): Write only serializer used to provide `refund_amount` and `payment_intent` + to the action `refund` on `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields + are not part of the invoice model. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_list.py new file mode 100644 index 0000000..42c330b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_list.py @@ -0,0 +1,253 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.accounting_invoices_list_status import AccountingInvoicesListStatus +from ...models.paginated_invoice_list import PaginatedInvoiceList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + basket_id: Union[Unset, float] = UNSET, + event_id: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, AccountingInvoicesListStatus] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["basket_id"] = basket_id + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + json_status: Union[Unset, str] = UNSET + if not isinstance(status, Unset): + json_status = status.value + + params["status"] = json_status + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/accounting/invoices/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedInvoiceList]: + if response.status_code == 200: + response_200 = PaginatedInvoiceList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedInvoiceList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, float] = UNSET, + event_id: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, AccountingInvoicesListStatus] = UNSET, +) -> Response[PaginatedInvoiceList]: + """ViewSet for `Invoice` object + + Args: + basket_id (Union[Unset, float]): + event_id (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, AccountingInvoicesListStatus]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedInvoiceList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, float] = UNSET, + event_id: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, AccountingInvoicesListStatus] = UNSET, +) -> Optional[PaginatedInvoiceList]: + """ViewSet for `Invoice` object + + Args: + basket_id (Union[Unset, float]): + event_id (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, AccountingInvoicesListStatus]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedInvoiceList + """ + + return sync_detailed( + client=client, + basket_id=basket_id, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, float] = UNSET, + event_id: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, AccountingInvoicesListStatus] = UNSET, +) -> Response[PaginatedInvoiceList]: + """ViewSet for `Invoice` object + + Args: + basket_id (Union[Unset, float]): + event_id (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, AccountingInvoicesListStatus]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedInvoiceList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, float] = UNSET, + event_id: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, AccountingInvoicesListStatus] = UNSET, +) -> Optional[PaginatedInvoiceList]: + """ViewSet for `Invoice` object + + Args: + basket_id (Union[Unset, float]): + event_id (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, AccountingInvoicesListStatus]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedInvoiceList + """ + + return ( + await asyncio_detailed( + client=client, + basket_id=basket_id, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_retrieve.py new file mode 100644 index 0000000..69ebd7e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/accounting/accounting_invoices_retrieve.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.invoice import Invoice +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/accounting/invoices/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Invoice]: + if response.status_code == 200: + response_200 = Invoice.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Invoice]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Invoice]: + """ViewSet for `Invoice` object + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Invoice] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Invoice]: + """ViewSet for `Invoice` object + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Invoice + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Invoice]: + """ViewSet for `Invoice` object + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Invoice] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Invoice]: + """ViewSet for `Invoice` object + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Invoice + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/common/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/common/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/common/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_create.py new file mode 100644 index 0000000..5e26988 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_create.py @@ -0,0 +1,211 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.uploaded_image import UploadedImage +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UploadedImage, + UploadedImage, + UploadedImage, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/common/uploaded_images/", + } + + if isinstance(body, UploadedImage): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UploadedImage): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UploadedImage): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[UploadedImage]: + if response.status_code == 201: + response_201 = UploadedImage.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[UploadedImage]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UploadedImage, + UploadedImage, + UploadedImage, + ], +) -> Response[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + body (UploadedImage): + body (UploadedImage): + body (UploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UploadedImage] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + UploadedImage, + UploadedImage, + UploadedImage, + ], +) -> Optional[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + body (UploadedImage): + body (UploadedImage): + body (UploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UploadedImage + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UploadedImage, + UploadedImage, + UploadedImage, + ], +) -> Response[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + body (UploadedImage): + body (UploadedImage): + body (UploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UploadedImage] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + UploadedImage, + UploadedImage, + UploadedImage, + ], +) -> Optional[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + body (UploadedImage): + body (UploadedImage): + body (UploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UploadedImage + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_destroy.py new file mode 100644 index 0000000..e7848a5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_destroy.py @@ -0,0 +1,103 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/common/uploaded_images/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_list.py new file mode 100644 index 0000000..1cea91e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_list.py @@ -0,0 +1,223 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_uploaded_image_list import PaginatedUploadedImageList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/common/uploaded_images/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedUploadedImageList]: + if response.status_code == 200: + response_200 = PaginatedUploadedImageList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedUploadedImageList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedUploadedImageList]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedUploadedImageList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedUploadedImageList]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedUploadedImageList + """ + + return sync_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedUploadedImageList]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedUploadedImageList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedUploadedImageList]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedUploadedImageList + """ + + return ( + await asyncio_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_partial_update.py new file mode 100644 index 0000000..de1363e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_uploaded_image import PatchedUploadedImage +from ...models.uploaded_image import UploadedImage +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedUploadedImage, + PatchedUploadedImage, + PatchedUploadedImage, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/common/uploaded_images/{id}/", + } + + if isinstance(body, PatchedUploadedImage): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedUploadedImage): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedUploadedImage): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[UploadedImage]: + if response.status_code == 200: + response_200 = UploadedImage.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[UploadedImage]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUploadedImage, + PatchedUploadedImage, + PatchedUploadedImage, + ], +) -> Response[UploadedImage]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UploadedImage] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUploadedImage, + PatchedUploadedImage, + PatchedUploadedImage, + ], +) -> Optional[UploadedImage]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UploadedImage + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUploadedImage, + PatchedUploadedImage, + PatchedUploadedImage, + ], +) -> Response[UploadedImage]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UploadedImage] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUploadedImage, + PatchedUploadedImage, + PatchedUploadedImage, + ], +) -> Optional[UploadedImage]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + body (PatchedUploadedImage): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UploadedImage + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_retrieve.py new file mode 100644 index 0000000..25e8fb8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/common/common_uploaded_images_retrieve.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.uploaded_image import UploadedImage +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/common/uploaded_images/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[UploadedImage]: + if response.status_code == 200: + response_200 = UploadedImage.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[UploadedImage]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UploadedImage] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UploadedImage + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UploadedImage] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[UploadedImage]: + """Viewset for the UploadedImage model. Depending on the `privacy_level` of the object, the object will + be retrievable without authorization, with event authorization, or with ownership authorization. + + This permission does not require IsJWTAuthenticated to be use in combination because we need to be + able to access public images without any authentication. The authentication for restricted image + access is performed with IsJWTAuthenticated in the permission itself. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UploadedImage + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_actions_me_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_actions_me_retrieve.py new file mode 100644 index 0000000..57ce3fb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_actions_me_retrieve.py @@ -0,0 +1,118 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_token import ApiToken +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/core/api_tokens/actions/me/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ApiToken]: + if response.status_code == 200: + response_200 = ApiToken.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ApiToken]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiToken]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiToken] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[ApiToken]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiToken + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiToken]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiToken] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[ApiToken]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiToken + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_list.py new file mode 100644 index 0000000..e067621 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_list.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_api_token_list import PaginatedApiTokenList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/core/api_tokens/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedApiTokenList]: + if response.status_code == 200: + response_200 = PaginatedApiTokenList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedApiTokenList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedApiTokenList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedApiTokenList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedApiTokenList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedApiTokenList + """ + + return sync_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedApiTokenList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedApiTokenList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedApiTokenList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedApiTokenList + """ + + return ( + await asyncio_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_retrieve.py new file mode 100644 index 0000000..738c5de --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_api_tokens_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_token import ApiToken +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/core/api_tokens/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ApiToken]: + if response.status_code == 200: + response_200 = ApiToken.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ApiToken]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiToken]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiToken] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ApiToken]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiToken + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiToken]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiToken] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ApiToken]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiToken + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_change_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_change_create.py new file mode 100644 index 0000000..a831172 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_change_create.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.password_change_success import PasswordChangeSuccess +from ...models.user_password_change import UserPasswordChange +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UserPasswordChange, + UserPasswordChange, + UserPasswordChange, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/auth/actions/password_change/", + } + + if isinstance(body, UserPasswordChange): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UserPasswordChange): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UserPasswordChange): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PasswordChangeSuccess]: + if response.status_code == 200: + response_200 = PasswordChangeSuccess.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PasswordChangeSuccess]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordChange, + UserPasswordChange, + UserPasswordChange, + ], +) -> Response[PasswordChangeSuccess]: + """This ViewSet manages polyticket users password change. + + Args: + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PasswordChangeSuccess] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordChange, + UserPasswordChange, + UserPasswordChange, + ], +) -> Optional[PasswordChangeSuccess]: + """This ViewSet manages polyticket users password change. + + Args: + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PasswordChangeSuccess + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordChange, + UserPasswordChange, + UserPasswordChange, + ], +) -> Response[PasswordChangeSuccess]: + """This ViewSet manages polyticket users password change. + + Args: + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PasswordChangeSuccess] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordChange, + UserPasswordChange, + UserPasswordChange, + ], +) -> Optional[PasswordChangeSuccess]: + """This ViewSet manages polyticket users password change. + + Args: + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + body (UserPasswordChange): Serializer used for user password change requests. It verifies + the user has the correct current password for the account and validates the new one. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PasswordChangeSuccess + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_create.py new file mode 100644 index 0000000..b39fd94 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_create.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.password_reset_success import PasswordResetSuccess +from ...models.user_password_reset import UserPasswordReset +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UserPasswordReset, + UserPasswordReset, + UserPasswordReset, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/auth/actions/password_reset/", + } + + if isinstance(body, UserPasswordReset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UserPasswordReset): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UserPasswordReset): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PasswordResetSuccess]: + if response.status_code == 200: + response_200 = PasswordResetSuccess.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PasswordResetSuccess]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordReset, + UserPasswordReset, + UserPasswordReset, + ], +) -> Response[PasswordResetSuccess]: + """ + Args: + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PasswordResetSuccess] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordReset, + UserPasswordReset, + UserPasswordReset, + ], +) -> Optional[PasswordResetSuccess]: + """ + Args: + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PasswordResetSuccess + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordReset, + UserPasswordReset, + UserPasswordReset, + ], +) -> Response[PasswordResetSuccess]: + """ + Args: + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PasswordResetSuccess] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordReset, + UserPasswordReset, + UserPasswordReset, + ], +) -> Optional[PasswordResetSuccess]: + """ + Args: + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + body (UserPasswordReset): Serializer used for user password reset. It should be used after + having made the request for a password reset. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PasswordResetSuccess + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_request_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_request_create.py new file mode 100644 index 0000000..42b5126 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_password_reset_request_create.py @@ -0,0 +1,135 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_password_reset_request import UserPasswordResetRequest +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UserPasswordResetRequest, + UserPasswordResetRequest, + UserPasswordResetRequest, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/auth/actions/password_reset_request/", + } + + if isinstance(body, UserPasswordResetRequest): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UserPasswordResetRequest): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UserPasswordResetRequest): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordResetRequest, + UserPasswordResetRequest, + UserPasswordResetRequest, + ], +) -> Response[Any]: + """Send an email with a password reset link, to be used in the + `UserPasswordResetViewSet.password_reset` action + + Args: + body (UserPasswordResetRequest): Serializer used for users password reset requests. If + verifies the email is associated with a valid account. + body (UserPasswordResetRequest): Serializer used for users password reset requests. If + verifies the email is associated with a valid account. + body (UserPasswordResetRequest): Serializer used for users password reset requests. If + verifies the email is associated with a valid account. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserPasswordResetRequest, + UserPasswordResetRequest, + UserPasswordResetRequest, + ], +) -> Response[Any]: + """Send an email with a password reset link, to be used in the + `UserPasswordResetViewSet.password_reset` action + + Args: + body (UserPasswordResetRequest): Serializer used for users password reset requests. If + verifies the email is associated with a valid account. + body (UserPasswordResetRequest): Serializer used for users password reset requests. If + verifies the email is associated with a valid account. + body (UserPasswordResetRequest): Serializer used for users password reset requests. If + verifies the email is associated with a valid account. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_create.py new file mode 100644 index 0000000..a292db7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_create.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_registration import UserRegistration +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UserRegistration, + UserRegistration, + UserRegistration, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/auth/actions/register/", + } + + if isinstance(body, UserRegistration): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UserRegistration): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UserRegistration): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserRegistration]: + if response.status_code == 200: + response_200 = UserRegistration.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserRegistration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserRegistration, + UserRegistration, + UserRegistration, + ], +) -> Response[UserRegistration]: + """Validate and create a new user with the given parameters and with an `is_active` attribute set to + False. + It then sends an activation email for this to be changed in a second step. + + Args: + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserRegistration] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + UserRegistration, + UserRegistration, + UserRegistration, + ], +) -> Optional[UserRegistration]: + """Validate and create a new user with the given parameters and with an `is_active` attribute set to + False. + It then sends an activation email for this to be changed in a second step. + + Args: + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserRegistration + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserRegistration, + UserRegistration, + UserRegistration, + ], +) -> Response[UserRegistration]: + """Validate and create a new user with the given parameters and with an `is_active` attribute set to + False. + It then sends an activation email for this to be changed in a second step. + + Args: + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserRegistration] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + UserRegistration, + UserRegistration, + UserRegistration, + ], +) -> Optional[UserRegistration]: + """Validate and create a new user with the given parameters and with an `is_active` attribute set to + False. + It then sends an activation email for this to be changed in a second step. + + Args: + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + body (UserRegistration): Serializer for PolyTicketUser registration + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserRegistration + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_verify_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_verify_create.py new file mode 100644 index 0000000..c203e1f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_actions_register_verify_create.py @@ -0,0 +1,201 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_verification import UserVerification +from ...models.verification_error import VerificationError +from ...models.verification_success import VerificationSuccess +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UserVerification, + UserVerification, + UserVerification, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/auth/actions/register_verify/", + } + + if isinstance(body, UserVerification): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UserVerification): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UserVerification): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[VerificationError, VerificationSuccess]]: + if response.status_code == 200: + response_200 = VerificationSuccess.from_dict(response.json()) + + return response_200 + if response.status_code == 403: + response_403 = VerificationError.from_dict(response.json()) + + return response_403 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[VerificationError, VerificationSuccess]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserVerification, + UserVerification, + UserVerification, + ], +) -> Response[Union[VerificationError, VerificationSuccess]]: + """This ViewSet manages polyticket users registration and email verification. + + Args: + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[VerificationError, VerificationSuccess]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + UserVerification, + UserVerification, + UserVerification, + ], +) -> Optional[Union[VerificationError, VerificationSuccess]]: + """This ViewSet manages polyticket users registration and email verification. + + Args: + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[VerificationError, VerificationSuccess] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UserVerification, + UserVerification, + UserVerification, + ], +) -> Response[Union[VerificationError, VerificationSuccess]]: + """This ViewSet manages polyticket users registration and email verification. + + Args: + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[VerificationError, VerificationSuccess]] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + UserVerification, + UserVerification, + UserVerification, + ], +) -> Optional[Union[VerificationError, VerificationSuccess]]: + """This ViewSet manages polyticket users registration and email verification. + + Args: + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + body (UserVerification): Serializer for PolyTicketUser verification + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[VerificationError, VerificationSuccess] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_login_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_login_create.py new file mode 100644 index 0000000..ab67936 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_auth_login_create.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.login import Login +from ...models.login_result import LoginResult +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Login, + Login, + Login, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/auth/login/", + } + + if isinstance(body, Login): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Login): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Login): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoginResult]: + if response.status_code == 200: + response_200 = LoginResult.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoginResult]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Login, + Login, + Login, + ], +) -> Response[LoginResult]: + """View that handles User authentication. + Returns an error for unsuccessful login or a JWT on successful login. + + Args: + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginResult] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Login, + Login, + Login, + ], +) -> Optional[LoginResult]: + """View that handles User authentication. + Returns an error for unsuccessful login or a JWT on successful login. + + Args: + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginResult + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Login, + Login, + Login, + ], +) -> Response[LoginResult]: + """View that handles User authentication. + Returns an error for unsuccessful login or a JWT on successful login. + + Args: + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginResult] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Login, + Login, + Login, + ], +) -> Optional[LoginResult]: + """View that handles User authentication. + Returns an error for unsuccessful login or a JWT on successful login. + + Args: + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + body (Login): Serializer used only for PolyTicketUser login. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginResult + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_create.py new file mode 100644 index 0000000..d6f3450 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_create.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.document import Document +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Document, + Document, + Document, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/documents/", + } + + if isinstance(body, Document): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Document): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Document): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Document]: + if response.status_code == 201: + response_201 = Document.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Document]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Document, + Document, + Document, + ], +) -> Response[Document]: + """ + Args: + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Document] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Document, + Document, + Document, + ], +) -> Optional[Document]: + """ + Args: + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Document + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Document, + Document, + Document, + ], +) -> Response[Document]: + """ + Args: + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Document] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Document, + Document, + Document, + ], +) -> Optional[Document]: + """ + Args: + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + body (Document): Serializer for `Document` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Document + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_list.py new file mode 100644 index 0000000..b9b6e8b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_list.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_document_list import PaginatedDocumentList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/core/documents/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedDocumentList]: + if response.status_code == 200: + response_200 = PaginatedDocumentList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedDocumentList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedDocumentList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedDocumentList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedDocumentList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedDocumentList + """ + + return sync_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedDocumentList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedDocumentList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedDocumentList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedDocumentList + """ + + return ( + await asyncio_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_retrieve.py new file mode 100644 index 0000000..abb93bd --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_documents_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.document import Document +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/core/documents/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Document]: + if response.status_code == 200: + response_200 = Document.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Document]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Document]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Document] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Document]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Document + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Document]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Document] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Document]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Document + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_actions_create_by_email_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_actions_create_by_email_create.py new file mode 100644 index 0000000..6ca3e20 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_actions_create_by_email_create.py @@ -0,0 +1,133 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit_member_ship_creation_by_email import UnitMemberShipCreationByEmail +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UnitMemberShipCreationByEmail, + UnitMemberShipCreationByEmail, + UnitMemberShipCreationByEmail, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/unitmemberships/actions/create_by_email/", + } + + if isinstance(body, UnitMemberShipCreationByEmail): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UnitMemberShipCreationByEmail): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UnitMemberShipCreationByEmail): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UnitMemberShipCreationByEmail, + UnitMemberShipCreationByEmail, + UnitMemberShipCreationByEmail, + ], +) -> Response[Any]: + """Create a unitmembership using the email of the target user + + Args: + body (UnitMemberShipCreationByEmail): Serializer for the action create_by_email of + UnitMemberShipViewSet + body (UnitMemberShipCreationByEmail): Serializer for the action create_by_email of + UnitMemberShipViewSet + body (UnitMemberShipCreationByEmail): Serializer for the action create_by_email of + UnitMemberShipViewSet + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UnitMemberShipCreationByEmail, + UnitMemberShipCreationByEmail, + UnitMemberShipCreationByEmail, + ], +) -> Response[Any]: + """Create a unitmembership using the email of the target user + + Args: + body (UnitMemberShipCreationByEmail): Serializer for the action create_by_email of + UnitMemberShipViewSet + body (UnitMemberShipCreationByEmail): Serializer for the action create_by_email of + UnitMemberShipViewSet + body (UnitMemberShipCreationByEmail): Serializer for the action create_by_email of + UnitMemberShipViewSet + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_create.py new file mode 100644 index 0000000..8f806b0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_create.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit_membership import UnitMembership +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + UnitMembership, + UnitMembership, + UnitMembership, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/unitmemberships/", + } + + if isinstance(body, UnitMembership): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, UnitMembership): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, UnitMembership): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UnitMembership]: + if response.status_code == 201: + response_201 = UnitMembership.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UnitMembership]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UnitMembership, + UnitMembership, + UnitMembership, + ], +) -> Response[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UnitMembership] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + UnitMembership, + UnitMembership, + UnitMembership, + ], +) -> Optional[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UnitMembership + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + UnitMembership, + UnitMembership, + UnitMembership, + ], +) -> Response[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UnitMembership] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + UnitMembership, + UnitMembership, + UnitMembership, + ], +) -> Optional[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + body (UnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UnitMembership + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_destroy.py new file mode 100644 index 0000000..f1f58e3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/core/unitmemberships/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This ViewSet manages unit memberships. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This ViewSet manages unit memberships. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_list.py new file mode 100644 index 0000000..690794e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_list.py @@ -0,0 +1,253 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.core_unitmemberships_list_role import CoreUnitmembershipsListRole +from ...models.paginated_unit_membership_list import PaginatedUnitMembershipList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + role: Union[Unset, CoreUnitmembershipsListRole] = UNSET, + unit: Union[Unset, int] = UNSET, + user: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + json_role: Union[Unset, str] = UNSET + if not isinstance(role, Unset): + json_role = role.value + + params["role"] = json_role + + params["unit"] = unit + + params["user"] = user + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/core/unitmemberships/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedUnitMembershipList]: + if response.status_code == 200: + response_200 = PaginatedUnitMembershipList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedUnitMembershipList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + role: Union[Unset, CoreUnitmembershipsListRole] = UNSET, + unit: Union[Unset, int] = UNSET, + user: Union[Unset, int] = UNSET, +) -> Response[PaginatedUnitMembershipList]: + """This ViewSet manages unit memberships. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + role (Union[Unset, CoreUnitmembershipsListRole]): + unit (Union[Unset, int]): + user (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedUnitMembershipList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + role=role, + unit=unit, + user=user, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + role: Union[Unset, CoreUnitmembershipsListRole] = UNSET, + unit: Union[Unset, int] = UNSET, + user: Union[Unset, int] = UNSET, +) -> Optional[PaginatedUnitMembershipList]: + """This ViewSet manages unit memberships. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + role (Union[Unset, CoreUnitmembershipsListRole]): + unit (Union[Unset, int]): + user (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedUnitMembershipList + """ + + return sync_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + role=role, + unit=unit, + user=user, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + role: Union[Unset, CoreUnitmembershipsListRole] = UNSET, + unit: Union[Unset, int] = UNSET, + user: Union[Unset, int] = UNSET, +) -> Response[PaginatedUnitMembershipList]: + """This ViewSet manages unit memberships. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + role (Union[Unset, CoreUnitmembershipsListRole]): + unit (Union[Unset, int]): + user (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedUnitMembershipList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + role=role, + unit=unit, + user=user, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + role: Union[Unset, CoreUnitmembershipsListRole] = UNSET, + unit: Union[Unset, int] = UNSET, + user: Union[Unset, int] = UNSET, +) -> Optional[PaginatedUnitMembershipList]: + """This ViewSet manages unit memberships. + + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + role (Union[Unset, CoreUnitmembershipsListRole]): + unit (Union[Unset, int]): + user (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedUnitMembershipList + """ + + return ( + await asyncio_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + role=role, + unit=unit, + user=user, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_partial_update.py new file mode 100644 index 0000000..7e7f1c0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_unit_membership import PatchedUnitMembership +from ...models.unit_membership import UnitMembership +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedUnitMembership, + PatchedUnitMembership, + PatchedUnitMembership, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/core/unitmemberships/{id}/", + } + + if isinstance(body, PatchedUnitMembership): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedUnitMembership): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedUnitMembership): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UnitMembership]: + if response.status_code == 200: + response_200 = UnitMembership.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UnitMembership]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnitMembership, + PatchedUnitMembership, + PatchedUnitMembership, + ], +) -> Response[UnitMembership]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UnitMembership] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnitMembership, + PatchedUnitMembership, + PatchedUnitMembership, + ], +) -> Optional[UnitMembership]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UnitMembership + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnitMembership, + PatchedUnitMembership, + PatchedUnitMembership, + ], +) -> Response[UnitMembership]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UnitMembership] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnitMembership, + PatchedUnitMembership, + PatchedUnitMembership, + ], +) -> Optional[UnitMembership]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + body (PatchedUnitMembership): Serializer for UnitMembership model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UnitMembership + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_retrieve.py new file mode 100644 index 0000000..00c7a74 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_unitmemberships_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit_membership import UnitMembership +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/core/unitmemberships/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UnitMembership]: + if response.status_code == 200: + response_200 = UnitMembership.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UnitMembership]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UnitMembership] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UnitMembership + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UnitMembership] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[UnitMembership]: + """This ViewSet manages unit memberships. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UnitMembership + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_create.py new file mode 100644 index 0000000..800541e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_create.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit import Unit +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Unit, + Unit, + Unit, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/units/", + } + + if isinstance(body, Unit): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Unit): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Unit): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Unit]: + if response.status_code == 201: + response_201 = Unit.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Unit]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Unit, + Unit, + Unit, + ], +) -> Response[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Unit] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Unit, + Unit, + Unit, + ], +) -> Optional[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Unit + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Unit, + Unit, + Unit, + ], +) -> Response[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Unit] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Unit, + Unit, + Unit, + ], +) -> Optional[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + body (Unit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Unit + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_list.py new file mode 100644 index 0000000..71a9f14 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_list.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_unit_list import PaginatedUnitList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_id: Union[Unset, list[int]] = UNSET + if not isinstance(id, Unset): + json_id = id + + params["id"] = json_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/core/units/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedUnitList]: + if response.status_code == 200: + response_200 = PaginatedUnitList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedUnitList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedUnitList]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedUnitList] + """ + + kwargs = _get_kwargs( + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedUnitList]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedUnitList + """ + + return sync_detailed( + client=client, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedUnitList]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedUnitList] + """ + + kwargs = _get_kwargs( + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedUnitList]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedUnitList + """ + + return ( + await asyncio_detailed( + client=client, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_partial_update.py new file mode 100644 index 0000000..5bcb699 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_unit import PatchedUnit +from ...models.unit import Unit +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedUnit, + PatchedUnit, + PatchedUnit, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/core/units/{id}/", + } + + if isinstance(body, PatchedUnit): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedUnit): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedUnit): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Unit]: + if response.status_code == 200: + response_200 = Unit.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Unit]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnit, + PatchedUnit, + PatchedUnit, + ], +) -> Response[Unit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Unit] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnit, + PatchedUnit, + PatchedUnit, + ], +) -> Optional[Unit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Unit + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnit, + PatchedUnit, + PatchedUnit, + ], +) -> Response[Unit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Unit] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedUnit, + PatchedUnit, + PatchedUnit, + ], +) -> Optional[Unit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + body (PatchedUnit): Serializer for Unit model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Unit + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_retrieve.py new file mode 100644 index 0000000..614822f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_units_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.unit import Unit +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/core/units/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Unit]: + if response.status_code == 200: + response_200 = Unit.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Unit]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Unit] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Unit + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Unit] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Unit]: + """This ViewSet manages units. + Delete method is not allowed. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Unit + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_create.py new file mode 100644 index 0000000..66f2e23 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_create.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.poly_ticket_user import PolyTicketUser +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + PolyTicketUser, + PolyTicketUser, + PolyTicketUser, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/core/users/", + } + + if isinstance(body, PolyTicketUser): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PolyTicketUser): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PolyTicketUser): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PolyTicketUser]: + if response.status_code == 201: + response_201 = PolyTicketUser.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PolyTicketUser]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PolyTicketUser, + PolyTicketUser, + PolyTicketUser, + ], +) -> Response[PolyTicketUser]: + """ + Args: + body (PolyTicketUser): + body (PolyTicketUser): + body (PolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PolyTicketUser] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + PolyTicketUser, + PolyTicketUser, + PolyTicketUser, + ], +) -> Optional[PolyTicketUser]: + """ + Args: + body (PolyTicketUser): + body (PolyTicketUser): + body (PolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PolyTicketUser + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PolyTicketUser, + PolyTicketUser, + PolyTicketUser, + ], +) -> Response[PolyTicketUser]: + """ + Args: + body (PolyTicketUser): + body (PolyTicketUser): + body (PolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PolyTicketUser] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + PolyTicketUser, + PolyTicketUser, + PolyTicketUser, + ], +) -> Optional[PolyTicketUser]: + """ + Args: + body (PolyTicketUser): + body (PolyTicketUser): + body (PolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PolyTicketUser + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_destroy.py new file mode 100644 index 0000000..343e55e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/core/users/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_list.py new file mode 100644 index 0000000..4efb463 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_list.py @@ -0,0 +1,263 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_poly_ticket_user_list import PaginatedPolyTicketUserList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + email: Union[Unset, str] = UNSET, + first_name: Union[Unset, str] = UNSET, + last_name: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + units: Union[Unset, list[int]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["email"] = email + + params["first_name"] = first_name + + params["last_name"] = last_name + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + json_units: Union[Unset, list[int]] = UNSET + if not isinstance(units, Unset): + json_units = units + + params["units"] = json_units + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/core/users/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedPolyTicketUserList]: + if response.status_code == 200: + response_200 = PaginatedPolyTicketUserList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedPolyTicketUserList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + email: Union[Unset, str] = UNSET, + first_name: Union[Unset, str] = UNSET, + last_name: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + units: Union[Unset, list[int]] = UNSET, +) -> Response[PaginatedPolyTicketUserList]: + """ + Args: + email (Union[Unset, str]): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + units (Union[Unset, list[int]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPolyTicketUserList] + """ + + kwargs = _get_kwargs( + email=email, + first_name=first_name, + last_name=last_name, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + units=units, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + email: Union[Unset, str] = UNSET, + first_name: Union[Unset, str] = UNSET, + last_name: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + units: Union[Unset, list[int]] = UNSET, +) -> Optional[PaginatedPolyTicketUserList]: + """ + Args: + email (Union[Unset, str]): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + units (Union[Unset, list[int]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPolyTicketUserList + """ + + return sync_detailed( + client=client, + email=email, + first_name=first_name, + last_name=last_name, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + units=units, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + email: Union[Unset, str] = UNSET, + first_name: Union[Unset, str] = UNSET, + last_name: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + units: Union[Unset, list[int]] = UNSET, +) -> Response[PaginatedPolyTicketUserList]: + """ + Args: + email (Union[Unset, str]): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + units (Union[Unset, list[int]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPolyTicketUserList] + """ + + kwargs = _get_kwargs( + email=email, + first_name=first_name, + last_name=last_name, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + units=units, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + email: Union[Unset, str] = UNSET, + first_name: Union[Unset, str] = UNSET, + last_name: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + units: Union[Unset, list[int]] = UNSET, +) -> Optional[PaginatedPolyTicketUserList]: + """ + Args: + email (Union[Unset, str]): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + units (Union[Unset, list[int]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPolyTicketUserList + """ + + return ( + await asyncio_detailed( + client=client, + email=email, + first_name=first_name, + last_name=last_name, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + units=units, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_partial_update.py new file mode 100644 index 0000000..a677f17 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_poly_ticket_user import PatchedPolyTicketUser +from ...models.poly_ticket_user import PolyTicketUser +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedPolyTicketUser, + PatchedPolyTicketUser, + PatchedPolyTicketUser, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/core/users/{id}/", + } + + if isinstance(body, PatchedPolyTicketUser): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedPolyTicketUser): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedPolyTicketUser): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PolyTicketUser]: + if response.status_code == 200: + response_200 = PolyTicketUser.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PolyTicketUser]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPolyTicketUser, + PatchedPolyTicketUser, + PatchedPolyTicketUser, + ], +) -> Response[PolyTicketUser]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PolyTicketUser] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPolyTicketUser, + PatchedPolyTicketUser, + PatchedPolyTicketUser, + ], +) -> Optional[PolyTicketUser]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PolyTicketUser + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPolyTicketUser, + PatchedPolyTicketUser, + PatchedPolyTicketUser, + ], +) -> Response[PolyTicketUser]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PolyTicketUser] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPolyTicketUser, + PatchedPolyTicketUser, + PatchedPolyTicketUser, + ], +) -> Optional[PolyTicketUser]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + body (PatchedPolyTicketUser): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PolyTicketUser + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_retrieve.py new file mode 100644 index 0000000..f8c5913 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/core/core_users_retrieve.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.poly_ticket_user import PolyTicketUser +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/core/users/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PolyTicketUser]: + if response.status_code == 200: + response_200 = PolyTicketUser.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PolyTicketUser]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[PolyTicketUser]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PolyTicketUser] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[PolyTicketUser]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PolyTicketUser + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[PolyTicketUser]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PolyTicketUser] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[PolyTicketUser]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PolyTicketUser + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_duplicate_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_duplicate_create.py new file mode 100644 index 0000000..b64e62c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_duplicate_create.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event import Event +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + Event, + Event, + Event, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/events/events/{id}/actions/duplicate/", + } + + if isinstance(body, Event): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Event): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Event): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Event]: + if response.status_code == 200: + response_200 = Event.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Event]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Response[Event]: + """Duplicate an event, its active modules and all configurations + + Args: + id (int): + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Optional[Event]: + """Duplicate an event, its active modules and all configurations + + Args: + id (int): + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Response[Event]: + """Duplicate an event, its active modules and all configurations + + Args: + id (int): + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Optional[Event]: + """Duplicate an event, its active modules and all configurations + + Args: + id (int): + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_export_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_export_create.py new file mode 100644 index 0000000..9e47367 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_export_create.py @@ -0,0 +1,244 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event import Event +from ...models.events_events_actions_export_create_file_type import EventsEventsActionsExportCreateFileType +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + Event, + Event, + Event, + ], + file_type: Union[Unset, EventsEventsActionsExportCreateFileType] = EventsEventsActionsExportCreateFileType.XLSX, + testing: Union[Unset, bool] = False, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + json_file_type: Union[Unset, str] = UNSET + if not isinstance(file_type, Unset): + json_file_type = file_type.value + + params["file_type"] = json_file_type + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/events/events/{id}/actions/export/", + "params": params, + } + + if isinstance(body, Event): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Event): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Event): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Event]: + if response.status_code == 200: + response_200 = Event.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Event]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], + file_type: Union[Unset, EventsEventsActionsExportCreateFileType] = EventsEventsActionsExportCreateFileType.XLSX, + testing: Union[Unset, bool] = False, +) -> Response[Event]: + """ + Args: + id (int): + file_type (Union[Unset, EventsEventsActionsExportCreateFileType]): Default: + EventsEventsActionsExportCreateFileType.XLSX. + testing (Union[Unset, bool]): Default: False. + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + file_type=file_type, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], + file_type: Union[Unset, EventsEventsActionsExportCreateFileType] = EventsEventsActionsExportCreateFileType.XLSX, + testing: Union[Unset, bool] = False, +) -> Optional[Event]: + """ + Args: + id (int): + file_type (Union[Unset, EventsEventsActionsExportCreateFileType]): Default: + EventsEventsActionsExportCreateFileType.XLSX. + testing (Union[Unset, bool]): Default: False. + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return sync_detailed( + id=id, + client=client, + body=body, + file_type=file_type, + testing=testing, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], + file_type: Union[Unset, EventsEventsActionsExportCreateFileType] = EventsEventsActionsExportCreateFileType.XLSX, + testing: Union[Unset, bool] = False, +) -> Response[Event]: + """ + Args: + id (int): + file_type (Union[Unset, EventsEventsActionsExportCreateFileType]): Default: + EventsEventsActionsExportCreateFileType.XLSX. + testing (Union[Unset, bool]): Default: False. + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + file_type=file_type, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], + file_type: Union[Unset, EventsEventsActionsExportCreateFileType] = EventsEventsActionsExportCreateFileType.XLSX, + testing: Union[Unset, bool] = False, +) -> Optional[Event]: + """ + Args: + id (int): + file_type (Union[Unset, EventsEventsActionsExportCreateFileType]): Default: + EventsEventsActionsExportCreateFileType.XLSX. + testing (Union[Unset, bool]): Default: False. + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + file_type=file_type, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_moderate_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_moderate_create.py new file mode 100644 index 0000000..07ebd95 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_moderate_create.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event_moderation import EventModeration +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + EventModeration, + EventModeration, + EventModeration, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/events/events/{id}/actions/moderate/", + } + + if isinstance(body, EventModeration): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, EventModeration): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, EventModeration): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + EventModeration, + EventModeration, + EventModeration, + ], +) -> Response[Any]: + """Action from the PolyTicket team to moderate an event. + + If the event is valid: change moderation_status to validated and send an email to the organisers to + notify them of the validation. + + Else: change moderation_status to change_requested and send an email to the organisers to ask for + necessary changes. + + Args: + id (int): + body (EventModeration): Write only serializer, used by admin to validate an event. + body (EventModeration): Write only serializer, used by admin to validate an event. + body (EventModeration): Write only serializer, used by admin to validate an event. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + EventModeration, + EventModeration, + EventModeration, + ], +) -> Response[Any]: + """Action from the PolyTicket team to moderate an event. + + If the event is valid: change moderation_status to validated and send an email to the organisers to + notify them of the validation. + + Else: change moderation_status to change_requested and send an email to the organisers to ask for + necessary changes. + + Args: + id (int): + body (EventModeration): Write only serializer, used by admin to validate an event. + body (EventModeration): Write only serializer, used by admin to validate an event. + body (EventModeration): Write only serializer, used by admin to validate an event. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_node_stocks_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_node_stocks_list.py new file mode 100644 index 0000000..59245d2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_node_stocks_list.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_stock import NodeStock +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + testing: Union[Unset, bool] = False, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/events/events/{id}/actions/node_stocks/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["NodeStock"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = NodeStock.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["NodeStock"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + testing: Union[Unset, bool] = False, +) -> Response[list["NodeStock"]]: + """This endpoint returns an overview of what has been consumed of the event so far, and how many items + remain, when applicable. Each object of the response represents one node, with related usage + information and limits + + Args: + id (int): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[list['NodeStock']] + """ + + kwargs = _get_kwargs( + id=id, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + testing: Union[Unset, bool] = False, +) -> Optional[list["NodeStock"]]: + """This endpoint returns an overview of what has been consumed of the event so far, and how many items + remain, when applicable. Each object of the response represents one node, with related usage + information and limits + + Args: + id (int): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + list['NodeStock'] + """ + + return sync_detailed( + id=id, + client=client, + testing=testing, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + testing: Union[Unset, bool] = False, +) -> Response[list["NodeStock"]]: + """This endpoint returns an overview of what has been consumed of the event so far, and how many items + remain, when applicable. Each object of the response represents one node, with related usage + information and limits + + Args: + id (int): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[list['NodeStock']] + """ + + kwargs = _get_kwargs( + id=id, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + testing: Union[Unset, bool] = False, +) -> Optional[list["NodeStock"]]: + """This endpoint returns an overview of what has been consumed of the event so far, and how many items + remain, when applicable. Each object of the response represents one node, with related usage + information and limits + + Args: + id (int): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + list['NodeStock'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_public_infos_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_public_infos_retrieve.py new file mode 100644 index 0000000..25a00f4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_public_infos_retrieve.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event_public_infos import EventPublicInfos +from ...types import UNSET, Response + + +def _get_kwargs( + frontend_path: str, + *, + testing: bool, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/events/events/actions/public_infos/{frontend_path}/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EventPublicInfos]: + if response.status_code == 200: + response_200 = EventPublicInfos.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[EventPublicInfos]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + frontend_path: str, + *, + client: AuthenticatedClient, + testing: bool, +) -> Response[EventPublicInfos]: + """ + Args: + frontend_path (str): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[EventPublicInfos] + """ + + kwargs = _get_kwargs( + frontend_path=frontend_path, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + frontend_path: str, + *, + client: AuthenticatedClient, + testing: bool, +) -> Optional[EventPublicInfos]: + """ + Args: + frontend_path (str): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + EventPublicInfos + """ + + return sync_detailed( + frontend_path=frontend_path, + client=client, + testing=testing, + ).parsed + + +async def asyncio_detailed( + frontend_path: str, + *, + client: AuthenticatedClient, + testing: bool, +) -> Response[EventPublicInfos]: + """ + Args: + frontend_path (str): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[EventPublicInfos] + """ + + kwargs = _get_kwargs( + frontend_path=frontend_path, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + frontend_path: str, + *, + client: AuthenticatedClient, + testing: bool, +) -> Optional[EventPublicInfos]: + """ + Args: + frontend_path (str): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + EventPublicInfos + """ + + return ( + await asyncio_detailed( + frontend_path=frontend_path, + client=client, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_request_moderation_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_request_moderation_create.py new file mode 100644 index 0000000..f867367 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_request_moderation_create.py @@ -0,0 +1,95 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/events/events/{id}/actions/request_moderation/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Action to request moderation from the PolyTicket team on an event. Send a mail to PolyTicket with + all necessary information and change moderation_status to requested. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """Action to request moderation from the PolyTicket team on an event. Send a mail to PolyTicket with + all necessary information and change moderation_status to requested. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_statistics_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_statistics_retrieve.py new file mode 100644 index 0000000..8a67063 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_statistics_retrieve.py @@ -0,0 +1,264 @@ +import datetime +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event_statistics import EventStatistics +from ...models.events_events_actions_statistics_retrieve_granularity import ( + EventsEventsActionsStatisticsRetrieveGranularity, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + granularity: Union[ + Unset, EventsEventsActionsStatisticsRetrieveGranularity + ] = EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP, + interval_end: Union[Unset, datetime.datetime] = UNSET, + interval_start: Union[Unset, datetime.datetime] = UNSET, + testing: Union[Unset, bool] = False, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_granularity: Union[Unset, str] = UNSET + if not isinstance(granularity, Unset): + json_granularity = granularity.value + + params["granularity"] = json_granularity + + json_interval_end: Union[Unset, str] = UNSET + if not isinstance(interval_end, Unset): + json_interval_end = interval_end.isoformat() + params["interval_end"] = json_interval_end + + json_interval_start: Union[Unset, str] = UNSET + if not isinstance(interval_start, Unset): + json_interval_start = interval_start.isoformat() + params["interval_start"] = json_interval_start + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/events/events/{id}/actions/statistics/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[EventStatistics]: + if response.status_code == 200: + response_200 = EventStatistics.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[EventStatistics]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + granularity: Union[ + Unset, EventsEventsActionsStatisticsRetrieveGranularity + ] = EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP, + interval_end: Union[Unset, datetime.datetime] = UNSET, + interval_start: Union[Unset, datetime.datetime] = UNSET, + testing: Union[Unset, bool] = False, +) -> Response[EventStatistics]: + """Get event statistics by chosen granularity. Please note that data isn't sorted in chronological + order within the different dicts. + Includes all data after `interval_start`, adding a point at `interval_start` with the last known + value before it (or 0 if none). + Includes all data before `interval_end`, adding a point at `interval_end` with the next available + value (or the last known value if none). + + Args: + id (int): + granularity (Union[Unset, EventsEventsActionsStatisticsRetrieveGranularity]): Default: + EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP. + interval_end (Union[Unset, datetime.datetime]): + interval_start (Union[Unset, datetime.datetime]): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[EventStatistics] + """ + + kwargs = _get_kwargs( + id=id, + granularity=granularity, + interval_end=interval_end, + interval_start=interval_start, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + granularity: Union[ + Unset, EventsEventsActionsStatisticsRetrieveGranularity + ] = EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP, + interval_end: Union[Unset, datetime.datetime] = UNSET, + interval_start: Union[Unset, datetime.datetime] = UNSET, + testing: Union[Unset, bool] = False, +) -> Optional[EventStatistics]: + """Get event statistics by chosen granularity. Please note that data isn't sorted in chronological + order within the different dicts. + Includes all data after `interval_start`, adding a point at `interval_start` with the last known + value before it (or 0 if none). + Includes all data before `interval_end`, adding a point at `interval_end` with the next available + value (or the last known value if none). + + Args: + id (int): + granularity (Union[Unset, EventsEventsActionsStatisticsRetrieveGranularity]): Default: + EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP. + interval_end (Union[Unset, datetime.datetime]): + interval_start (Union[Unset, datetime.datetime]): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + EventStatistics + """ + + return sync_detailed( + id=id, + client=client, + granularity=granularity, + interval_end=interval_end, + interval_start=interval_start, + testing=testing, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + granularity: Union[ + Unset, EventsEventsActionsStatisticsRetrieveGranularity + ] = EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP, + interval_end: Union[Unset, datetime.datetime] = UNSET, + interval_start: Union[Unset, datetime.datetime] = UNSET, + testing: Union[Unset, bool] = False, +) -> Response[EventStatistics]: + """Get event statistics by chosen granularity. Please note that data isn't sorted in chronological + order within the different dicts. + Includes all data after `interval_start`, adding a point at `interval_start` with the last known + value before it (or 0 if none). + Includes all data before `interval_end`, adding a point at `interval_end` with the next available + value (or the last known value if none). + + Args: + id (int): + granularity (Union[Unset, EventsEventsActionsStatisticsRetrieveGranularity]): Default: + EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP. + interval_end (Union[Unset, datetime.datetime]): + interval_start (Union[Unset, datetime.datetime]): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[EventStatistics] + """ + + kwargs = _get_kwargs( + id=id, + granularity=granularity, + interval_end=interval_end, + interval_start=interval_start, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + granularity: Union[ + Unset, EventsEventsActionsStatisticsRetrieveGranularity + ] = EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP, + interval_end: Union[Unset, datetime.datetime] = UNSET, + interval_start: Union[Unset, datetime.datetime] = UNSET, + testing: Union[Unset, bool] = False, +) -> Optional[EventStatistics]: + """Get event statistics by chosen granularity. Please note that data isn't sorted in chronological + order within the different dicts. + Includes all data after `interval_start`, adding a point at `interval_start` with the last known + value before it (or 0 if none). + Includes all data before `interval_end`, adding a point at `interval_end` with the next available + value (or the last known value if none). + + Args: + id (int): + granularity (Union[Unset, EventsEventsActionsStatisticsRetrieveGranularity]): Default: + EventsEventsActionsStatisticsRetrieveGranularity.TIMESTAMP. + interval_end (Union[Unset, datetime.datetime]): + interval_start (Union[Unset, datetime.datetime]): + testing (Union[Unset, bool]): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + EventStatistics + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + granularity=granularity, + interval_end=interval_end, + interval_start=interval_start, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_ticket_office_infos_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_ticket_office_infos_retrieve.py new file mode 100644 index 0000000..b71e909 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_actions_ticket_office_infos_retrieve.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.ticket_office_infos import TicketOfficeInfos +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + frontend_basket: int, + node_selected_ids: Union[Unset, list[float]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["frontend_basket"] = frontend_basket + + json_node_selected_ids: Union[Unset, list[float]] = UNSET + if not isinstance(node_selected_ids, Unset): + json_node_selected_ids = node_selected_ids + + params["node_selected_ids"] = json_node_selected_ids + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/events/events/{id}/actions/ticket_office_infos/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TicketOfficeInfos]: + if response.status_code == 200: + response_200 = TicketOfficeInfos.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TicketOfficeInfos]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + frontend_basket: int, + node_selected_ids: Union[Unset, list[float]] = UNSET, +) -> Response[TicketOfficeInfos]: + """Get all infos related to an Event, filtered based on Conditions + + Args: + id (int): + frontend_basket (int): + node_selected_ids (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TicketOfficeInfos] + """ + + kwargs = _get_kwargs( + id=id, + frontend_basket=frontend_basket, + node_selected_ids=node_selected_ids, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + frontend_basket: int, + node_selected_ids: Union[Unset, list[float]] = UNSET, +) -> Optional[TicketOfficeInfos]: + """Get all infos related to an Event, filtered based on Conditions + + Args: + id (int): + frontend_basket (int): + node_selected_ids (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TicketOfficeInfos + """ + + return sync_detailed( + id=id, + client=client, + frontend_basket=frontend_basket, + node_selected_ids=node_selected_ids, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + frontend_basket: int, + node_selected_ids: Union[Unset, list[float]] = UNSET, +) -> Response[TicketOfficeInfos]: + """Get all infos related to an Event, filtered based on Conditions + + Args: + id (int): + frontend_basket (int): + node_selected_ids (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TicketOfficeInfos] + """ + + kwargs = _get_kwargs( + id=id, + frontend_basket=frontend_basket, + node_selected_ids=node_selected_ids, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + frontend_basket: int, + node_selected_ids: Union[Unset, list[float]] = UNSET, +) -> Optional[TicketOfficeInfos]: + """Get all infos related to an Event, filtered based on Conditions + + Args: + id (int): + frontend_basket (int): + node_selected_ids (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TicketOfficeInfos + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + frontend_basket=frontend_basket, + node_selected_ids=node_selected_ids, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_create.py new file mode 100644 index 0000000..f3a8399 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_create.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event import Event +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Event, + Event, + Event, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/events/events/", + } + + if isinstance(body, Event): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Event): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Event): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Event]: + if response.status_code == 201: + response_201 = Event.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Event]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Response[Event]: + """ + Args: + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Optional[Event]: + """ + Args: + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Response[Event]: + """ + Args: + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Event, + Event, + Event, + ], +) -> Optional[Event]: + """ + Args: + body (Event): Serializer for Node model + body (Event): Serializer for Node model + body (Event): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_destroy.py new file mode 100644 index 0000000..957ef1e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/events/events/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_list.py new file mode 100644 index 0000000..cea18e5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_list.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_event_list import PaginatedEventList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + unit: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params["unit"] = unit + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/events/events/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedEventList]: + if response.status_code == 200: + response_200 = PaginatedEventList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedEventList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + unit: Union[Unset, int] = UNSET, +) -> Response[PaginatedEventList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + unit (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedEventList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + unit=unit, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + unit: Union[Unset, int] = UNSET, +) -> Optional[PaginatedEventList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + unit (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedEventList + """ + + return sync_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + unit=unit, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + unit: Union[Unset, int] = UNSET, +) -> Response[PaginatedEventList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + unit (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedEventList] + """ + + kwargs = _get_kwargs( + o=o, + offset=offset, + page_limit=page_limit, + q=q, + unit=unit, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + unit: Union[Unset, int] = UNSET, +) -> Optional[PaginatedEventList]: + """ + Args: + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + unit (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedEventList + """ + + return ( + await asyncio_detailed( + client=client, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + unit=unit, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_partial_update.py new file mode 100644 index 0000000..8339bb7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event import Event +from ...models.patched_event import PatchedEvent +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedEvent, + PatchedEvent, + PatchedEvent, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/events/events/{id}/", + } + + if isinstance(body, PatchedEvent): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedEvent): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedEvent): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Event]: + if response.status_code == 200: + response_200 = Event.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Event]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedEvent, + PatchedEvent, + PatchedEvent, + ], +) -> Response[Event]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedEvent, + PatchedEvent, + PatchedEvent, + ], +) -> Optional[Event]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedEvent, + PatchedEvent, + PatchedEvent, + ], +) -> Response[Event]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedEvent, + PatchedEvent, + PatchedEvent, + ], +) -> Optional[Event]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + body (PatchedEvent): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_retrieve.py new file mode 100644 index 0000000..9fbfce5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/events/events_events_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.event import Event +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/events/events/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Event]: + if response.status_code == 200: + response_200 = Event.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Event]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Event]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Event]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Event]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Event] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Event]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Event + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_actions_create_login_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_actions_create_login_create.py new file mode 100644 index 0000000..05002d4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_actions_create_login_create.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_anonymous_login import CreateAnonymousLogin +from ...models.login_jwt import LoginJWT +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + CreateAnonymousLogin, + CreateAnonymousLogin, + CreateAnonymousLogin, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/anonymous_login/actions/create_login/", + } + + if isinstance(body, CreateAnonymousLogin): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, CreateAnonymousLogin): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, CreateAnonymousLogin): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoginJWT]: + if response.status_code == 200: + response_200 = LoginJWT.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoginJWT]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + CreateAnonymousLogin, + CreateAnonymousLogin, + CreateAnonymousLogin, + ], +) -> Response[LoginJWT]: + """Create an anonymous frontend login. Accessible only on public events or in testing mode. + + Args: + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginJWT] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + CreateAnonymousLogin, + CreateAnonymousLogin, + CreateAnonymousLogin, + ], +) -> Optional[LoginJWT]: + """Create an anonymous frontend login. Accessible only on public events or in testing mode. + + Args: + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginJWT + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + CreateAnonymousLogin, + CreateAnonymousLogin, + CreateAnonymousLogin, + ], +) -> Response[LoginJWT]: + """Create an anonymous frontend login. Accessible only on public events or in testing mode. + + Args: + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginJWT] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + CreateAnonymousLogin, + CreateAnonymousLogin, + CreateAnonymousLogin, + ], +) -> Optional[LoginJWT]: + """Create an anonymous frontend login. Accessible only on public events or in testing mode. + + Args: + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + body (CreateAnonymousLogin): Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginJWT + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_create.py new file mode 100644 index 0000000..4d3ce95 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_anonymous_login_active_module import ModuleAuthAnonymousLoginActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/anonymous_login/modules/", + } + + if isinstance(body, ModuleAuthAnonymousLoginActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleAuthAnonymousLoginActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleAuthAnonymousLoginActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + if response.status_code == 201: + response_201 = ModuleAuthAnonymousLoginActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ], +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthAnonymousLoginActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ], +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthAnonymousLoginActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ], +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthAnonymousLoginActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ModuleAuthAnonymousLoginActiveModule, + ], +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + body (ModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthAnonymousLoginActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_destroy.py new file mode 100644 index 0000000..ca3ea5b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_auth/anonymous_login/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_list.py new file mode 100644 index 0000000..9a832ef --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_auth_anonymous_login_active_module_list import ( + PaginatedModuleAuthAnonymousLoginActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_auth/anonymous_login/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleAuthAnonymousLoginActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleAuthAnonymousLoginActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleAuthAnonymousLoginActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleAuthAnonymousLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleAuthAnonymousLoginActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleAuthAnonymousLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleAuthAnonymousLoginActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleAuthAnonymousLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleAuthAnonymousLoginActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleAuthAnonymousLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleAuthAnonymousLoginActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_partial_update.py new file mode 100644 index 0000000..7fa8384 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_anonymous_login_active_module import ModuleAuthAnonymousLoginActiveModule +from ...models.patched_module_auth_anonymous_login_active_module import PatchedModuleAuthAnonymousLoginActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_auth/anonymous_login/modules/{id}/", + } + + if isinstance(body, PatchedModuleAuthAnonymousLoginActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleAuthAnonymousLoginActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleAuthAnonymousLoginActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + if response.status_code == 200: + response_200 = ModuleAuthAnonymousLoginActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + ], +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthAnonymousLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + ], +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthAnonymousLoginActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + ], +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthAnonymousLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + PatchedModuleAuthAnonymousLoginActiveModule, + ], +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + body (PatchedModuleAuthAnonymousLoginActiveModule): Serializer for `ActiveModule` linked + to `ModuleAuthAnonymousLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthAnonymousLoginActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_retrieve.py new file mode 100644 index 0000000..d4d0370 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_anonymous_login_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_anonymous_login_active_module import ModuleAuthAnonymousLoginActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_auth/anonymous_login/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + if response.status_code == 200: + response_200 = ModuleAuthAnonymousLoginActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthAnonymousLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthAnonymousLoginActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthAnonymousLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleAuthAnonymousLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthAnonymousLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthAnonymousLoginActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_list.py new file mode 100644 index 0000000..b93a17b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_list.py @@ -0,0 +1,248 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_frontend_login_list import PaginatedFrontendLoginList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + json_id: Union[Unset, list[int]] = UNSET + if not isinstance(id, Unset): + json_id = id + + params["id"] = json_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_auth/frontend_logins/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedFrontendLoginList]: + if response.status_code == 200: + response_200 = PaginatedFrontendLoginList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedFrontendLoginList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Response[PaginatedFrontendLoginList]: + """ + Args: + event (Union[Unset, int]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedFrontendLoginList] + """ + + kwargs = _get_kwargs( + event=event, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Optional[PaginatedFrontendLoginList]: + """ + Args: + event (Union[Unset, int]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedFrontendLoginList + """ + + return sync_detailed( + client=client, + event=event, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Response[PaginatedFrontendLoginList]: + """ + Args: + event (Union[Unset, int]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedFrontendLoginList] + """ + + kwargs = _get_kwargs( + event=event, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Optional[PaginatedFrontendLoginList]: + """ + Args: + event (Union[Unset, int]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedFrontendLoginList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_retrieve.py new file mode 100644 index 0000000..07aee18 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_frontend_logins_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.frontend_login import FrontendLogin +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_auth/frontend_logins/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[FrontendLogin]: + if response.status_code == 200: + response_200 = FrontendLogin.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[FrontendLogin]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[FrontendLogin]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendLogin] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[FrontendLogin]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendLogin + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[FrontendLogin]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendLogin] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[FrontendLogin]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendLogin + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_login_methods_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_login_methods_list.py new file mode 100644 index 0000000..6f561c2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_login_methods_list.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_login_method_list import PaginatedLoginMethodList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: bool, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_auth/login_methods/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedLoginMethodList]: + if response.status_code == 200: + response_200 = PaginatedLoginMethodList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedLoginMethodList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: bool, +) -> Response[PaginatedLoginMethodList]: + """ + Args: + event (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedLoginMethodList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: bool, +) -> Optional[PaginatedLoginMethodList]: + """ + Args: + event (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedLoginMethodList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: bool, +) -> Response[PaginatedLoginMethodList]: + """ + Args: + event (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedLoginMethodList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + testing: bool, +) -> Optional[PaginatedLoginMethodList]: + """ + Args: + event (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + testing (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedLoginMethodList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_actions_validate_login_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_actions_validate_login_create.py new file mode 100644 index 0000000..03e9898 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_actions_validate_login_create.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.login_jwt import LoginJWT +from ...models.validate_third_party_token_login import ValidateThirdPartyTokenLogin +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/third_party_token_login/actions/validate_login/", + } + + if isinstance(body, ValidateThirdPartyTokenLogin): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ValidateThirdPartyTokenLogin): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ValidateThirdPartyTokenLogin): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoginJWT]: + if response.status_code == 200: + response_200 = LoginJWT.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoginJWT]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ], +) -> Response[LoginJWT]: + """ + Args: + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginJWT] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ], +) -> Optional[LoginJWT]: + """ + Args: + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginJWT + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ], +) -> Response[LoginJWT]: + """ + Args: + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginJWT] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ValidateThirdPartyTokenLogin, + ], +) -> Optional[LoginJWT]: + """ + Args: + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + body (ValidateThirdPartyTokenLogin): Serializer used in the authentication of third party + logins with `third_party_token`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginJWT + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_create.py new file mode 100644 index 0000000..b4069e5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_third_party_token_login_active_module import ModuleAuthThirdPartyTokenLoginActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/third_party_token_login/modules/", + } + + if isinstance(body, ModuleAuthThirdPartyTokenLoginActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleAuthThirdPartyTokenLoginActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleAuthThirdPartyTokenLoginActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + if response.status_code == 201: + response_201 = ModuleAuthThirdPartyTokenLoginActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthThirdPartyTokenLoginActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthThirdPartyTokenLoginActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthThirdPartyTokenLoginActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + body (ModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthThirdPartyTokenLoginActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_destroy.py new file mode 100644 index 0000000..13f5785 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_auth/third_party_token_login/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_list.py new file mode 100644 index 0000000..85b87bb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_auth_third_party_token_login_active_module_list import ( + PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_auth/third_party_token_login/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_partial_update.py new file mode 100644 index 0000000..e7a8019 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_partial_update.py @@ -0,0 +1,231 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_third_party_token_login_active_module import ModuleAuthThirdPartyTokenLoginActiveModule +from ...models.patched_module_auth_third_party_token_login_active_module import ( + PatchedModuleAuthThirdPartyTokenLoginActiveModule, +) +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_auth/third_party_token_login/modules/{id}/", + } + + if isinstance(body, PatchedModuleAuthThirdPartyTokenLoginActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleAuthThirdPartyTokenLoginActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleAuthThirdPartyTokenLoginActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + if response.status_code == 200: + response_200 = ModuleAuthThirdPartyTokenLoginActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthThirdPartyTokenLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthThirdPartyTokenLoginActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthThirdPartyTokenLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + PatchedModuleAuthThirdPartyTokenLoginActiveModule, + ], +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + body (PatchedModuleAuthThirdPartyTokenLoginActiveModule): Serializer for `ActiveModule` + linked to `ModuleAuthThirdPartyTokenLogin` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthThirdPartyTokenLoginActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_retrieve.py new file mode 100644 index 0000000..ad51eb6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_third_party_token_login_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_third_party_token_login_active_module import ModuleAuthThirdPartyTokenLoginActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_auth/third_party_token_login/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + if response.status_code == 200: + response_200 = ModuleAuthThirdPartyTokenLoginActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthThirdPartyTokenLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthThirdPartyTokenLoginActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthThirdPartyTokenLoginActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleAuthThirdPartyTokenLoginActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthThirdPartyTokenLoginActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_create_login_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_create_login_create.py new file mode 100644 index 0000000..9641a60 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_create_login_create.py @@ -0,0 +1,131 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_trusted_email_login import CreateTrustedEmailLogin +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + CreateTrustedEmailLogin, + CreateTrustedEmailLogin, + CreateTrustedEmailLogin, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/trusted_email/actions/create_login/", + } + + if isinstance(body, CreateTrustedEmailLogin): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, CreateTrustedEmailLogin): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, CreateTrustedEmailLogin): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + CreateTrustedEmailLogin, + CreateTrustedEmailLogin, + CreateTrustedEmailLogin, + ], +) -> Response[Any]: + """ + Args: + body (CreateTrustedEmailLogin): Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + body (CreateTrustedEmailLogin): Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + body (CreateTrustedEmailLogin): Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + CreateTrustedEmailLogin, + CreateTrustedEmailLogin, + CreateTrustedEmailLogin, + ], +) -> Response[Any]: + """ + Args: + body (CreateTrustedEmailLogin): Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + body (CreateTrustedEmailLogin): Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + body (CreateTrustedEmailLogin): Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_validate_login_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_validate_login_create.py new file mode 100644 index 0000000..6d3c963 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_actions_validate_login_create.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.login_jwt import LoginJWT +from ...models.validate_trusted_email_login import ValidateTrustedEmailLogin +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/trusted_email/actions/validate_login/", + } + + if isinstance(body, ValidateTrustedEmailLogin): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ValidateTrustedEmailLogin): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ValidateTrustedEmailLogin): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[LoginJWT]: + if response.status_code == 200: + response_200 = LoginJWT.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[LoginJWT]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ], +) -> Response[LoginJWT]: + """ + Args: + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginJWT] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ], +) -> Optional[LoginJWT]: + """ + Args: + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginJWT + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ], +) -> Response[LoginJWT]: + """ + Args: + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginJWT] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ValidateTrustedEmailLogin, + ], +) -> Optional[LoginJWT]: + """ + Args: + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + body (ValidateTrustedEmailLogin): Serializer used to retrieve credentials from the + TrustedEmailLogin activation url. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginJWT + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_create.py new file mode 100644 index 0000000..6f9bc42 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_trusted_email_active_module import ModuleAuthTrustedEmailActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_auth/trusted_email/modules/", + } + + if isinstance(body, ModuleAuthTrustedEmailActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleAuthTrustedEmailActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleAuthTrustedEmailActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + if response.status_code == 201: + response_201 = ModuleAuthTrustedEmailActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthTrustedEmailActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ], +) -> Response[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthTrustedEmailActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ], +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthTrustedEmailActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ], +) -> Response[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthTrustedEmailActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ModuleAuthTrustedEmailActiveModule, + ], +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (ModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthTrustedEmailActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_destroy.py new file mode 100644 index 0000000..882bc16 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_auth/trusted_email/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_list.py new file mode 100644 index 0000000..a318573 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_auth_trusted_email_active_module_list import ( + PaginatedModuleAuthTrustedEmailActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_auth/trusted_email/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleAuthTrustedEmailActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleAuthTrustedEmailActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleAuthTrustedEmailActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleAuthTrustedEmailActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleAuthTrustedEmailActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleAuthTrustedEmailActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleAuthTrustedEmailActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleAuthTrustedEmailActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleAuthTrustedEmailActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleAuthTrustedEmailActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleAuthTrustedEmailActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_partial_update.py new file mode 100644 index 0000000..f6d5de1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_trusted_email_active_module import ModuleAuthTrustedEmailActiveModule +from ...models.patched_module_auth_trusted_email_active_module import PatchedModuleAuthTrustedEmailActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_auth/trusted_email/modules/{id}/", + } + + if isinstance(body, PatchedModuleAuthTrustedEmailActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleAuthTrustedEmailActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleAuthTrustedEmailActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + if response.status_code == 200: + response_200 = ModuleAuthTrustedEmailActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthTrustedEmailActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + ], +) -> Response[ModuleAuthTrustedEmailActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthTrustedEmailActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + ], +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthTrustedEmailActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + ], +) -> Response[ModuleAuthTrustedEmailActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthTrustedEmailActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + PatchedModuleAuthTrustedEmailActiveModule, + ], +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + body (PatchedModuleAuthTrustedEmailActiveModule): Serializer for `ActiveModule` linked to + `ModuleAuthTrustedEmail` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthTrustedEmailActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_retrieve.py new file mode 100644 index 0000000..0c66848 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_auth/modules_auth_trusted_email_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_auth_trusted_email_active_module import ModuleAuthTrustedEmailActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_auth/trusted_email/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + if response.status_code == 200: + response_200 = ModuleAuthTrustedEmailActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleAuthTrustedEmailActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthTrustedEmailActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthTrustedEmailActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleAuthTrustedEmailActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleAuthTrustedEmailActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleAuthTrustedEmail`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleAuthTrustedEmailActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_create.py new file mode 100644 index 0000000..f722e9f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_create.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.billing_information import BillingInformation +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + BillingInformation, + BillingInformation, + BillingInformation, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_basket/billing_informations/", + } + + if isinstance(body, BillingInformation): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, BillingInformation): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, BillingInformation): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[BillingInformation]: + if response.status_code == 201: + response_201 = BillingInformation.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[BillingInformation]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + BillingInformation, + BillingInformation, + BillingInformation, + ], +) -> Response[BillingInformation]: + """ + Args: + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BillingInformation] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + BillingInformation, + BillingInformation, + BillingInformation, + ], +) -> Optional[BillingInformation]: + """ + Args: + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BillingInformation + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + BillingInformation, + BillingInformation, + BillingInformation, + ], +) -> Response[BillingInformation]: + """ + Args: + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BillingInformation] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + BillingInformation, + BillingInformation, + BillingInformation, + ], +) -> Optional[BillingInformation]: + """ + Args: + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + body (BillingInformation): Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your + request + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BillingInformation + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_list.py new file mode 100644 index 0000000..7f7687d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_list.py @@ -0,0 +1,274 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_billing_information_list import PaginatedBillingInformationList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + basket_id: Union[Unset, int] = UNSET, + created_by: Union[Unset, str] = UNSET, + event_id: Union[Unset, float] = UNSET, + is_deleted: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + user: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["basket_id"] = basket_id + + params["created_by"] = created_by + + params["event_id"] = event_id + + params["is_deleted"] = is_deleted + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params["user"] = user + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_basket/billing_informations/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedBillingInformationList]: + if response.status_code == 200: + response_200 = PaginatedBillingInformationList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedBillingInformationList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + created_by: Union[Unset, str] = UNSET, + event_id: Union[Unset, float] = UNSET, + is_deleted: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + user: Union[Unset, str] = UNSET, +) -> Response[PaginatedBillingInformationList]: + """ + Args: + basket_id (Union[Unset, int]): + created_by (Union[Unset, str]): + event_id (Union[Unset, float]): + is_deleted (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + user (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedBillingInformationList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + created_by=created_by, + event_id=event_id, + is_deleted=is_deleted, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + user=user, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + created_by: Union[Unset, str] = UNSET, + event_id: Union[Unset, float] = UNSET, + is_deleted: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + user: Union[Unset, str] = UNSET, +) -> Optional[PaginatedBillingInformationList]: + """ + Args: + basket_id (Union[Unset, int]): + created_by (Union[Unset, str]): + event_id (Union[Unset, float]): + is_deleted (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + user (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedBillingInformationList + """ + + return sync_detailed( + client=client, + basket_id=basket_id, + created_by=created_by, + event_id=event_id, + is_deleted=is_deleted, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + user=user, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + created_by: Union[Unset, str] = UNSET, + event_id: Union[Unset, float] = UNSET, + is_deleted: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + user: Union[Unset, str] = UNSET, +) -> Response[PaginatedBillingInformationList]: + """ + Args: + basket_id (Union[Unset, int]): + created_by (Union[Unset, str]): + event_id (Union[Unset, float]): + is_deleted (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + user (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedBillingInformationList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + created_by=created_by, + event_id=event_id, + is_deleted=is_deleted, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + user=user, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + created_by: Union[Unset, str] = UNSET, + event_id: Union[Unset, float] = UNSET, + is_deleted: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + user: Union[Unset, str] = UNSET, +) -> Optional[PaginatedBillingInformationList]: + """ + Args: + basket_id (Union[Unset, int]): + created_by (Union[Unset, str]): + event_id (Union[Unset, float]): + is_deleted (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + user (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedBillingInformationList + """ + + return ( + await asyncio_detailed( + client=client, + basket_id=basket_id, + created_by=created_by, + event_id=event_id, + is_deleted=is_deleted, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + user=user, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_retrieve.py new file mode 100644 index 0000000..82a1f10 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_billing_informations_retrieve.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.billing_information import BillingInformation +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_basket/billing_informations/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[BillingInformation]: + if response.status_code == 200: + response_200 = BillingInformation.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[BillingInformation]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[BillingInformation]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BillingInformation] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[BillingInformation]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BillingInformation + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[BillingInformation]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BillingInformation] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[BillingInformation]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BillingInformation + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_add_to_basket_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_add_to_basket_create.py new file mode 100644 index 0000000..322149b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_add_to_basket_create.py @@ -0,0 +1,280 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_node_creation import SelectedNodeCreation +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + SelectedNodeCreation, + SelectedNodeCreation, + SelectedNodeCreation, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_basket/frontend_baskets/{id}/actions/add_to_basket/", + "params": params, + } + + if isinstance(body, SelectedNodeCreation): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, SelectedNodeCreation): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, SelectedNodeCreation): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedNodeCreation]: + if response.status_code == 200: + response_200 = SelectedNodeCreation.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedNodeCreation]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeCreation, + SelectedNodeCreation, + SelectedNodeCreation, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[SelectedNodeCreation]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeCreation] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeCreation, + SelectedNodeCreation, + SelectedNodeCreation, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[SelectedNodeCreation]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeCreation + """ + + return sync_detailed( + id=id, + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeCreation, + SelectedNodeCreation, + SelectedNodeCreation, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[SelectedNodeCreation]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeCreation] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeCreation, + SelectedNodeCreation, + SelectedNodeCreation, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[SelectedNodeCreation]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + body (SelectedNodeCreation): A serializer used specifically in the add-to-basket process. + This serializer allows specifying all properties needed to add one item to the basket, + including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can + determine them directly in this direction. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeCreation + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_generate_ticket_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_generate_ticket_create.py new file mode 100644 index 0000000..acf4107 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_generate_ticket_create.py @@ -0,0 +1,232 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.frontend_basket import FrontendBasket +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_basket/frontend_baskets/{id}/actions/generate_ticket/", + "params": params, + } + + if isinstance(body, FrontendBasket): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, FrontendBasket): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, FrontendBasket): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FrontendBasket]: + if response.status_code == 200: + response_200 = FrontendBasket.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[FrontendBasket]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return sync_detailed( + id=id, + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_remove_from_basket_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_remove_from_basket_create.py new file mode 100644 index 0000000..991087a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_remove_from_basket_create.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_node_deletion import SelectedNodeDeletion +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + SelectedNodeDeletion, + SelectedNodeDeletion, + SelectedNodeDeletion, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_basket/frontend_baskets/{id}/actions/remove_from_basket/", + "params": params, + } + + if isinstance(body, SelectedNodeDeletion): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, SelectedNodeDeletion): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, SelectedNodeDeletion): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedNodeDeletion]: + if response.status_code == 200: + response_200 = SelectedNodeDeletion.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedNodeDeletion]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeDeletion, + SelectedNodeDeletion, + SelectedNodeDeletion, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[SelectedNodeDeletion]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeDeletion] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeDeletion, + SelectedNodeDeletion, + SelectedNodeDeletion, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[SelectedNodeDeletion]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeDeletion + """ + + return sync_detailed( + id=id, + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeDeletion, + SelectedNodeDeletion, + SelectedNodeDeletion, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[SelectedNodeDeletion]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeDeletion] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + SelectedNodeDeletion, + SelectedNodeDeletion, + SelectedNodeDeletion, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[SelectedNodeDeletion]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + body (SelectedNodeDeletion): A serializer used specifically in the remove-from-basket + process. This serializer takes only the id of the selected node to delete. The selected + node must currently be in the basket's registrations. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeDeletion + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve.py new file mode 100644 index 0000000..03e75bc --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve_inline_type import ( + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType, +) +from ...models.selected_node_extra_info import SelectedNodeExtraInfo +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + expand: Union[Unset, str] = UNSET, + inline_type: Union[ + Unset, ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType + ] = ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["expand"] = expand + + json_inline_type: Union[Unset, str] = UNSET + if not isinstance(inline_type, Unset): + json_inline_type = inline_type.value + + params["inline_type"] = json_inline_type + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_basket/frontend_baskets/{id}/actions/validate_extra_infos/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedNodeExtraInfo]: + if response.status_code == 200: + response_200 = SelectedNodeExtraInfo.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedNodeExtraInfo]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, + inline_type: Union[ + Unset, ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType + ] = ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL, +) -> Response[SelectedNodeExtraInfo]: + """Ensures that all required extra info fields have been filled. Returns the `SelectedNodeExtraInfos` + that are required but have no value, and an empty JSON if everything is correct. + + Args: + id (int): + expand (Union[Unset, str]): + inline_type (Union[Unset, + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType]): Default: + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + expand=expand, + inline_type=inline_type, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, + inline_type: Union[ + Unset, ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType + ] = ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL, +) -> Optional[SelectedNodeExtraInfo]: + """Ensures that all required extra info fields have been filled. Returns the `SelectedNodeExtraInfos` + that are required but have no value, and an empty JSON if everything is correct. + + Args: + id (int): + expand (Union[Unset, str]): + inline_type (Union[Unset, + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType]): Default: + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfo + """ + + return sync_detailed( + id=id, + client=client, + expand=expand, + inline_type=inline_type, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, + inline_type: Union[ + Unset, ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType + ] = ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL, +) -> Response[SelectedNodeExtraInfo]: + """Ensures that all required extra info fields have been filled. Returns the `SelectedNodeExtraInfos` + that are required but have no value, and an empty JSON if everything is correct. + + Args: + id (int): + expand (Union[Unset, str]): + inline_type (Union[Unset, + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType]): Default: + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + expand=expand, + inline_type=inline_type, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, + inline_type: Union[ + Unset, ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType + ] = ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL, +) -> Optional[SelectedNodeExtraInfo]: + """Ensures that all required extra info fields have been filled. Returns the `SelectedNodeExtraInfos` + that are required but have no value, and an empty JSON if everything is correct. + + Args: + id (int): + expand (Union[Unset, str]): + inline_type (Union[Unset, + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType]): Default: + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType.ALL. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfo + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + expand=expand, + inline_type=inline_type, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_create.py new file mode 100644 index 0000000..f299468 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_create.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.frontend_basket import FrontendBasket +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_basket/frontend_baskets/", + "params": params, + } + + if isinstance(body, FrontendBasket): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, FrontendBasket): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, FrontendBasket): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FrontendBasket]: + if response.status_code == 201: + response_201 = FrontendBasket.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[FrontendBasket]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return sync_detailed( + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + FrontendBasket, + FrontendBasket, + FrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + expand (Union[Unset, str]): + body (FrontendBasket): + body (FrontendBasket): + body (FrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_list.py new file mode 100644 index 0000000..c7462fa --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_list.py @@ -0,0 +1,282 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_frontend_basket_list import PaginatedFrontendBasketList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + created_by_id: Union[Unset, int] = UNSET, + event: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["created_by_id"] = created_by_id + + params["event"] = event + + params["expand"] = expand + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params["status"] = status + + params["testing"] = testing + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_basket/frontend_baskets/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedFrontendBasketList]: + if response.status_code == 200: + response_200 = PaginatedFrontendBasketList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedFrontendBasketList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + created_by_id: Union[Unset, int] = UNSET, + event: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Response[PaginatedFrontendBasketList]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + created_by_id (Union[Unset, int]): + event (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedFrontendBasketList] + """ + + kwargs = _get_kwargs( + created_by_id=created_by_id, + event=event, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + testing=testing, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + created_by_id: Union[Unset, int] = UNSET, + event: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Optional[PaginatedFrontendBasketList]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + created_by_id (Union[Unset, int]): + event (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedFrontendBasketList + """ + + return sync_detailed( + client=client, + created_by_id=created_by_id, + event=event, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + testing=testing, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + created_by_id: Union[Unset, int] = UNSET, + event: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Response[PaginatedFrontendBasketList]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + created_by_id (Union[Unset, int]): + event (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedFrontendBasketList] + """ + + kwargs = _get_kwargs( + created_by_id=created_by_id, + event=event, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + testing=testing, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + created_by_id: Union[Unset, int] = UNSET, + event: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + testing: Union[Unset, bool] = UNSET, +) -> Optional[PaginatedFrontendBasketList]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + created_by_id (Union[Unset, int]): + event (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + status (Union[Unset, str]): + testing (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedFrontendBasketList + """ + + return ( + await asyncio_detailed( + client=client, + created_by_id=created_by_id, + event=event, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + status=status, + testing=testing, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_partial_update.py new file mode 100644 index 0000000..0135b12 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_partial_update.py @@ -0,0 +1,237 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.frontend_basket import FrontendBasket +from ...models.patched_frontend_basket import PatchedFrontendBasket +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedFrontendBasket, + PatchedFrontendBasket, + PatchedFrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_basket/frontend_baskets/{id}/", + "params": params, + } + + if isinstance(body, PatchedFrontendBasket): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedFrontendBasket): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedFrontendBasket): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FrontendBasket]: + if response.status_code == 200: + response_200 = FrontendBasket.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[FrontendBasket]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedFrontendBasket, + PatchedFrontendBasket, + PatchedFrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + expand (Union[Unset, str]): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedFrontendBasket, + PatchedFrontendBasket, + PatchedFrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + expand (Union[Unset, str]): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return sync_detailed( + id=id, + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedFrontendBasket, + PatchedFrontendBasket, + PatchedFrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + expand (Union[Unset, str]): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedFrontendBasket, + PatchedFrontendBasket, + PatchedFrontendBasket, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + expand (Union[Unset, str]): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + body (PatchedFrontendBasket): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_retrieve.py new file mode 100644 index 0000000..31423cd --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_basket/modules_basket_frontend_baskets_retrieve.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.frontend_basket import FrontendBasket +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_basket/frontend_baskets/{id}/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[FrontendBasket]: + if response.status_code == 200: + response_200 = FrontendBasket.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[FrontendBasket]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + id=id, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return sync_detailed( + id=id, + client=client, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Response[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FrontendBasket] + """ + + kwargs = _get_kwargs( + id=id, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Optional[FrontendBasket]: + """ViewSet of model FrontendBasket, searching is possible via the following fields: + pk, total, selectednode__pk, created_by__pk, created_by__email and created_by__username + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FrontendBasket + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_completion_started_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_completion_started_create.py new file mode 100644 index 0000000..949e672 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_completion_started_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.completion_started import CompletionStarted +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + CompletionStarted, + CompletionStarted, + CompletionStarted, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_completion/completion_started/", + } + + if isinstance(body, CompletionStarted): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, CompletionStarted): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, CompletionStarted): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CompletionStarted]: + if response.status_code == 201: + response_201 = CompletionStarted.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CompletionStarted]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + CompletionStarted, + CompletionStarted, + CompletionStarted, + ], +) -> Response[CompletionStarted]: + """ViewSet to tell the backend that the customer has reached the ticket office summary page. + It will trigger hooks that, for example, send a payment reminder email. + + Args: + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CompletionStarted] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + CompletionStarted, + CompletionStarted, + CompletionStarted, + ], +) -> Optional[CompletionStarted]: + """ViewSet to tell the backend that the customer has reached the ticket office summary page. + It will trigger hooks that, for example, send a payment reminder email. + + Args: + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CompletionStarted + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + CompletionStarted, + CompletionStarted, + CompletionStarted, + ], +) -> Response[CompletionStarted]: + """ViewSet to tell the backend that the customer has reached the ticket office summary page. + It will trigger hooks that, for example, send a payment reminder email. + + Args: + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CompletionStarted] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + CompletionStarted, + CompletionStarted, + CompletionStarted, + ], +) -> Optional[CompletionStarted]: + """ViewSet to tell the backend that the customer has reached the ticket office summary page. + It will trigger hooks that, for example, send a payment reminder email. + + Args: + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + body (CompletionStarted): Serializer for CompletionStartedViewSet + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CompletionStarted + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_create.py new file mode 100644 index 0000000..e33cfb1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_completion/confirmation_page_extra_text/modules/", + } + + if isinstance(body, ConfirmationPageExtraTextActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ConfirmationPageExtraTextActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ConfirmationPageExtraTextActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ConfirmationPageExtraTextActiveModule]: + if response.status_code == 201: + response_201 = ConfirmationPageExtraTextActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ConfirmationPageExtraTextActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ], +) -> Response[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConfirmationPageExtraTextActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ], +) -> Optional[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConfirmationPageExtraTextActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ], +) -> Response[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConfirmationPageExtraTextActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ConfirmationPageExtraTextActiveModule, + ], +) -> Optional[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + body (ConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConfirmationPageExtraTextActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_destroy.py new file mode 100644 index 0000000..162dd8e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_completion/confirmation_page_extra_text/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_list.py new file mode 100644 index 0000000..e764fd1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_confirmation_page_extra_text_active_module_list import ( + PaginatedConfirmationPageExtraTextActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_completion/confirmation_page_extra_text/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedConfirmationPageExtraTextActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedConfirmationPageExtraTextActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedConfirmationPageExtraTextActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedConfirmationPageExtraTextActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedConfirmationPageExtraTextActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedConfirmationPageExtraTextActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedConfirmationPageExtraTextActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedConfirmationPageExtraTextActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedConfirmationPageExtraTextActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedConfirmationPageExtraTextActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedConfirmationPageExtraTextActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_partial_update.py new file mode 100644 index 0000000..9db071d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule +from ...models.patched_confirmation_page_extra_text_active_module import PatchedConfirmationPageExtraTextActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_completion/confirmation_page_extra_text/modules/{id}/", + } + + if isinstance(body, PatchedConfirmationPageExtraTextActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedConfirmationPageExtraTextActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedConfirmationPageExtraTextActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ConfirmationPageExtraTextActiveModule]: + if response.status_code == 200: + response_200 = ConfirmationPageExtraTextActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ConfirmationPageExtraTextActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + ], +) -> Response[ConfirmationPageExtraTextActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConfirmationPageExtraTextActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + ], +) -> Optional[ConfirmationPageExtraTextActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConfirmationPageExtraTextActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + ], +) -> Response[ConfirmationPageExtraTextActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConfirmationPageExtraTextActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + PatchedConfirmationPageExtraTextActiveModule, + ], +) -> Optional[ConfirmationPageExtraTextActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + body (PatchedConfirmationPageExtraTextActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionConfirmationPageExtraText` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConfirmationPageExtraTextActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_retrieve.py new file mode 100644 index 0000000..aebc8b7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_confirmation_page_extra_text_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_completion/confirmation_page_extra_text/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ConfirmationPageExtraTextActiveModule]: + if response.status_code == 200: + response_200 = ConfirmationPageExtraTextActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ConfirmationPageExtraTextActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConfirmationPageExtraTextActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConfirmationPageExtraTextActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConfirmationPageExtraTextActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ConfirmationPageExtraTextActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConfirmationPageExtraTextActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_create.py new file mode 100644 index 0000000..6529eed --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_create.py @@ -0,0 +1,209 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_email_registration_completed_active_module import ( + ModuleCompletionEmailRegistrationCompletedActiveModule, +) +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_completion/email_registration_completed_simple/modules/", + } + + if isinstance(body, ModuleCompletionEmailRegistrationCompletedActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleCompletionEmailRegistrationCompletedActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleCompletionEmailRegistrationCompletedActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + if response.status_code == 201: + response_201 = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCompletedActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCompletedActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCompletedActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (ModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCompletedActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_destroy.py new file mode 100644 index 0000000..3c8a38b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_completion/email_registration_completed_simple/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_list.py new file mode 100644 index 0000000..9ced62e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_completion_email_registration_completed_active_module_list import ( + PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_completion/email_registration_completed_simple/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_partial_update.py new file mode 100644 index 0000000..9e29e20 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_partial_update.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_email_registration_completed_active_module import ( + ModuleCompletionEmailRegistrationCompletedActiveModule, +) +from ...models.patched_module_completion_email_registration_completed_active_module import ( + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, +) +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_completion/email_registration_completed_simple/modules/{id}/", + } + + if isinstance(body, PatchedModuleCompletionEmailRegistrationCompletedActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleCompletionEmailRegistrationCompletedActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleCompletionEmailRegistrationCompletedActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCompletedActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCompletedActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCompletedActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + body (PatchedModuleCompletionEmailRegistrationCompletedActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCompletedActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_retrieve.py new file mode 100644 index 0000000..6bffa33 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_completed_simple_modules_retrieve.py @@ -0,0 +1,152 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_email_registration_completed_active_module import ( + ModuleCompletionEmailRegistrationCompletedActiveModule, +) +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_completion/email_registration_completed_simple/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCompletedActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCompletedActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCompletedActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionEmailRegistrationCompletedActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCompletedActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_create.py new file mode 100644 index 0000000..7c38b79 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_create.py @@ -0,0 +1,209 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_email_registration_creation_active_module import ( + ModuleCompletionEmailRegistrationCreationActiveModule, +) +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_completion/email_registration_creation/modules/", + } + + if isinstance(body, ModuleCompletionEmailRegistrationCreationActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleCompletionEmailRegistrationCreationActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleCompletionEmailRegistrationCreationActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + if response.status_code == 201: + response_201 = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCreationActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCreationActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCreationActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (ModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCreationActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_destroy.py new file mode 100644 index 0000000..0a4514d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_completion/email_registration_creation/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_list.py new file mode 100644 index 0000000..3faa187 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_completion_email_registration_creation_active_module_list import ( + PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_completion/email_registration_creation/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_partial_update.py new file mode 100644 index 0000000..7895969 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_partial_update.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_email_registration_creation_active_module import ( + ModuleCompletionEmailRegistrationCreationActiveModule, +) +from ...models.patched_module_completion_email_registration_creation_active_module import ( + PatchedModuleCompletionEmailRegistrationCreationActiveModule, +) +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_completion/email_registration_creation/modules/{id}/", + } + + if isinstance(body, PatchedModuleCompletionEmailRegistrationCreationActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleCompletionEmailRegistrationCreationActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleCompletionEmailRegistrationCreationActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCreationActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCreationActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCreationActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + PatchedModuleCompletionEmailRegistrationCreationActiveModule, + ], +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + body (PatchedModuleCompletionEmailRegistrationCreationActiveModule): Serializer for + `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCreationActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_retrieve.py new file mode 100644 index 0000000..84407fa --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_email_registration_creation_modules_retrieve.py @@ -0,0 +1,152 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_email_registration_creation_active_module import ( + ModuleCompletionEmailRegistrationCreationActiveModule, +) +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_completion/email_registration_creation/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCreationActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCreationActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionEmailRegistrationCreationActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionEmailRegistrationCreationActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionEmailRegistrationCreationActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_create.py new file mode 100644 index 0000000..5c830c8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_completion/pdf_ticket/modules/", + } + + if isinstance(body, ModuleCompletionPDFTicketActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleCompletionPDFTicketActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleCompletionPDFTicketActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + if response.status_code == 201: + response_201 = ModuleCompletionPDFTicketActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionPDFTicketActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ], +) -> Response[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionPDFTicketActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ], +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionPDFTicketActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ], +) -> Response[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionPDFTicketActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ModuleCompletionPDFTicketActiveModule, + ], +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + body (ModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionPDFTicketActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_destroy.py new file mode 100644 index 0000000..5209665 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_completion/pdf_ticket/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_list.py new file mode 100644 index 0000000..0afa812 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_completion_pdf_ticket_active_module_list import ( + PaginatedModuleCompletionPDFTicketActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_completion/pdf_ticket/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleCompletionPDFTicketActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleCompletionPDFTicketActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleCompletionPDFTicketActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionPDFTicketActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionPDFTicketActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionPDFTicketActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionPDFTicketActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionPDFTicketActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionPDFTicketActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionPDFTicketActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionPDFTicketActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_partial_update.py new file mode 100644 index 0000000..c8054fe --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule +from ...models.patched_module_completion_pdf_ticket_active_module import PatchedModuleCompletionPDFTicketActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_completion/pdf_ticket/modules/{id}/", + } + + if isinstance(body, PatchedModuleCompletionPDFTicketActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleCompletionPDFTicketActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleCompletionPDFTicketActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionPDFTicketActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionPDFTicketActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + ], +) -> Response[ModuleCompletionPDFTicketActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionPDFTicketActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + ], +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionPDFTicketActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + ], +) -> Response[ModuleCompletionPDFTicketActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionPDFTicketActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + PatchedModuleCompletionPDFTicketActiveModule, + ], +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + body (PatchedModuleCompletionPDFTicketActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionPDFTicket` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionPDFTicketActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_retrieve.py new file mode 100644 index 0000000..d76305e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_pdf_ticket_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_completion/pdf_ticket/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionPDFTicketActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionPDFTicketActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionPDFTicketActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionPDFTicketActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionPDFTicketActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionPDFTicketActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionPDFTicket`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionPDFTicketActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_create.py new file mode 100644 index 0000000..58bda25 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_completion/redirect/modules/", + } + + if isinstance(body, ModuleCompletionRedirectActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleCompletionRedirectActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleCompletionRedirectActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionRedirectActiveModule]: + if response.status_code == 201: + response_201 = ModuleCompletionRedirectActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionRedirectActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ], +) -> Response[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionRedirectActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ], +) -> Optional[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionRedirectActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ], +) -> Response[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionRedirectActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ModuleCompletionRedirectActiveModule, + ], +) -> Optional[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + body (ModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked to + `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionRedirectActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_destroy.py new file mode 100644 index 0000000..4cd43fa --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_completion/redirect/modules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_list.py new file mode 100644 index 0000000..7a1e288 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_completion_redirect_active_module_list import ( + PaginatedModuleCompletionRedirectActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_completion/redirect/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleCompletionRedirectActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleCompletionRedirectActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleCompletionRedirectActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionRedirectActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionRedirectActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionRedirectActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionRedirectActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleCompletionRedirectActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleCompletionRedirectActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleCompletionRedirectActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleCompletionRedirectActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_partial_update.py new file mode 100644 index 0000000..574d878 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule +from ...models.patched_module_completion_redirect_active_module import PatchedModuleCompletionRedirectActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_completion/redirect/modules/{id}/", + } + + if isinstance(body, PatchedModuleCompletionRedirectActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleCompletionRedirectActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleCompletionRedirectActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionRedirectActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionRedirectActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionRedirectActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + ], +) -> Response[ModuleCompletionRedirectActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionRedirectActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + ], +) -> Optional[ModuleCompletionRedirectActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionRedirectActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + ], +) -> Response[ModuleCompletionRedirectActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionRedirectActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + PatchedModuleCompletionRedirectActiveModule, + ], +) -> Optional[ModuleCompletionRedirectActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + body (PatchedModuleCompletionRedirectActiveModule): Serializer for `ActiveModule` linked + to `ModuleCompletionRedirect` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionRedirectActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_retrieve.py new file mode 100644 index 0000000..a01fbff --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_completion/modules_completion_redirect_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_completion/redirect/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleCompletionRedirectActiveModule]: + if response.status_code == 200: + response_200 = ModuleCompletionRedirectActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleCompletionRedirectActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionRedirectActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionRedirectActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleCompletionRedirectActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleCompletionRedirectActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleCompletionRedirect`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleCompletionRedirectActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_actions_start_payment_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_actions_start_payment_create.py new file mode 100644 index 0000000..848f1a2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_actions_start_payment_create.py @@ -0,0 +1,271 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.payment_start import PaymentStart +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + PaymentStart, + PaymentStart, + PaymentStart, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_payments/methods/actions/start_payment/", + } + + if isinstance(body, PaymentStart): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PaymentStart): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PaymentStart): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PaymentStart]: + if response.status_code == 200: + response_200 = PaymentStart.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PaymentStart]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PaymentStart, + PaymentStart, + PaymentStart, + ], +) -> Response[PaymentStart]: + """Use this endpoint to start a payment for a given basket. + + Payments must *also* be made for free / 0-amount baskets. + + A basket has the following requirements to be able to be paid: + - Terms of Service accepted + - Billing information is specified + - Is editable (all registrations of the basket must be in ``new`` state) + + You must provide the ID of the active module of the desired payment method for a non-zero payment, + otherwise you can omit this. + + This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket + is also directly marked as paid. + Else, if the requested payment method requires the user to continue on another website, the response + will include `is_external_redirect=true`, + and you must redirect the user to the URL specified in `link`. If the attribute is false, then you + must do the rest of the handling in the front end. + + Args: + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaymentStart] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + PaymentStart, + PaymentStart, + PaymentStart, + ], +) -> Optional[PaymentStart]: + """Use this endpoint to start a payment for a given basket. + + Payments must *also* be made for free / 0-amount baskets. + + A basket has the following requirements to be able to be paid: + - Terms of Service accepted + - Billing information is specified + - Is editable (all registrations of the basket must be in ``new`` state) + + You must provide the ID of the active module of the desired payment method for a non-zero payment, + otherwise you can omit this. + + This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket + is also directly marked as paid. + Else, if the requested payment method requires the user to continue on another website, the response + will include `is_external_redirect=true`, + and you must redirect the user to the URL specified in `link`. If the attribute is false, then you + must do the rest of the handling in the front end. + + Args: + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaymentStart + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PaymentStart, + PaymentStart, + PaymentStart, + ], +) -> Response[PaymentStart]: + """Use this endpoint to start a payment for a given basket. + + Payments must *also* be made for free / 0-amount baskets. + + A basket has the following requirements to be able to be paid: + - Terms of Service accepted + - Billing information is specified + - Is editable (all registrations of the basket must be in ``new`` state) + + You must provide the ID of the active module of the desired payment method for a non-zero payment, + otherwise you can omit this. + + This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket + is also directly marked as paid. + Else, if the requested payment method requires the user to continue on another website, the response + will include `is_external_redirect=true`, + and you must redirect the user to the URL specified in `link`. If the attribute is false, then you + must do the rest of the handling in the front end. + + Args: + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaymentStart] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + PaymentStart, + PaymentStart, + PaymentStart, + ], +) -> Optional[PaymentStart]: + """Use this endpoint to start a payment for a given basket. + + Payments must *also* be made for free / 0-amount baskets. + + A basket has the following requirements to be able to be paid: + - Terms of Service accepted + - Billing information is specified + - Is editable (all registrations of the basket must be in ``new`` state) + + You must provide the ID of the active module of the desired payment method for a non-zero payment, + otherwise you can omit this. + + This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket + is also directly marked as paid. + Else, if the requested payment method requires the user to continue on another website, the response + will include `is_external_redirect=true`, + and you must redirect the user to the URL specified in `link`. If the attribute is false, then you + must do the rest of the handling in the front end. + + Args: + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + body (PaymentStart): A serializer with a basket as an input to start the payment and with + a payment link for the response + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaymentStart + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_list.py new file mode 100644 index 0000000..d3f78cd --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_methods_list.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_payment_method_list import PaginatedPaymentMethodList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + basket: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["basket"] = basket + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_payments/methods/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedPaymentMethodList]: + if response.status_code == 200: + response_200 = PaginatedPaymentMethodList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedPaymentMethodList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + basket: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPaymentMethodList]: + """List available payment methods for the linked basket + + Args: + basket (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPaymentMethodList] + """ + + kwargs = _get_kwargs( + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + basket: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPaymentMethodList]: + """List available payment methods for the linked basket + + Args: + basket (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPaymentMethodList + """ + + return sync_detailed( + client=client, + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + basket: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPaymentMethodList]: + """List available payment methods for the linked basket + + Args: + basket (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPaymentMethodList] + """ + + kwargs = _get_kwargs( + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + basket: int, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPaymentMethodList]: + """List available payment methods for the linked basket + + Args: + basket (int): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPaymentMethodList + """ + + return ( + await asyncio_detailed( + client=client, + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_cancel_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_cancel_create.py new file mode 100644 index 0000000..6143930 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_cancel_create.py @@ -0,0 +1,260 @@ +from http import HTTPStatus +from typing import Any, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cancel_error import CancelError +from ...models.payment_intent import PaymentIntent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + PaymentIntent, + PaymentIntent, + PaymentIntent, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_payments/payment_intents/{id}/actions/cancel/", + "params": params, + } + + if isinstance(body, PaymentIntent): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PaymentIntent): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PaymentIntent): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CancelError]]: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + if response.status_code == 400: + response_400 = CancelError.from_dict(response.json()) + + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CancelError]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntent, + PaymentIntent, + PaymentIntent, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[Union[Any, CancelError]]: + """This view action cancels a payment intent and returns an error in case the payment intent was not in + a cancellable state (paid or already cancelled). + + After cancelling a payment intent, you should redirect the user to do the payment method choice and + order validation again. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CancelError]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntent, + PaymentIntent, + PaymentIntent, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[Union[Any, CancelError]]: + """This view action cancels a payment intent and returns an error in case the payment intent was not in + a cancellable state (paid or already cancelled). + + After cancelling a payment intent, you should redirect the user to do the payment method choice and + order validation again. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CancelError] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntent, + PaymentIntent, + PaymentIntent, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[Union[Any, CancelError]]: + """This view action cancels a payment intent and returns an error in case the payment intent was not in + a cancellable state (paid or already cancelled). + + After cancelling a payment intent, you should redirect the user to do the payment method choice and + order validation again. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CancelError]] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntent, + PaymentIntent, + PaymentIntent, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[Union[Any, CancelError]]: + """This view action cancels a payment intent and returns an error in case the payment intent was not in + a cancellable state (paid or already cancelled). + + After cancelling a payment intent, you should redirect the user to do the payment method choice and + order validation again. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice + or invoice_id depending on what the expand parameter is. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CancelError] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_request_status_update_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_request_status_update_create.py new file mode 100644 index 0000000..cfd7e18 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_actions_request_status_update_create.py @@ -0,0 +1,260 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.payment_intent_request_update import PaymentIntentRequestUpdate +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + body: Union[ + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + ], + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_payments/payment_intents/{id}/actions/request_status_update/", + "params": params, + } + + if isinstance(body, PaymentIntentRequestUpdate): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PaymentIntentRequestUpdate): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PaymentIntentRequestUpdate): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaymentIntentRequestUpdate]: + if response.status_code == 200: + response_200 = PaymentIntentRequestUpdate.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaymentIntentRequestUpdate]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[PaymentIntentRequestUpdate]: + """This view action must be provided with the `status` that the frontend has received from an external + PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of + the `PaymentIntent` is coherent with its status on the external PSP. + + After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of + `is_error`, `is_cancelled` or `invoice.is_resolved` have changed. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaymentIntentRequestUpdate] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[PaymentIntentRequestUpdate]: + """This view action must be provided with the `status` that the frontend has received from an external + PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of + the `PaymentIntent` is coherent with its status on the external PSP. + + After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of + `is_error`, `is_cancelled` or `invoice.is_resolved` have changed. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaymentIntentRequestUpdate + """ + + return sync_detailed( + id=id, + client=client, + body=body, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + ], + expand: Union[Unset, str] = UNSET, +) -> Response[PaymentIntentRequestUpdate]: + """This view action must be provided with the `status` that the frontend has received from an external + PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of + the `PaymentIntent` is coherent with its status on the external PSP. + + After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of + `is_error`, `is_cancelled` or `invoice.is_resolved` have changed. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaymentIntentRequestUpdate] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + PaymentIntentRequestUpdate, + ], + expand: Union[Unset, str] = UNSET, +) -> Optional[PaymentIntentRequestUpdate]: + """This view action must be provided with the `status` that the frontend has received from an external + PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of + the `PaymentIntent` is coherent with its status on the external PSP. + + After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of + `is_error`, `is_cancelled` or `invoice.is_resolved` have changed. + + Args: + id (int): + expand (Union[Unset, str]): + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update + containing the status of the PSP + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaymentIntentRequestUpdate + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_list.py new file mode 100644 index 0000000..1040fe1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_list.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_payment_intent_list import PaginatedPaymentIntentList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + basket_id: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["basket_id"] = basket_id + + params["expand"] = expand + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_payments/payment_intents/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedPaymentIntentList]: + if response.status_code == 200: + response_200 = PaginatedPaymentIntentList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedPaymentIntentList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPaymentIntentList]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + basket_id (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPaymentIntentList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPaymentIntentList]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + basket_id (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPaymentIntentList + """ + + return sync_detailed( + client=client, + basket_id=basket_id, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPaymentIntentList]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + basket_id (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPaymentIntentList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + expand: Union[Unset, str] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPaymentIntentList]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + basket_id (Union[Unset, int]): + expand (Union[Unset, str]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPaymentIntentList + """ + + return ( + await asyncio_detailed( + client=client, + basket_id=basket_id, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_retrieve.py new file mode 100644 index 0000000..ab96426 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payment_intents_retrieve.py @@ -0,0 +1,167 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.payment_intent import PaymentIntent +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + expand: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_payments/payment_intents/{id}/", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PaymentIntent]: + if response.status_code == 200: + response_200 = PaymentIntent.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PaymentIntent]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Response[PaymentIntent]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaymentIntent] + """ + + kwargs = _get_kwargs( + id=id, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Optional[PaymentIntent]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaymentIntent + """ + + return sync_detailed( + id=id, + client=client, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Response[PaymentIntent]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaymentIntent] + """ + + kwargs = _get_kwargs( + id=id, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + expand: Union[Unset, str] = UNSET, +) -> Optional[PaymentIntent]: + """API endpoint that allows PaymentIntent to be viewed. + + Args: + id (int): + expand (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaymentIntent + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_create.py new file mode 100644 index 0000000..b5b10ec --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_payments/payrexx/modules/", + } + + if isinstance(body, ModulePaymentPayrexxActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModulePaymentPayrexxActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModulePaymentPayrexxActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModulePaymentPayrexxActiveModule]: + if response.status_code == 201: + response_201 = ModulePaymentPayrexxActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModulePaymentPayrexxActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ], +) -> Response[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPayrexxActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ], +) -> Optional[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPayrexxActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ], +) -> Response[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPayrexxActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ModulePaymentPayrexxActiveModule, + ], +) -> Optional[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPayrexxActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_list.py new file mode 100644 index 0000000..b7af701 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_list.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_payment_payrexx_active_module_list import PaginatedModulePaymentPayrexxActiveModuleList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_payments/payrexx/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModulePaymentPayrexxActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModulePaymentPayrexxActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModulePaymentPayrexxActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModulePaymentPayrexxActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModulePaymentPayrexxActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModulePaymentPayrexxActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModulePaymentPayrexxActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModulePaymentPayrexxActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModulePaymentPayrexxActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModulePaymentPayrexxActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModulePaymentPayrexxActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_partial_update.py new file mode 100644 index 0000000..59e28c7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule +from ...models.patched_module_payment_payrexx_active_module import PatchedModulePaymentPayrexxActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_payments/payrexx/modules/{id}/", + } + + if isinstance(body, PatchedModulePaymentPayrexxActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModulePaymentPayrexxActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModulePaymentPayrexxActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModulePaymentPayrexxActiveModule]: + if response.status_code == 200: + response_200 = ModulePaymentPayrexxActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModulePaymentPayrexxActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + ], +) -> Response[ModulePaymentPayrexxActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPayrexxActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + ], +) -> Optional[ModulePaymentPayrexxActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPayrexxActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + ], +) -> Response[ModulePaymentPayrexxActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPayrexxActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + PatchedModulePaymentPayrexxActiveModule, + ], +) -> Optional[ModulePaymentPayrexxActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPayrexx` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPayrexxActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_retrieve.py new file mode 100644 index 0000000..819c0b8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_payments/payrexx/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModulePaymentPayrexxActiveModule]: + if response.status_code == 200: + response_200 = ModulePaymentPayrexxActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModulePaymentPayrexxActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPayrexxActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPayrexxActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPayrexxActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModulePaymentPayrexxActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPayrexxActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_webhooks_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_webhooks_create.py new file mode 100644 index 0000000..d6e14c5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_payrexx_webhooks_create.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.webhooks import Webhooks +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Webhooks, + Webhooks, + Webhooks, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_payments/payrexx/webhooks/", + } + + if isinstance(body, Webhooks): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Webhooks): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Webhooks): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Webhooks]: + if response.status_code == 201: + response_201 = Webhooks.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Webhooks]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Webhooks, + Webhooks, + Webhooks, + ], +) -> Response[Webhooks]: + """Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do + any treatment of the webhook content asynchronously. + + Args: + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Webhooks] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Webhooks, + Webhooks, + Webhooks, + ], +) -> Optional[Webhooks]: + """Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do + any treatment of the webhook content asynchronously. + + Args: + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Webhooks + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Webhooks, + Webhooks, + Webhooks, + ], +) -> Response[Webhooks]: + """Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do + any treatment of the webhook content asynchronously. + + Args: + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Webhooks] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Webhooks, + Webhooks, + Webhooks, + ], +) -> Optional[Webhooks]: + """Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do + any treatment of the webhook content asynchronously. + + Args: + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + body (Webhooks): Webhook data containing a transaction + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Webhooks + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_create.py new file mode 100644 index 0000000..c210582 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_payments/pointofsale/modules/", + } + + if isinstance(body, ModulePaymentPointOfSaleActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModulePaymentPointOfSaleActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModulePaymentPointOfSaleActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + if response.status_code == 201: + response_201 = ModulePaymentPointOfSaleActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModulePaymentPointOfSaleActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ], +) -> Response[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPointOfSaleActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ], +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPointOfSaleActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ], +) -> Response[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPointOfSaleActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ModulePaymentPointOfSaleActiveModule, + ], +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to + `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPointOfSaleActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_list.py new file mode 100644 index 0000000..0185357 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_payment_point_of_sale_active_module_list import ( + PaginatedModulePaymentPointOfSaleActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_payments/pointofsale/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModulePaymentPointOfSaleActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModulePaymentPointOfSaleActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModulePaymentPointOfSaleActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModulePaymentPointOfSaleActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModulePaymentPointOfSaleActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModulePaymentPointOfSaleActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModulePaymentPointOfSaleActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModulePaymentPointOfSaleActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModulePaymentPointOfSaleActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModulePaymentPointOfSaleActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModulePaymentPointOfSaleActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_partial_update.py new file mode 100644 index 0000000..be9fa9d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule +from ...models.patched_module_payment_point_of_sale_active_module import PatchedModulePaymentPointOfSaleActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_payments/pointofsale/modules/{id}/", + } + + if isinstance(body, PatchedModulePaymentPointOfSaleActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModulePaymentPointOfSaleActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModulePaymentPointOfSaleActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + if response.status_code == 200: + response_200 = ModulePaymentPointOfSaleActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModulePaymentPointOfSaleActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + ], +) -> Response[ModulePaymentPointOfSaleActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPointOfSaleActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + ], +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPointOfSaleActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + ], +) -> Response[ModulePaymentPointOfSaleActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPointOfSaleActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + PatchedModulePaymentPointOfSaleActiveModule, + ], +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked + to `ModulePaymentPointOfSale` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPointOfSaleActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_retrieve.py new file mode 100644 index 0000000..fa40c91 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_payments/pointofsale/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + if response.status_code == 200: + response_200 = ModulePaymentPointOfSaleActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModulePaymentPointOfSaleActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPointOfSaleActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPointOfSaleActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModulePaymentPointOfSaleActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModulePaymentPointOfSaleActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModulePaymentPointOfSaleActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_create.py new file mode 100644 index 0000000..037e4b1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_payments/pointofsale/places/", + } + + if isinstance(body, PointOfSalePlaceReadOnly): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PointOfSalePlaceReadOnly): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PointOfSalePlaceReadOnly): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PointOfSalePlaceReadOnly]: + if response.status_code == 201: + response_201 = PointOfSalePlaceReadOnly.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PointOfSalePlaceReadOnly]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + ], +) -> Response[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PointOfSalePlaceReadOnly] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + ], +) -> Optional[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PointOfSalePlaceReadOnly + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + ], +) -> Response[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PointOfSalePlaceReadOnly] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + PointOfSalePlaceReadOnly, + ], +) -> Optional[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place. + You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PointOfSalePlaceReadOnly + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_destroy.py new file mode 100644 index 0000000..e221c3e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_payments/pointofsale/places/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_list.py new file mode 100644 index 0000000..17bac5b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_list.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_point_of_sale_place_read_only_list import PaginatedPointOfSalePlaceReadOnlyList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_payments/pointofsale/places/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedPointOfSalePlaceReadOnlyList]: + if response.status_code == 200: + response_200 = PaginatedPointOfSalePlaceReadOnlyList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedPointOfSalePlaceReadOnlyList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPointOfSalePlaceReadOnlyList]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + event (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPointOfSalePlaceReadOnlyList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPointOfSalePlaceReadOnlyList]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + event (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPointOfSalePlaceReadOnlyList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPointOfSalePlaceReadOnlyList]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + event (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPointOfSalePlaceReadOnlyList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPointOfSalePlaceReadOnlyList]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + event (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPointOfSalePlaceReadOnlyList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_partial_update.py new file mode 100644 index 0000000..56ff80c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_point_of_sale_place_read_only import PatchedPointOfSalePlaceReadOnly +from ...models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_payments/pointofsale/places/{id}/", + } + + if isinstance(body, PatchedPointOfSalePlaceReadOnly): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedPointOfSalePlaceReadOnly): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedPointOfSalePlaceReadOnly): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PointOfSalePlaceReadOnly]: + if response.status_code == 200: + response_200 = PointOfSalePlaceReadOnly.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PointOfSalePlaceReadOnly]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + ], +) -> Response[PointOfSalePlaceReadOnly]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PointOfSalePlaceReadOnly] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + ], +) -> Optional[PointOfSalePlaceReadOnly]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PointOfSalePlaceReadOnly + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + ], +) -> Response[PointOfSalePlaceReadOnly]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PointOfSalePlaceReadOnly] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + PatchedPointOfSalePlaceReadOnly, + ], +) -> Optional[PointOfSalePlaceReadOnly]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale + place. You can access only read methods as a frontend login and will only see some fields. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PointOfSalePlaceReadOnly + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_retrieve.py new file mode 100644 index 0000000..7bd883f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_payments/modules_payments_pointofsale_places_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_payments/pointofsale/places/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PointOfSalePlaceReadOnly]: + if response.status_code == 200: + response_200 = PointOfSalePlaceReadOnly.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PointOfSalePlaceReadOnly]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PointOfSalePlaceReadOnly] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PointOfSalePlaceReadOnly + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PointOfSalePlaceReadOnly] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[PointOfSalePlaceReadOnly]: + """ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PointOfSalePlaceReadOnly + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_create.py new file mode 100644 index 0000000..cf2cb44 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/access_management/modules/", + } + + if isinstance(body, ModuleRegistrationAccessManagementActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleRegistrationAccessManagementActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleRegistrationAccessManagementActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + if response.status_code == 201: + response_201 = ModuleRegistrationAccessManagementActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ], +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationAccessManagementActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ], +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationAccessManagementActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ], +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationAccessManagementActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ModuleRegistrationAccessManagementActiveModule, + ], +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + body (ModuleRegistrationAccessManagementActiveModule): Serializer for `ActiveModule` + linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationAccessManagementActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_list.py new file mode 100644 index 0000000..0ac4aac --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_registration_access_management_active_module_list import ( + PaginatedModuleRegistrationAccessManagementActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/access_management/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleRegistrationAccessManagementActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleRegistrationAccessManagementActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleRegistrationAccessManagementActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleRegistrationAccessManagementActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleRegistrationAccessManagementActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleRegistrationAccessManagementActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleRegistrationAccessManagementActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleRegistrationAccessManagementActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleRegistrationAccessManagementActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleRegistrationAccessManagementActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleRegistrationAccessManagementActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_partial_update.py new file mode 100644 index 0000000..8267bcb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_partial_update.py @@ -0,0 +1,231 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule +from ...models.patched_module_registration_access_management_active_module import ( + PatchedModuleRegistrationAccessManagementActiveModule, +) +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/access_management/modules/{id}/", + } + + if isinstance(body, PatchedModuleRegistrationAccessManagementActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleRegistrationAccessManagementActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleRegistrationAccessManagementActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + if response.status_code == 200: + response_200 = ModuleRegistrationAccessManagementActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + ], +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationAccessManagementActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + ], +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationAccessManagementActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + ], +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationAccessManagementActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + PatchedModuleRegistrationAccessManagementActiveModule, + ], +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationAccessManagementActiveModule): Serializer for + `ActiveModule` linked to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationAccessManagementActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_retrieve.py new file mode 100644 index 0000000..ae37505 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/access_management/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + if response.status_code == 200: + response_200 = ModuleRegistrationAccessManagementActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationAccessManagementActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationAccessManagementActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationAccessManagementActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleRegistrationAccessManagementActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationAccessManagement`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationAccessManagementActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_create.py new file mode 100644 index 0000000..206c56b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_create.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.access_management_place import AccessManagementPlace +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + AccessManagementPlace, + AccessManagementPlace, + AccessManagementPlace, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/access_management/places/", + } + + if isinstance(body, AccessManagementPlace): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, AccessManagementPlace): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, AccessManagementPlace): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AccessManagementPlace]: + if response.status_code == 201: + response_201 = AccessManagementPlace.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AccessManagementPlace]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + AccessManagementPlace, + AccessManagementPlace, + AccessManagementPlace, + ], +) -> Response[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccessManagementPlace] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + AccessManagementPlace, + AccessManagementPlace, + AccessManagementPlace, + ], +) -> Optional[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccessManagementPlace + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + AccessManagementPlace, + AccessManagementPlace, + AccessManagementPlace, + ], +) -> Response[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccessManagementPlace] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + AccessManagementPlace, + AccessManagementPlace, + AccessManagementPlace, + ], +) -> Optional[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + body (AccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccessManagementPlace + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_destroy.py new file mode 100644 index 0000000..e051e11 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_destroy.py @@ -0,0 +1,93 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/access_management/places/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model AccessManagementPlace + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ViewSet of model AccessManagementPlace + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_list.py new file mode 100644 index 0000000..e1e5fcf --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_list.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_access_management_place_list import PaginatedAccessManagementPlaceList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/access_management/places/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedAccessManagementPlaceList]: + if response.status_code == 200: + response_200 = PaginatedAccessManagementPlaceList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedAccessManagementPlaceList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedAccessManagementPlaceList]: + """ViewSet of model AccessManagementPlace + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedAccessManagementPlaceList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedAccessManagementPlaceList]: + """ViewSet of model AccessManagementPlace + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedAccessManagementPlaceList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedAccessManagementPlaceList]: + """ViewSet of model AccessManagementPlace + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedAccessManagementPlaceList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedAccessManagementPlaceList]: + """ViewSet of model AccessManagementPlace + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedAccessManagementPlaceList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_partial_update.py new file mode 100644 index 0000000..081a258 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.access_management_place import AccessManagementPlace +from ...models.patched_access_management_place import PatchedAccessManagementPlace +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/access_management/places/{id}/", + } + + if isinstance(body, PatchedAccessManagementPlace): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedAccessManagementPlace): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedAccessManagementPlace): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AccessManagementPlace]: + if response.status_code == 200: + response_200 = AccessManagementPlace.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AccessManagementPlace]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + ], +) -> Response[AccessManagementPlace]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccessManagementPlace] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + ], +) -> Optional[AccessManagementPlace]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccessManagementPlace + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + ], +) -> Response[AccessManagementPlace]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccessManagementPlace] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + PatchedAccessManagementPlace, + ], +) -> Optional[AccessManagementPlace]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + body (PatchedAccessManagementPlace): Serializer for AccessManagementPlace model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccessManagementPlace + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_retrieve.py new file mode 100644 index 0000000..56e72a8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_access_management_places_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.access_management_place import AccessManagementPlace +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/access_management/places/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AccessManagementPlace]: + if response.status_code == 200: + response_200 = AccessManagementPlace.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AccessManagementPlace]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccessManagementPlace] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccessManagementPlace + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccessManagementPlace] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[AccessManagementPlace]: + """ViewSet of model AccessManagementPlace + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccessManagementPlace + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_create.py new file mode 100644 index 0000000..79dc940 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_access import NodeAccess +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeAccess, + NodeAccess, + NodeAccess, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/accesses/", + } + + if isinstance(body, NodeAccess): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeAccess): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeAccess): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccess]: + if response.status_code == 201: + response_201 = NodeAccess.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeAccess]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccess, + NodeAccess, + NodeAccess, + ], +) -> Response[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccess] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccess, + NodeAccess, + NodeAccess, + ], +) -> Optional[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccess + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccess, + NodeAccess, + NodeAccess, + ], +) -> Response[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccess] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccess, + NodeAccess, + NodeAccess, + ], +) -> Optional[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + body (NodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccess + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_destroy.py new file mode 100644 index 0000000..4e10415 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/accesses/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_list.py new file mode 100644 index 0000000..93ea802 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_list.py @@ -0,0 +1,245 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_access_list import PaginatedNodeAccessList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + json_node_configurations: Union[Unset, list[int]] = UNSET + if not isinstance(node_configurations, Unset): + json_node_configurations = node_configurations + + params["node_configurations"] = json_node_configurations + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/accesses/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeAccessList]: + if response.status_code == 200: + response_200 = PaginatedNodeAccessList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeAccessList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAccessList]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAccessList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAccessList]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAccessList + """ + + return sync_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAccessList]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAccessList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAccessList]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAccessList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_create.py new file mode 100644 index 0000000..c415573 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_access_m2m import NodeAccessM2M +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeAccessM2M, + NodeAccessM2M, + NodeAccessM2M, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/accesses_m2m/", + } + + if isinstance(body, NodeAccessM2M): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeAccessM2M): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeAccessM2M): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccessM2M]: + if response.status_code == 201: + response_201 = NodeAccessM2M.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeAccessM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccessM2M, + NodeAccessM2M, + NodeAccessM2M, + ], +) -> Response[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccessM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccessM2M, + NodeAccessM2M, + NodeAccessM2M, + ], +) -> Optional[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccessM2M + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccessM2M, + NodeAccessM2M, + NodeAccessM2M, + ], +) -> Response[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccessM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeAccessM2M, + NodeAccessM2M, + NodeAccessM2M, + ], +) -> Optional[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + body (NodeAccessM2M): Serializer (read/write) for `NodeAccessM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccessM2M + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_destroy.py new file mode 100644 index 0000000..b6dbbd0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/accesses_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_list.py new file mode 100644 index 0000000..296f8f3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_list.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_access_m2m_list import PaginatedNodeAccessM2MList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + access: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["access"] = access + + params["event_id"] = event_id + + params["node_configuration"] = node_configuration + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/accesses_m2m/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeAccessM2MList]: + if response.status_code == 200: + response_200 = PaginatedNodeAccessM2MList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeAccessM2MList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + access: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAccessM2MList]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + access (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAccessM2MList] + """ + + kwargs = _get_kwargs( + access=access, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + access: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAccessM2MList]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + access (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAccessM2MList + """ + + return sync_detailed( + client=client, + access=access, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + access: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAccessM2MList]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + access (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAccessM2MList] + """ + + kwargs = _get_kwargs( + access=access, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + access: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAccessM2MList]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + access (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAccessM2MList + """ + + return ( + await asyncio_detailed( + client=client, + access=access, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_retrieve.py new file mode 100644 index 0000000..039666d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_m2m_retrieve.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_access_m2m import NodeAccessM2M +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/accesses_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccessM2M]: + if response.status_code == 200: + response_200 = NodeAccessM2M.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeAccessM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccessM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccessM2M + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccessM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAccessM2M]: + """This view manages node configuration/access relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccessM2M + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_partial_update.py new file mode 100644 index 0000000..6120c8d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_access import NodeAccess +from ...models.patched_node_access import PatchedNodeAccess +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeAccess, + PatchedNodeAccess, + PatchedNodeAccess, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/accesses/{id}/", + } + + if isinstance(body, PatchedNodeAccess): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeAccess): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeAccess): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccess]: + if response.status_code == 200: + response_200 = NodeAccess.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeAccess]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAccess, + PatchedNodeAccess, + PatchedNodeAccess, + ], +) -> Response[NodeAccess]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccess] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAccess, + PatchedNodeAccess, + PatchedNodeAccess, + ], +) -> Optional[NodeAccess]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccess + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAccess, + PatchedNodeAccess, + PatchedNodeAccess, + ], +) -> Response[NodeAccess]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccess] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAccess, + PatchedNodeAccess, + PatchedNodeAccess, + ], +) -> Optional[NodeAccess]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + body (PatchedNodeAccess): Serializer (read/write) for `NodeAccess` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccess + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_retrieve.py new file mode 100644 index 0000000..9d801cb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_accesses_retrieve.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_access import NodeAccess +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/accesses/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeAccess]: + if response.status_code == 200: + response_200 = NodeAccess.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeAccess]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccess] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccess + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAccess] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAccess]: + """This view manages accesses + It filters accesses linked to configurations, via `NodeAccessM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAccess + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_create.py new file mode 100644 index 0000000..6e981fc --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_create.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_availability import NodeAvailability +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeAvailability, + NodeAvailability, + NodeAvailability, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/availabilities/", + } + + if isinstance(body, NodeAvailability): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeAvailability): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeAvailability): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeAvailability]: + if response.status_code == 201: + response_201 = NodeAvailability.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeAvailability]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailability, + NodeAvailability, + NodeAvailability, + ], +) -> Response[NodeAvailability]: + """ + Args: + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailability] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailability, + NodeAvailability, + NodeAvailability, + ], +) -> Optional[NodeAvailability]: + """ + Args: + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailability + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailability, + NodeAvailability, + NodeAvailability, + ], +) -> Response[NodeAvailability]: + """ + Args: + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailability] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailability, + NodeAvailability, + NodeAvailability, + ], +) -> Optional[NodeAvailability]: + """ + Args: + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + body (NodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailability + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_destroy.py new file mode 100644 index 0000000..f6e8e24 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/availabilities/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_list.py new file mode 100644 index 0000000..23e49fa --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_list.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_availability_list import PaginatedNodeAvailabilityList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + json_node_configurations: Union[Unset, list[int]] = UNSET + if not isinstance(node_configurations, Unset): + json_node_configurations = node_configurations + + params["node_configurations"] = json_node_configurations + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/availabilities/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeAvailabilityList]: + if response.status_code == 200: + response_200 = PaginatedNodeAvailabilityList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeAvailabilityList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAvailabilityList]: + """ + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAvailabilityList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAvailabilityList]: + """ + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAvailabilityList + """ + + return sync_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAvailabilityList]: + """ + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAvailabilityList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAvailabilityList]: + """ + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAvailabilityList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_create.py new file mode 100644 index 0000000..a694221 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_create.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_availability_m2m import NodeAvailabilityM2M +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeAvailabilityM2M, + NodeAvailabilityM2M, + NodeAvailabilityM2M, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/availabilities_m2m/", + } + + if isinstance(body, NodeAvailabilityM2M): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeAvailabilityM2M): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeAvailabilityM2M): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeAvailabilityM2M]: + if response.status_code == 201: + response_201 = NodeAvailabilityM2M.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeAvailabilityM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailabilityM2M, + NodeAvailabilityM2M, + NodeAvailabilityM2M, + ], +) -> Response[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailabilityM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailabilityM2M, + NodeAvailabilityM2M, + NodeAvailabilityM2M, + ], +) -> Optional[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailabilityM2M + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailabilityM2M, + NodeAvailabilityM2M, + NodeAvailabilityM2M, + ], +) -> Response[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailabilityM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeAvailabilityM2M, + NodeAvailabilityM2M, + NodeAvailabilityM2M, + ], +) -> Optional[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + body (NodeAvailabilityM2M): Serializer (read/write) for `NodeAvailabilityM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailabilityM2M + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_destroy.py new file mode 100644 index 0000000..51f08ea --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/availabilities_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_list.py new file mode 100644 index 0000000..b4cf30f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_list.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_availability_m2m_list import PaginatedNodeAvailabilityM2MList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + availability: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["availability"] = availability + + params["event_id"] = event_id + + params["node_configuration"] = node_configuration + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/availabilities_m2m/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeAvailabilityM2MList]: + if response.status_code == 200: + response_200 = PaginatedNodeAvailabilityM2MList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeAvailabilityM2MList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + availability: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAvailabilityM2MList]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + availability (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAvailabilityM2MList] + """ + + kwargs = _get_kwargs( + availability=availability, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + availability: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAvailabilityM2MList]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + availability (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAvailabilityM2MList + """ + + return sync_detailed( + client=client, + availability=availability, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + availability: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeAvailabilityM2MList]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + availability (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeAvailabilityM2MList] + """ + + kwargs = _get_kwargs( + availability=availability, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + availability: Union[Unset, int] = UNSET, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeAvailabilityM2MList]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + availability (Union[Unset, int]): + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeAvailabilityM2MList + """ + + return ( + await asyncio_detailed( + client=client, + availability=availability, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_retrieve.py new file mode 100644 index 0000000..f61e048 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_m2m_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_availability_m2m import NodeAvailabilityM2M +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/availabilities_m2m/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeAvailabilityM2M]: + if response.status_code == 200: + response_200 = NodeAvailabilityM2M.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeAvailabilityM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailabilityM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailabilityM2M + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailabilityM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAvailabilityM2M]: + """This view manages node configuration/availabilities relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailabilityM2M + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_partial_update.py new file mode 100644 index 0000000..aff707d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_availability import NodeAvailability +from ...models.patched_node_availability import PatchedNodeAvailability +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeAvailability, + PatchedNodeAvailability, + PatchedNodeAvailability, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/availabilities/{id}/", + } + + if isinstance(body, PatchedNodeAvailability): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeAvailability): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeAvailability): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeAvailability]: + if response.status_code == 200: + response_200 = NodeAvailability.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeAvailability]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAvailability, + PatchedNodeAvailability, + PatchedNodeAvailability, + ], +) -> Response[NodeAvailability]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailability] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAvailability, + PatchedNodeAvailability, + PatchedNodeAvailability, + ], +) -> Optional[NodeAvailability]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailability + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAvailability, + PatchedNodeAvailability, + PatchedNodeAvailability, + ], +) -> Response[NodeAvailability]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailability] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeAvailability, + PatchedNodeAvailability, + PatchedNodeAvailability, + ], +) -> Optional[NodeAvailability]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + body (PatchedNodeAvailability): Serializer (read/write) for NodeAvailability model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailability + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_retrieve.py new file mode 100644 index 0000000..4bb58d8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_availabilities_retrieve.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_availability import NodeAvailability +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/availabilities/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeAvailability]: + if response.status_code == 200: + response_200 = NodeAvailability.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeAvailability]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAvailability]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailability] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAvailability]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailability + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeAvailability]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeAvailability] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeAvailability]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeAvailability + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_create.py new file mode 100644 index 0000000..94dc900 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.condition import Condition +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Condition, + Condition, + Condition, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/conditions/", + } + + if isinstance(body, Condition): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Condition): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Condition): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Condition]: + if response.status_code == 201: + response_201 = Condition.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Condition]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Condition, + Condition, + Condition, + ], +) -> Response[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Condition] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Condition, + Condition, + Condition, + ], +) -> Optional[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Condition + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Condition, + Condition, + Condition, + ], +) -> Response[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Condition] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Condition, + Condition, + Condition, + ], +) -> Optional[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + body (Condition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Condition + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_destroy.py new file mode 100644 index 0000000..63b5d36 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/conditions/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_list.py new file mode 100644 index 0000000..16c3b66 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_list.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_condition_list import PaginatedConditionList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/conditions/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedConditionList]: + if response.status_code == 200: + response_200 = PaginatedConditionList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedConditionList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedConditionList]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedConditionList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedConditionList]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedConditionList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedConditionList]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedConditionList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedConditionList]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedConditionList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_partial_update.py new file mode 100644 index 0000000..8c4dc86 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.condition import Condition +from ...models.patched_condition import PatchedCondition +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedCondition, + PatchedCondition, + PatchedCondition, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/conditions/{id}/", + } + + if isinstance(body, PatchedCondition): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedCondition): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedCondition): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Condition]: + if response.status_code == 200: + response_200 = Condition.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Condition]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedCondition, + PatchedCondition, + PatchedCondition, + ], +) -> Response[Condition]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Condition] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedCondition, + PatchedCondition, + PatchedCondition, + ], +) -> Optional[Condition]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Condition + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedCondition, + PatchedCondition, + PatchedCondition, + ], +) -> Response[Condition]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Condition] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedCondition, + PatchedCondition, + PatchedCondition, + ], +) -> Optional[Condition]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + body (PatchedCondition): Serializer (read/write) for `Condition` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Condition + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_retrieve.py new file mode 100644 index 0000000..1586d0c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_conditions_retrieve.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.condition import Condition +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/conditions/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Condition]: + if response.status_code == 200: + response_200 = Condition.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Condition]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Condition] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Condition + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Condition] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Condition]: + """This view manages conditions + It filters conditions linked to configurations, via node configuration properties, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Condition + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_create.py new file mode 100644 index 0000000..f43c81d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_create.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info_group import NodeExtraInfoGroup +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeExtraInfoGroup, + NodeExtraInfoGroup, + NodeExtraInfoGroup, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/extra_info_groups/", + } + + if isinstance(body, NodeExtraInfoGroup): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeExtraInfoGroup): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeExtraInfoGroup): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeExtraInfoGroup]: + if response.status_code == 201: + response_201 = NodeExtraInfoGroup.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeExtraInfoGroup]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroup, + NodeExtraInfoGroup, + NodeExtraInfoGroup, + ], +) -> Response[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroup, + NodeExtraInfoGroup, + NodeExtraInfoGroup, + ], +) -> Optional[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroup + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroup, + NodeExtraInfoGroup, + NodeExtraInfoGroup, + ], +) -> Response[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroup, + NodeExtraInfoGroup, + NodeExtraInfoGroup, + ], +) -> Optional[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (NodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroup + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_destroy.py new file mode 100644 index 0000000..7c3d778 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/extra_info_groups/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_list.py new file mode 100644 index 0000000..5fe9876 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_list.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_extra_info_group_list import PaginatedNodeExtraInfoGroupList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/extra_info_groups/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeExtraInfoGroupList]: + if response.status_code == 200: + response_200 = PaginatedNodeExtraInfoGroupList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeExtraInfoGroupList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeExtraInfoGroupList]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeExtraInfoGroupList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeExtraInfoGroupList]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeExtraInfoGroupList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeExtraInfoGroupList]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeExtraInfoGroupList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeExtraInfoGroupList]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeExtraInfoGroupList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_create.py new file mode 100644 index 0000000..1d5bf6b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_create.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info_group_m2m import NodeExtraInfoGroupM2M +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/extra_info_groups_m2m/", + } + + if isinstance(body, NodeExtraInfoGroupM2M): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeExtraInfoGroupM2M): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeExtraInfoGroupM2M): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeExtraInfoGroupM2M]: + if response.status_code == 201: + response_201 = NodeExtraInfoGroupM2M.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeExtraInfoGroupM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + ], +) -> Response[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroupM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + ], +) -> Optional[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroupM2M + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + ], +) -> Response[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroupM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + NodeExtraInfoGroupM2M, + ], +) -> Optional[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + body (NodeExtraInfoGroupM2M): Serializer (read/write) for `NodeExtraInfoGroupM2M` relation + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroupM2M + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_destroy.py new file mode 100644 index 0000000..be79034 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/extra_info_groups_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_list.py new file mode 100644 index 0000000..f95298f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_list.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_extra_info_group_m2m_list import PaginatedNodeExtraInfoGroupM2MList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/extra_info_groups_m2m/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeExtraInfoGroupM2MList]: + if response.status_code == 200: + response_200 = PaginatedNodeExtraInfoGroupM2MList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeExtraInfoGroupM2MList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeExtraInfoGroupM2MList]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeExtraInfoGroupM2MList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeExtraInfoGroupM2MList]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeExtraInfoGroupM2MList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeExtraInfoGroupM2MList]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeExtraInfoGroupM2MList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeExtraInfoGroupM2MList]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeExtraInfoGroupM2MList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_retrieve.py new file mode 100644 index 0000000..d7a4a84 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_m2m_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info_group_m2m import NodeExtraInfoGroupM2M +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/extra_info_groups_m2m/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeExtraInfoGroupM2M]: + if response.status_code == 200: + response_200 = NodeExtraInfoGroupM2M.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeExtraInfoGroupM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroupM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroupM2M + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroupM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeExtraInfoGroupM2M]: + """This view manages node configuration/extra group info relations. + PUT and PATCH methods are not supported. + It filters relations linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroupM2M + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_partial_update.py new file mode 100644 index 0000000..2cef9ae --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info_group import NodeExtraInfoGroup +from ...models.patched_node_extra_info_group import PatchedNodeExtraInfoGroup +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/extra_info_groups/{id}/", + } + + if isinstance(body, PatchedNodeExtraInfoGroup): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeExtraInfoGroup): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeExtraInfoGroup): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeExtraInfoGroup]: + if response.status_code == 200: + response_200 = NodeExtraInfoGroup.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeExtraInfoGroup]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + ], +) -> Response[NodeExtraInfoGroup]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + ], +) -> Optional[NodeExtraInfoGroup]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroup + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + ], +) -> Response[NodeExtraInfoGroup]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + PatchedNodeExtraInfoGroup, + ], +) -> Optional[NodeExtraInfoGroup]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + body (PatchedNodeExtraInfoGroup): Serializer (read/write) for `NodeExtraInfoGroup` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroup + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_retrieve.py new file mode 100644 index 0000000..750da5f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_info_groups_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info_group import NodeExtraInfoGroup +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/extra_info_groups/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeExtraInfoGroup]: + if response.status_code == 200: + response_200 = NodeExtraInfoGroup.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeExtraInfoGroup]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroup + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeExtraInfoGroup]: + """This view manages extra info group + It filters groups linked to configurations, via `NodeExtraInfoGroupM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfoGroup + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_create.py new file mode 100644 index 0000000..81522fb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_create.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info import NodeExtraInfo +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeExtraInfo, + NodeExtraInfo, + NodeExtraInfo, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/extra_infos/", + } + + if isinstance(body, NodeExtraInfo): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeExtraInfo): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeExtraInfo): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeExtraInfo]: + if response.status_code == 201: + response_201 = NodeExtraInfo.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeExtraInfo]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfo, + NodeExtraInfo, + NodeExtraInfo, + ], +) -> Response[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfo] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfo, + NodeExtraInfo, + NodeExtraInfo, + ], +) -> Optional[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfo + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfo, + NodeExtraInfo, + NodeExtraInfo, + ], +) -> Response[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfo] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeExtraInfo, + NodeExtraInfo, + NodeExtraInfo, + ], +) -> Optional[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (NodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfo + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_destroy.py new file mode 100644 index 0000000..afb852f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_destroy.py @@ -0,0 +1,95 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/extra_infos/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_list.py new file mode 100644 index 0000000..f5640b8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_list.py @@ -0,0 +1,222 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_extra_info_list import PaginatedNodeExtraInfoList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/extra_infos/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeExtraInfoList]: + if response.status_code == 200: + response_200 = PaginatedNodeExtraInfoList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeExtraInfoList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeExtraInfoList]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeExtraInfoList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeExtraInfoList]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeExtraInfoList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeExtraInfoList]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeExtraInfoList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeExtraInfoList]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeExtraInfoList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_partial_update.py new file mode 100644 index 0000000..7598967 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info import NodeExtraInfo +from ...models.patched_node_extra_info import PatchedNodeExtraInfo +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/extra_infos/{id}/", + } + + if isinstance(body, PatchedNodeExtraInfo): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeExtraInfo): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeExtraInfo): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeExtraInfo]: + if response.status_code == 200: + response_200 = NodeExtraInfo.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeExtraInfo]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + ], +) -> Response[NodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + ], +) -> Optional[NodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfo + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + ], +) -> Response[NodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + PatchedNodeExtraInfo, + ], +) -> Optional[NodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + body (PatchedNodeExtraInfo): Serializer (read/write) for `NodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfo + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_retrieve.py new file mode 100644 index 0000000..08bebf9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_extra_infos_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_extra_info import NodeExtraInfo +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/extra_infos/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeExtraInfo]: + if response.status_code == 200: + response_200 = NodeExtraInfo.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeExtraInfo]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfo + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeExtraInfo]: + """This view manages extra infos + It filters extra infos linked to groups which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeExtraInfo + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_create.py new file mode 100644 index 0000000..f79b501 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_limit import NodeLimit +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeLimit, + NodeLimit, + NodeLimit, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/limits/", + } + + if isinstance(body, NodeLimit): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeLimit): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeLimit): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimit]: + if response.status_code == 201: + response_201 = NodeLimit.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeLimit]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimit, + NodeLimit, + NodeLimit, + ], +) -> Response[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimit] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimit, + NodeLimit, + NodeLimit, + ], +) -> Optional[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimit + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimit, + NodeLimit, + NodeLimit, + ], +) -> Response[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimit] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimit, + NodeLimit, + NodeLimit, + ], +) -> Optional[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + body (NodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimit + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_destroy.py new file mode 100644 index 0000000..c481265 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/limits/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_list.py new file mode 100644 index 0000000..c5c5363 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_list.py @@ -0,0 +1,245 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_limit_list import PaginatedNodeLimitList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + json_node_configurations: Union[Unset, list[int]] = UNSET + if not isinstance(node_configurations, Unset): + json_node_configurations = node_configurations + + params["node_configurations"] = json_node_configurations + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/limits/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeLimitList]: + if response.status_code == 200: + response_200 = PaginatedNodeLimitList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeLimitList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeLimitList]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeLimitList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeLimitList]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeLimitList + """ + + return sync_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeLimitList]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeLimitList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeLimitList]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeLimitList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_create.py new file mode 100644 index 0000000..807eb73 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_limit_m2m import NodeLimitM2M +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeLimitM2M, + NodeLimitM2M, + NodeLimitM2M, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/limits_m2m/", + } + + if isinstance(body, NodeLimitM2M): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeLimitM2M): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeLimitM2M): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimitM2M]: + if response.status_code == 201: + response_201 = NodeLimitM2M.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeLimitM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimitM2M, + NodeLimitM2M, + NodeLimitM2M, + ], +) -> Response[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimitM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimitM2M, + NodeLimitM2M, + NodeLimitM2M, + ], +) -> Optional[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimitM2M + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimitM2M, + NodeLimitM2M, + NodeLimitM2M, + ], +) -> Response[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimitM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeLimitM2M, + NodeLimitM2M, + NodeLimitM2M, + ], +) -> Optional[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + body (NodeLimitM2M): Serializer (read/write) for `NodeLimitM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimitM2M + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_destroy.py new file mode 100644 index 0000000..fb6ada8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/limits_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_list.py new file mode 100644 index 0000000..1323831 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_list.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_limit_m2m_list import PaginatedNodeLimitM2MList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + limit: Union[Unset, int] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["limit"] = limit + + params["node_configuration"] = node_configuration + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/limits_m2m/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeLimitM2MList]: + if response.status_code == 200: + response_200 = PaginatedNodeLimitM2MList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeLimitM2MList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + limit: Union[Unset, int] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeLimitM2MList]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + limit (Union[Unset, int]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeLimitM2MList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + limit=limit, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + limit: Union[Unset, int] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeLimitM2MList]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + limit (Union[Unset, int]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeLimitM2MList + """ + + return sync_detailed( + client=client, + event_id=event_id, + limit=limit, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + limit: Union[Unset, int] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeLimitM2MList]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + limit (Union[Unset, int]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeLimitM2MList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + limit=limit, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + limit: Union[Unset, int] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeLimitM2MList]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + limit (Union[Unset, int]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeLimitM2MList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + limit=limit, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_retrieve.py new file mode 100644 index 0000000..c3d7082 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_m2m_retrieve.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_limit_m2m import NodeLimitM2M +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/limits_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimitM2M]: + if response.status_code == 200: + response_200 = NodeLimitM2M.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeLimitM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimitM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimitM2M + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimitM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeLimitM2M]: + """This view manages node configuration/limits relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimitM2M + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_partial_update.py new file mode 100644 index 0000000..e145330 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_limit import NodeLimit +from ...models.patched_node_limit import PatchedNodeLimit +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeLimit, + PatchedNodeLimit, + PatchedNodeLimit, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/limits/{id}/", + } + + if isinstance(body, PatchedNodeLimit): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeLimit): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeLimit): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimit]: + if response.status_code == 200: + response_200 = NodeLimit.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeLimit]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeLimit, + PatchedNodeLimit, + PatchedNodeLimit, + ], +) -> Response[NodeLimit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimit] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeLimit, + PatchedNodeLimit, + PatchedNodeLimit, + ], +) -> Optional[NodeLimit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimit + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeLimit, + PatchedNodeLimit, + PatchedNodeLimit, + ], +) -> Response[NodeLimit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimit] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeLimit, + PatchedNodeLimit, + PatchedNodeLimit, + ], +) -> Optional[NodeLimit]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + body (PatchedNodeLimit): Serializer (read/write) for `NodeLimit` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimit + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_retrieve.py new file mode 100644 index 0000000..9673be1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_limits_retrieve.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_limit import NodeLimit +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/limits/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeLimit]: + if response.status_code == 200: + response_200 = NodeLimit.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeLimit]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimit] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimit + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeLimit] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeLimit]: + """This view manages limits + It filters limits linked to configurations, via `NodeLimitM2M` through table, which users have + access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeLimit + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_create.py new file mode 100644 index 0000000..d088550 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_create.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_registration_options_active_module import ModuleRegistrationOptionsActiveModule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/modules/", + } + + if isinstance(body, ModuleRegistrationOptionsActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, ModuleRegistrationOptionsActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, ModuleRegistrationOptionsActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleRegistrationOptionsActiveModule]: + if response.status_code == 201: + response_201 = ModuleRegistrationOptionsActiveModule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleRegistrationOptionsActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ], +) -> Response[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationOptionsActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ], +) -> Optional[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationOptionsActiveModule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ], +) -> Response[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationOptionsActiveModule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ModuleRegistrationOptionsActiveModule, + ], +) -> Optional[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + body (ModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked to + `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationOptionsActiveModule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_list.py new file mode 100644 index 0000000..f72f5bb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_list.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_module_registration_options_active_module_list import ( + PaginatedModuleRegistrationOptionsActiveModuleList, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event"] = event + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/modules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedModuleRegistrationOptionsActiveModuleList]: + if response.status_code == 200: + response_200 = PaginatedModuleRegistrationOptionsActiveModuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedModuleRegistrationOptionsActiveModuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleRegistrationOptionsActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleRegistrationOptionsActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleRegistrationOptionsActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleRegistrationOptionsActiveModuleList + """ + + return sync_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedModuleRegistrationOptionsActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedModuleRegistrationOptionsActiveModuleList] + """ + + kwargs = _get_kwargs( + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedModuleRegistrationOptionsActiveModuleList]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + event (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedModuleRegistrationOptionsActiveModuleList + """ + + return ( + await asyncio_detailed( + client=client, + event=event, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_partial_update.py new file mode 100644 index 0000000..7e19151 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_registration_options_active_module import ModuleRegistrationOptionsActiveModule +from ...models.patched_module_registration_options_active_module import PatchedModuleRegistrationOptionsActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/modules/{id}/", + } + + if isinstance(body, PatchedModuleRegistrationOptionsActiveModule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedModuleRegistrationOptionsActiveModule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedModuleRegistrationOptionsActiveModule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleRegistrationOptionsActiveModule]: + if response.status_code == 200: + response_200 = ModuleRegistrationOptionsActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleRegistrationOptionsActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + ], +) -> Response[ModuleRegistrationOptionsActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationOptionsActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + ], +) -> Optional[ModuleRegistrationOptionsActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationOptionsActiveModule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + ], +) -> Response[ModuleRegistrationOptionsActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationOptionsActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + PatchedModuleRegistrationOptionsActiveModule, + ], +) -> Optional[ModuleRegistrationOptionsActiveModule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + body (PatchedModuleRegistrationOptionsActiveModule): Serializer for `ActiveModule` linked + to `ModuleRegistrationOptions` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationOptionsActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_retrieve.py new file mode 100644 index 0000000..4d93ce4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_modules_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.module_registration_options_active_module import ModuleRegistrationOptionsActiveModule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/modules/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ModuleRegistrationOptionsActiveModule]: + if response.status_code == 200: + response_200 = ModuleRegistrationOptionsActiveModule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ModuleRegistrationOptionsActiveModule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationOptionsActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationOptionsActiveModule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ModuleRegistrationOptionsActiveModule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[ModuleRegistrationOptionsActiveModule]: + """ViewSet of model `ActiveModule` linked to `ModuleRegistrationOptions`. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ModuleRegistrationOptionsActiveModule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_create.py new file mode 100644 index 0000000..26f828c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_create.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_cart_configuration import NodeCartConfiguration +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeCartConfiguration, + NodeCartConfiguration, + NodeCartConfiguration, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/node_cart_configurations/", + } + + if isinstance(body, NodeCartConfiguration): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeCartConfiguration): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeCartConfiguration): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeCartConfiguration]: + if response.status_code == 201: + response_201 = NodeCartConfiguration.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeCartConfiguration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeCartConfiguration, + NodeCartConfiguration, + NodeCartConfiguration, + ], +) -> Response[NodeCartConfiguration]: + """ + Args: + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeCartConfiguration] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeCartConfiguration, + NodeCartConfiguration, + NodeCartConfiguration, + ], +) -> Optional[NodeCartConfiguration]: + """ + Args: + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeCartConfiguration + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeCartConfiguration, + NodeCartConfiguration, + NodeCartConfiguration, + ], +) -> Response[NodeCartConfiguration]: + """ + Args: + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeCartConfiguration] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeCartConfiguration, + NodeCartConfiguration, + NodeCartConfiguration, + ], +) -> Optional[NodeCartConfiguration]: + """ + Args: + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + body (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeCartConfiguration + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_destroy.py new file mode 100644 index 0000000..2abfb30 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/node_cart_configurations/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_list.py new file mode 100644 index 0000000..39c8ca3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_list.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_cart_configuration_list import PaginatedNodeCartConfigurationList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/node_cart_configurations/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeCartConfigurationList]: + if response.status_code == 200: + response_200 = PaginatedNodeCartConfigurationList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeCartConfigurationList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeCartConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeCartConfigurationList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeCartConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeCartConfigurationList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeCartConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeCartConfigurationList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeCartConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeCartConfigurationList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_partial_update.py new file mode 100644 index 0000000..5f89f4d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_partial_update.py @@ -0,0 +1,229 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_cart_configuration import NodeCartConfiguration +from ...models.patched_node_cart_configuration import PatchedNodeCartConfiguration +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/node_cart_configurations/{id}/", + } + + if isinstance(body, PatchedNodeCartConfiguration): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeCartConfiguration): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeCartConfiguration): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeCartConfiguration]: + if response.status_code == 200: + response_200 = NodeCartConfiguration.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeCartConfiguration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + ], +) -> Response[NodeCartConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeCartConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + ], +) -> Optional[NodeCartConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeCartConfiguration + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + ], +) -> Response[NodeCartConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeCartConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + PatchedNodeCartConfiguration, + ], +) -> Optional[NodeCartConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + body (PatchedNodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration + model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeCartConfiguration + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_retrieve.py new file mode 100644 index 0000000..89eeb1c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_cart_configurations_retrieve.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_cart_configuration import NodeCartConfiguration +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/node_cart_configurations/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeCartConfiguration]: + if response.status_code == 200: + response_200 = NodeCartConfiguration.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeCartConfiguration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeCartConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeCartConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeCartConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeCartConfiguration + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeCartConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeCartConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeCartConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeCartConfiguration + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_create.py new file mode 100644 index 0000000..e8519ca --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_create.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_configuration import NodeConfiguration +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeConfiguration, + NodeConfiguration, + NodeConfiguration, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/node_configurations/", + } + + if isinstance(body, NodeConfiguration): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeConfiguration): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeConfiguration): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeConfiguration]: + if response.status_code == 201: + response_201 = NodeConfiguration.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeConfiguration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeConfiguration, + NodeConfiguration, + NodeConfiguration, + ], +) -> Response[NodeConfiguration]: + """ + Args: + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeConfiguration] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeConfiguration, + NodeConfiguration, + NodeConfiguration, + ], +) -> Optional[NodeConfiguration]: + """ + Args: + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeConfiguration + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeConfiguration, + NodeConfiguration, + NodeConfiguration, + ], +) -> Response[NodeConfiguration]: + """ + Args: + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeConfiguration] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeConfiguration, + NodeConfiguration, + NodeConfiguration, + ], +) -> Optional[NodeConfiguration]: + """ + Args: + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (NodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeConfiguration + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_destroy.py new file mode 100644 index 0000000..63510f8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/node_configurations/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_list.py new file mode 100644 index 0000000..b1b9d6b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_list.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_configuration_list import PaginatedNodeConfigurationList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/node_configurations/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeConfigurationList]: + if response.status_code == 200: + response_200 = PaginatedNodeConfigurationList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeConfigurationList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeConfigurationList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeConfigurationList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeConfigurationList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeConfigurationList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeConfigurationList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_partial_update.py new file mode 100644 index 0000000..2e8c91b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_configuration import NodeConfiguration +from ...models.patched_node_configuration import PatchedNodeConfiguration +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeConfiguration, + PatchedNodeConfiguration, + PatchedNodeConfiguration, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/node_configurations/{id}/", + } + + if isinstance(body, PatchedNodeConfiguration): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeConfiguration): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeConfiguration): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeConfiguration]: + if response.status_code == 200: + response_200 = NodeConfiguration.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeConfiguration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeConfiguration, + PatchedNodeConfiguration, + PatchedNodeConfiguration, + ], +) -> Response[NodeConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeConfiguration, + PatchedNodeConfiguration, + PatchedNodeConfiguration, + ], +) -> Optional[NodeConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeConfiguration + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeConfiguration, + PatchedNodeConfiguration, + PatchedNodeConfiguration, + ], +) -> Response[NodeConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeConfiguration, + PatchedNodeConfiguration, + PatchedNodeConfiguration, + ], +) -> Optional[NodeConfiguration]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + body (PatchedNodeConfiguration): Serializer (read/write) for NodeConfiguration model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeConfiguration + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_retrieve.py new file mode 100644 index 0000000..0e8738f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_node_configurations_retrieve.py @@ -0,0 +1,146 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_configuration import NodeConfiguration +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/node_configurations/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodeConfiguration]: + if response.status_code == 200: + response_200 = NodeConfiguration.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodeConfiguration]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeConfiguration + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeConfiguration] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeConfiguration]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeConfiguration + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_delete_cart_configurations_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_delete_cart_configurations_create.py new file mode 100644 index 0000000..dae8e09 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_delete_cart_configurations_create.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node import Node +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + Node, + Node, + Node, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_registrations/options/nodes/{id}/actions/delete_cart_configurations/", + } + + if isinstance(body, Node): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Node): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Node): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Node]: + if response.status_code == 200: + response_200 = Node.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Node]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Response[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Optional[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Response[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Optional[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_ensure_cart_configurations_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_ensure_cart_configurations_create.py new file mode 100644 index 0000000..dc4d024 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_actions_ensure_cart_configurations_create.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node import Node +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + Node, + Node, + Node, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/api/v2/modules_registrations/options/nodes/{id}/actions/ensure_cart_configurations/", + } + + if isinstance(body, Node): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Node): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Node): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Node]: + if response.status_code == 200: + response_200 = Node.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Node]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Response[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Optional[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Response[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Optional[Node]: + """ + Args: + id (int): + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_create.py new file mode 100644 index 0000000..77c0b8f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_create.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node import Node +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Node, + Node, + Node, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/nodes/", + } + + if isinstance(body, Node): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Node): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Node): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Node]: + if response.status_code == 201: + response_201 = Node.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Node]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Response[Node]: + """ + Args: + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Optional[Node]: + """ + Args: + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Response[Node]: + """ + Args: + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Node, + Node, + Node, + ], +) -> Optional[Node]: + """ + Args: + body (Node): Serializer for Node model + body (Node): Serializer for Node model + body (Node): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_destroy.py new file mode 100644 index 0000000..4cd3f06 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/nodes/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_list.py new file mode 100644 index 0000000..e883075 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_list.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_list import PaginatedNodeList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/nodes/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeList]: + if response.status_code == 200: + response_200 = PaginatedNodeList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_partial_update.py new file mode 100644 index 0000000..b4b72a3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node import Node +from ...models.patched_node import PatchedNode +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNode, + PatchedNode, + PatchedNode, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/nodes/{id}/", + } + + if isinstance(body, PatchedNode): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNode): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNode): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Node]: + if response.status_code == 200: + response_200 = Node.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Node]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNode, + PatchedNode, + PatchedNode, + ], +) -> Response[Node]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNode, + PatchedNode, + PatchedNode, + ], +) -> Optional[Node]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNode, + PatchedNode, + PatchedNode, + ], +) -> Response[Node]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNode, + PatchedNode, + PatchedNode, + ], +) -> Optional[Node]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + body (PatchedNode): Serializer for Node model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_retrieve.py new file mode 100644 index 0000000..4c300a1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_nodes_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node import Node +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/nodes/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Node]: + if response.status_code == 200: + response_200 = Node.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Node]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Node]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Node]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Node]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Node] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Node]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Node + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_create.py new file mode 100644 index 0000000..5ec9e74 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_create.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_price_rule import NodePriceRule +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodePriceRule, + NodePriceRule, + NodePriceRule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/price_rules/", + } + + if isinstance(body, NodePriceRule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodePriceRule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodePriceRule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodePriceRule]: + if response.status_code == 201: + response_201 = NodePriceRule.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodePriceRule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRule, + NodePriceRule, + NodePriceRule, + ], +) -> Response[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRule, + NodePriceRule, + NodePriceRule, + ], +) -> Optional[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRule + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRule, + NodePriceRule, + NodePriceRule, + ], +) -> Response[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRule] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRule, + NodePriceRule, + NodePriceRule, + ], +) -> Optional[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (NodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRule + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_destroy.py new file mode 100644 index 0000000..fb033fb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/price_rules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_list.py new file mode 100644 index 0000000..c7b8af8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_list.py @@ -0,0 +1,245 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_price_rule_list import PaginatedNodePriceRuleList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + json_node_configurations: Union[Unset, list[int]] = UNSET + if not isinstance(node_configurations, Unset): + json_node_configurations = node_configurations + + params["node_configurations"] = json_node_configurations + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/price_rules/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodePriceRuleList]: + if response.status_code == 200: + response_200 = PaginatedNodePriceRuleList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodePriceRuleList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodePriceRuleList]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodePriceRuleList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodePriceRuleList]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodePriceRuleList + """ + + return sync_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodePriceRuleList]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodePriceRuleList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configurations: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodePriceRuleList]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + event_id (Union[Unset, float]): + node_configurations (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodePriceRuleList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + node_configurations=node_configurations, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_create.py new file mode 100644 index 0000000..1f05aca --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_create.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_price_rule_m2m import NodePriceRuleM2M +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodePriceRuleM2M, + NodePriceRuleM2M, + NodePriceRuleM2M, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/price_rules_m2m/", + } + + if isinstance(body, NodePriceRuleM2M): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodePriceRuleM2M): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodePriceRuleM2M): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodePriceRuleM2M]: + if response.status_code == 201: + response_201 = NodePriceRuleM2M.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodePriceRuleM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRuleM2M, + NodePriceRuleM2M, + NodePriceRuleM2M, + ], +) -> Response[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRuleM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRuleM2M, + NodePriceRuleM2M, + NodePriceRuleM2M, + ], +) -> Optional[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRuleM2M + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRuleM2M, + NodePriceRuleM2M, + NodePriceRuleM2M, + ], +) -> Response[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRuleM2M] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodePriceRuleM2M, + NodePriceRuleM2M, + NodePriceRuleM2M, + ], +) -> Optional[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + body (NodePriceRuleM2M): Serializer (read/write) for `NodePriceRuleM2M` relation model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRuleM2M + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_destroy.py new file mode 100644 index 0000000..f24e6f2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/price_rules_m2m/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_list.py new file mode 100644 index 0000000..fde4ac5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_list.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_price_rule_m2m_list import PaginatedNodePriceRuleM2MList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + price_rule: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["node_configuration"] = node_configuration + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["price_rule"] = price_rule + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/price_rules_m2m/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodePriceRuleM2MList]: + if response.status_code == 200: + response_200 = PaginatedNodePriceRuleM2MList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodePriceRuleM2MList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + price_rule: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodePriceRuleM2MList]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + price_rule (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodePriceRuleM2MList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + price_rule=price_rule, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + price_rule: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodePriceRuleM2MList]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + price_rule (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodePriceRuleM2MList + """ + + return sync_detailed( + client=client, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + price_rule=price_rule, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + price_rule: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodePriceRuleM2MList]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + price_rule (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodePriceRuleM2MList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + price_rule=price_rule, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + price_rule: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodePriceRuleM2MList]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + price_rule (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodePriceRuleM2MList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + price_rule=price_rule, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_retrieve.py new file mode 100644 index 0000000..ef7dbe1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_m2m_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_price_rule_m2m import NodePriceRuleM2M +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/price_rules_m2m/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[NodePriceRuleM2M]: + if response.status_code == 200: + response_200 = NodePriceRuleM2M.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[NodePriceRuleM2M]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRuleM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRuleM2M + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRuleM2M] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodePriceRuleM2M]: + """This view manages node configuration/price rules relation + PUT and PATCH methods are not supported. + It filters relation linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRuleM2M + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_partial_update.py new file mode 100644 index 0000000..98f7e6b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_price_rule import NodePriceRule +from ...models.patched_node_price_rule import PatchedNodePriceRule +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodePriceRule, + PatchedNodePriceRule, + PatchedNodePriceRule, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/price_rules/{id}/", + } + + if isinstance(body, PatchedNodePriceRule): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodePriceRule): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodePriceRule): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodePriceRule]: + if response.status_code == 200: + response_200 = NodePriceRule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodePriceRule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodePriceRule, + PatchedNodePriceRule, + PatchedNodePriceRule, + ], +) -> Response[NodePriceRule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodePriceRule, + PatchedNodePriceRule, + PatchedNodePriceRule, + ], +) -> Optional[NodePriceRule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRule + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodePriceRule, + PatchedNodePriceRule, + PatchedNodePriceRule, + ], +) -> Response[NodePriceRule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRule] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodePriceRule, + PatchedNodePriceRule, + PatchedNodePriceRule, + ], +) -> Optional[NodePriceRule]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + body (PatchedNodePriceRule): Serializer (read/write) for `NodePriceRule` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_retrieve.py new file mode 100644 index 0000000..70a1221 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_price_rules_retrieve.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_price_rule import NodePriceRule +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/price_rules/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodePriceRule]: + if response.status_code == 200: + response_200 = NodePriceRule.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodePriceRule]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRule + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodePriceRule] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodePriceRule]: + """This view manages price rules + It filters price rules linked to configurations, via `NodePriceRuleM2M` through table, which users + have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodePriceRule + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_create.py new file mode 100644 index 0000000..5eb2527 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_create.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.promotion_code import PromotionCode +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + PromotionCode, + PromotionCode, + PromotionCode, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/promotion_codes/", + } + + if isinstance(body, PromotionCode): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PromotionCode): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PromotionCode): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PromotionCode]: + if response.status_code == 201: + response_201 = PromotionCode.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PromotionCode]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PromotionCode, + PromotionCode, + PromotionCode, + ], +) -> Response[PromotionCode]: + """ + Args: + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PromotionCode] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + PromotionCode, + PromotionCode, + PromotionCode, + ], +) -> Optional[PromotionCode]: + """ + Args: + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PromotionCode + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + PromotionCode, + PromotionCode, + PromotionCode, + ], +) -> Response[PromotionCode]: + """ + Args: + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PromotionCode] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + PromotionCode, + PromotionCode, + PromotionCode, + ], +) -> Optional[PromotionCode]: + """ + Args: + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + body (PromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PromotionCode + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_destroy.py new file mode 100644 index 0000000..b557993 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/promotion_codes/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_list.py new file mode 100644 index 0000000..b6a2e8a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_list.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_promotion_code_list import PaginatedPromotionCodeList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/promotion_codes/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedPromotionCodeList]: + if response.status_code == 200: + response_200 = PaginatedPromotionCodeList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedPromotionCodeList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPromotionCodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPromotionCodeList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPromotionCodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPromotionCodeList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedPromotionCodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedPromotionCodeList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedPromotionCodeList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedPromotionCodeList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_partial_update.py new file mode 100644 index 0000000..b877b39 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_promotion_code import PatchedPromotionCode +from ...models.promotion_code import PromotionCode +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedPromotionCode, + PatchedPromotionCode, + PatchedPromotionCode, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/promotion_codes/{id}/", + } + + if isinstance(body, PatchedPromotionCode): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedPromotionCode): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedPromotionCode): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PromotionCode]: + if response.status_code == 200: + response_200 = PromotionCode.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PromotionCode]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPromotionCode, + PatchedPromotionCode, + PatchedPromotionCode, + ], +) -> Response[PromotionCode]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PromotionCode] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPromotionCode, + PatchedPromotionCode, + PatchedPromotionCode, + ], +) -> Optional[PromotionCode]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PromotionCode + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPromotionCode, + PatchedPromotionCode, + PatchedPromotionCode, + ], +) -> Response[PromotionCode]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PromotionCode] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedPromotionCode, + PatchedPromotionCode, + PatchedPromotionCode, + ], +) -> Optional[PromotionCode]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + body (PatchedPromotionCode): Serializer for PromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PromotionCode + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_retrieve.py new file mode 100644 index 0000000..737e261 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_promotion_codes_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.promotion_code import PromotionCode +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/promotion_codes/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PromotionCode]: + if response.status_code == 200: + response_200 = PromotionCode.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[PromotionCode]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[PromotionCode]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PromotionCode] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[PromotionCode]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PromotionCode + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[PromotionCode]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PromotionCode] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[PromotionCode]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PromotionCode + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_create.py new file mode 100644 index 0000000..4bf3293 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_create.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.statement import Statement +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + Statement, + Statement, + Statement, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/statements/", + } + + if isinstance(body, Statement): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, Statement): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, Statement): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Statement]: + if response.status_code == 201: + response_201 = Statement.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Statement]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Statement, + Statement, + Statement, + ], +) -> Response[Statement]: + """ + Args: + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Statement] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + Statement, + Statement, + Statement, + ], +) -> Optional[Statement]: + """ + Args: + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Statement + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + Statement, + Statement, + Statement, + ], +) -> Response[Statement]: + """ + Args: + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Statement] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + Statement, + Statement, + Statement, + ], +) -> Optional[Statement]: + """ + Args: + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + body (Statement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Statement + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_destroy.py new file mode 100644 index 0000000..4f774f4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_destroy.py @@ -0,0 +1,91 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/statements/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_list.py new file mode 100644 index 0000000..be0bd70 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_list.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_statement_list import PaginatedStatementList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/statements/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedStatementList]: + if response.status_code == 200: + response_200 = PaginatedStatementList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedStatementList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedStatementList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedStatementList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedStatementList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedStatementList + """ + + return sync_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedStatementList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedStatementList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedStatementList]: + """ + Args: + event_id (Union[Unset, float]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedStatementList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_partial_update.py new file mode 100644 index 0000000..6db9b24 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_statement import PatchedStatement +from ...models.statement import Statement +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedStatement, + PatchedStatement, + PatchedStatement, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/statements/{id}/", + } + + if isinstance(body, PatchedStatement): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedStatement): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedStatement): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Statement]: + if response.status_code == 200: + response_200 = Statement.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Statement]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedStatement, + PatchedStatement, + PatchedStatement, + ], +) -> Response[Statement]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Statement] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedStatement, + PatchedStatement, + PatchedStatement, + ], +) -> Optional[Statement]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Statement + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedStatement, + PatchedStatement, + PatchedStatement, + ], +) -> Response[Statement]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Statement] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedStatement, + PatchedStatement, + PatchedStatement, + ], +) -> Optional[Statement]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + body (PatchedStatement): Serializer for the Statement model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Statement + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_retrieve.py new file mode 100644 index 0000000..4105b36 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_statements_retrieve.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.statement import Statement +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/statements/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Statement]: + if response.status_code == 200: + response_200 = Statement.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Statement]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Statement]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Statement] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Statement]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Statement + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Statement]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Statement] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[Statement]: + """ + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Statement + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_create.py new file mode 100644 index 0000000..c349516 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_create.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_tag import NodeTag +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + NodeTag, + NodeTag, + NodeTag, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/options/tags/", + } + + if isinstance(body, NodeTag): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, NodeTag): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, NodeTag): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeTag]: + if response.status_code == 201: + response_201 = NodeTag.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeTag]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeTag, + NodeTag, + NodeTag, + ], +) -> Response[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeTag] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + NodeTag, + NodeTag, + NodeTag, + ], +) -> Optional[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeTag + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + NodeTag, + NodeTag, + NodeTag, + ], +) -> Response[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeTag] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + NodeTag, + NodeTag, + NodeTag, + ], +) -> Optional[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + body (NodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeTag + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_destroy.py new file mode 100644 index 0000000..09c6252 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_destroy.py @@ -0,0 +1,95 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/options/tags/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_list.py new file mode 100644 index 0000000..bad58a8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_list.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_node_tag_list import PaginatedNodeTagList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["event_id"] = event_id + + json_node_configuration: Union[Unset, list[int]] = UNSET + if not isinstance(node_configuration, Unset): + json_node_configuration = node_configuration + + params["node_configuration"] = json_node_configuration + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/options/tags/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedNodeTagList]: + if response.status_code == 200: + response_200 = PaginatedNodeTagList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedNodeTagList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeTagList]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeTagList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeTagList]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeTagList + """ + + return sync_detailed( + client=client, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedNodeTagList]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedNodeTagList] + """ + + kwargs = _get_kwargs( + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + event_id: Union[Unset, float] = UNSET, + node_configuration: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedNodeTagList]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + event_id (Union[Unset, float]): + node_configuration (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedNodeTagList + """ + + return ( + await asyncio_detailed( + client=client, + event_id=event_id, + node_configuration=node_configuration, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_partial_update.py new file mode 100644 index 0000000..8f7ffcd --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_partial_update.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_tag import NodeTag +from ...models.patched_node_tag import PatchedNodeTag +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedNodeTag, + PatchedNodeTag, + PatchedNodeTag, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/options/tags/{id}/", + } + + if isinstance(body, PatchedNodeTag): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedNodeTag): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedNodeTag): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeTag]: + if response.status_code == 200: + response_200 = NodeTag.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeTag]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeTag, + PatchedNodeTag, + PatchedNodeTag, + ], +) -> Response[NodeTag]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeTag] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeTag, + PatchedNodeTag, + PatchedNodeTag, + ], +) -> Optional[NodeTag]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeTag + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeTag, + PatchedNodeTag, + PatchedNodeTag, + ], +) -> Response[NodeTag]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeTag] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedNodeTag, + PatchedNodeTag, + PatchedNodeTag, + ], +) -> Optional[NodeTag]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + body (PatchedNodeTag): Serializer (read/write) for `NodeTag` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeTag + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_retrieve.py new file mode 100644 index 0000000..56000b6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_options_tags_retrieve.py @@ -0,0 +1,150 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.node_tag import NodeTag +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/options/tags/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[NodeTag]: + if response.status_code == 200: + response_200 = NodeTag.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[NodeTag]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeTag] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeTag + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[NodeTag] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[NodeTag]: + """This view manages node tags + It filters node tags linked to configurations which users have access to. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + NodeTag + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_list.py new file mode 100644 index 0000000..e98f242 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_list.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_selected_node_extra_info_group_list import PaginatedSelectedNodeExtraInfoGroupList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + selected_configuration_id: Union[Unset, list[float]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_id: Union[Unset, list[int]] = UNSET + if not isinstance(id, Unset): + json_id = id + + params["id"] = json_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + json_selected_configuration_id: Union[Unset, list[float]] = UNSET + if not isinstance(selected_configuration_id, Unset): + json_selected_configuration_id = selected_configuration_id + + params["selected_configuration_id"] = json_selected_configuration_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/selected_nodes_extra_info_groups/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedSelectedNodeExtraInfoGroupList]: + if response.status_code == 200: + response_200 = PaginatedSelectedNodeExtraInfoGroupList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedSelectedNodeExtraInfoGroupList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + selected_configuration_id: Union[Unset, list[float]] = UNSET, +) -> Response[PaginatedSelectedNodeExtraInfoGroupList]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + selected_configuration_id (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedNodeExtraInfoGroupList] + """ + + kwargs = _get_kwargs( + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + selected_configuration_id=selected_configuration_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + selected_configuration_id: Union[Unset, list[float]] = UNSET, +) -> Optional[PaginatedSelectedNodeExtraInfoGroupList]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + selected_configuration_id (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedNodeExtraInfoGroupList + """ + + return sync_detailed( + client=client, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + selected_configuration_id=selected_configuration_id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + selected_configuration_id: Union[Unset, list[float]] = UNSET, +) -> Response[PaginatedSelectedNodeExtraInfoGroupList]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + selected_configuration_id (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedNodeExtraInfoGroupList] + """ + + kwargs = _get_kwargs( + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + selected_configuration_id=selected_configuration_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, + selected_configuration_id: Union[Unset, list[float]] = UNSET, +) -> Optional[PaginatedSelectedNodeExtraInfoGroupList]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + selected_configuration_id (Union[Unset, list[float]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedNodeExtraInfoGroupList + """ + + return ( + await asyncio_detailed( + client=client, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + selected_configuration_id=selected_configuration_id, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_retrieve.py new file mode 100644 index 0000000..a5018a0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_info_groups_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_node_extra_info_group import SelectedNodeExtraInfoGroup +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/selected_nodes_extra_info_groups/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedNodeExtraInfoGroup]: + if response.status_code == 200: + response_200 = SelectedNodeExtraInfoGroup.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedNodeExtraInfoGroup]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[SelectedNodeExtraInfoGroup]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[SelectedNodeExtraInfoGroup]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfoGroup + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[SelectedNodeExtraInfoGroup]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfoGroup] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[SelectedNodeExtraInfoGroup]: + """This ViewSet manages SelectedNodeExtraInfoGroup. + The SelectedNodeExtraInfoGroup object is a copy of a NodeExtraInfoGroup which is created during the + add to basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfoGroup + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_list.py new file mode 100644 index 0000000..924a33d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_list.py @@ -0,0 +1,253 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_selected_node_extra_info_list import PaginatedSelectedNodeExtraInfoList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + groups: Union[Unset, list[Union[None, int]]] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_groups: Union[Unset, list[Union[None, int]]] = UNSET + if not isinstance(groups, Unset): + json_groups = [] + for groups_item_data in groups: + groups_item: Union[None, int] + groups_item = groups_item_data + json_groups.append(groups_item) + + params["groups"] = json_groups + + json_id: Union[Unset, list[int]] = UNSET + if not isinstance(id, Unset): + json_id = id + + params["id"] = json_id + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/selected_nodes_extra_infos/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedSelectedNodeExtraInfoList]: + if response.status_code == 200: + response_200 = PaginatedSelectedNodeExtraInfoList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedSelectedNodeExtraInfoList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + groups: Union[Unset, list[Union[None, int]]] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedSelectedNodeExtraInfoList]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + groups (Union[Unset, list[Union[None, int]]]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedNodeExtraInfoList] + """ + + kwargs = _get_kwargs( + groups=groups, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + groups: Union[Unset, list[Union[None, int]]] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedSelectedNodeExtraInfoList]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + groups (Union[Unset, list[Union[None, int]]]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedNodeExtraInfoList + """ + + return sync_detailed( + client=client, + groups=groups, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + groups: Union[Unset, list[Union[None, int]]] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedSelectedNodeExtraInfoList]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + groups (Union[Unset, list[Union[None, int]]]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedNodeExtraInfoList] + """ + + kwargs = _get_kwargs( + groups=groups, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + groups: Union[Unset, list[Union[None, int]]] = UNSET, + id: Union[Unset, list[int]] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedSelectedNodeExtraInfoList]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + groups (Union[Unset, list[Union[None, int]]]): + id (Union[Unset, list[int]]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedNodeExtraInfoList + """ + + return ( + await asyncio_detailed( + client=client, + groups=groups, + id=id, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_partial_update.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_partial_update.py new file mode 100644 index 0000000..ee40711 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_partial_update.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.patched_selected_node_extra_info import PatchedSelectedNodeExtraInfo +from ...models.selected_node_extra_info import SelectedNodeExtraInfo +from ...types import Response + + +def _get_kwargs( + id: int, + *, + body: Union[ + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": f"/api/v2/modules_registrations/selected_nodes_extra_infos/{id}/", + } + + if isinstance(body, PatchedSelectedNodeExtraInfo): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, PatchedSelectedNodeExtraInfo): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, PatchedSelectedNodeExtraInfo): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedNodeExtraInfo]: + if response.status_code == 200: + response_200 = SelectedNodeExtraInfo.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedNodeExtraInfo]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + ], +) -> Response[SelectedNodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + ], +) -> Optional[SelectedNodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfo + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + ], +) -> Response[SelectedNodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + body: Union[ + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + PatchedSelectedNodeExtraInfo, + ], +) -> Optional[SelectedNodeExtraInfo]: + """Partial update (PATCH) definition + Returns: + response: the serialized data + + Args: + id (int): + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + body (PatchedSelectedNodeExtraInfo): Serializer for `SelectedNodeExtraInfo` model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfo + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_retrieve.py new file mode 100644 index 0000000..3e51235 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_extra_infos_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_node_extra_info import SelectedNodeExtraInfo +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/selected_nodes_extra_infos/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedNodeExtraInfo]: + if response.status_code == 200: + response_200 = SelectedNodeExtraInfo.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedNodeExtraInfo]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[SelectedNodeExtraInfo]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[SelectedNodeExtraInfo]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfo + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[SelectedNodeExtraInfo]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNodeExtraInfo] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[SelectedNodeExtraInfo]: + """This ViewSet manages SelectedNodeExtraInfo. + The SelectedNodeExtraInfo object is a copy of a NodeExtraInfo which is created during the add to + basket process. + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNodeExtraInfo + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_list.py new file mode 100644 index 0000000..f15c30e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_list.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_selected_node_list import PaginatedSelectedNodeList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + basket_id: Union[Unset, int] = UNSET, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["basket_id"] = basket_id + + params["config"] = config + + params["expand"] = expand + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/selected_nodes/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedSelectedNodeList]: + if response.status_code == 200: + response_200 = PaginatedSelectedNodeList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedSelectedNodeList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedSelectedNodeList]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + basket_id (Union[Unset, int]): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedNodeList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + config=config, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedSelectedNodeList]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + basket_id (Union[Unset, int]): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedNodeList + """ + + return sync_detailed( + client=client, + basket_id=basket_id, + config=config, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedSelectedNodeList]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + basket_id (Union[Unset, int]): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedNodeList] + """ + + kwargs = _get_kwargs( + basket_id=basket_id, + config=config, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + basket_id: Union[Unset, int] = UNSET, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedSelectedNodeList]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + basket_id (Union[Unset, int]): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedNodeList + """ + + return ( + await asyncio_detailed( + client=client, + basket_id=basket_id, + config=config, + expand=expand, + o=o, + offset=offset, + page_limit=page_limit, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_retrieve.py new file mode 100644 index 0000000..b992c0a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_nodes_retrieve.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_node import SelectedNode +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: int, + *, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["config"] = config + + params["expand"] = expand + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/selected_nodes/{id}/", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[SelectedNode]: + if response.status_code == 200: + response_200 = SelectedNode.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[SelectedNode]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, +) -> Response[SelectedNode]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + id (int): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNode] + """ + + kwargs = _get_kwargs( + id=id, + config=config, + expand=expand, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, +) -> Optional[SelectedNode]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + id (int): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNode + """ + + return sync_detailed( + id=id, + client=client, + config=config, + expand=expand, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, +) -> Response[SelectedNode]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + id (int): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedNode] + """ + + kwargs = _get_kwargs( + id=id, + config=config, + expand=expand, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, + config: Union[Unset, bool] = UNSET, + expand: Union[Unset, bool] = UNSET, +) -> Optional[SelectedNode]: + """This ViewSet manages SelectedNode. + The object is created during the add to basket process based on a copy of the node selected by the + user. + + Args: + id (int): + config (Union[Unset, bool]): + expand (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedNode + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + config=config, + expand=expand, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_create.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_create.py new file mode 100644 index 0000000..4176273 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_create.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_promotion_code import SelectedPromotionCode +from ...types import Response + + +def _get_kwargs( + *, + body: Union[ + SelectedPromotionCode, + SelectedPromotionCode, + SelectedPromotionCode, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v2/modules_registrations/selected_promotion_codes/", + } + + if isinstance(body, SelectedPromotionCode): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + if isinstance(body, SelectedPromotionCode): + _kwargs["data"] = body.to_dict() + + headers["Content-Type"] = "application/x-www-form-urlencoded" + if isinstance(body, SelectedPromotionCode): + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedPromotionCode]: + if response.status_code == 201: + response_201 = SelectedPromotionCode.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedPromotionCode]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Union[ + SelectedPromotionCode, + SelectedPromotionCode, + SelectedPromotionCode, + ], +) -> Response[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedPromotionCode] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: Union[ + SelectedPromotionCode, + SelectedPromotionCode, + SelectedPromotionCode, + ], +) -> Optional[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedPromotionCode + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Union[ + SelectedPromotionCode, + SelectedPromotionCode, + SelectedPromotionCode, + ], +) -> Response[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedPromotionCode] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: Union[ + SelectedPromotionCode, + SelectedPromotionCode, + SelectedPromotionCode, + ], +) -> Optional[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + body (SelectedPromotionCode): Serializer for SelectedPromotionCode model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedPromotionCode + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_destroy.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_destroy.py new file mode 100644 index 0000000..e7b1ef8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_destroy.py @@ -0,0 +1,97 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/api/v2/modules_registrations/selected_promotion_codes/{id}/", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_list.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_list.py new file mode 100644 index 0000000..53e005f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_list.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_selected_promotion_code_list import PaginatedSelectedPromotionCodeList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + basket: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + promotion_code: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["basket"] = basket + + params["o"] = o + + params["offset"] = offset + + params["page_limit"] = page_limit + + params["promotion_code"] = promotion_code + + params["q"] = q + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/modules_registrations/selected_promotion_codes/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedSelectedPromotionCodeList]: + if response.status_code == 200: + response_200 = PaginatedSelectedPromotionCodeList.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedSelectedPromotionCodeList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + basket: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + promotion_code: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedSelectedPromotionCodeList]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + basket (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + promotion_code (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedPromotionCodeList] + """ + + kwargs = _get_kwargs( + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + promotion_code=promotion_code, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + basket: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + promotion_code: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedSelectedPromotionCodeList]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + basket (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + promotion_code (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedPromotionCodeList + """ + + return sync_detailed( + client=client, + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + promotion_code=promotion_code, + q=q, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + basket: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + promotion_code: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Response[PaginatedSelectedPromotionCodeList]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + basket (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + promotion_code (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedSelectedPromotionCodeList] + """ + + kwargs = _get_kwargs( + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + promotion_code=promotion_code, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + basket: Union[Unset, int] = UNSET, + o: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + page_limit: Union[Unset, int] = UNSET, + promotion_code: Union[Unset, int] = UNSET, + q: Union[Unset, str] = UNSET, +) -> Optional[PaginatedSelectedPromotionCodeList]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + basket (Union[Unset, int]): + o (Union[Unset, str]): + offset (Union[Unset, int]): + page_limit (Union[Unset, int]): + promotion_code (Union[Unset, int]): + q (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedSelectedPromotionCodeList + """ + + return ( + await asyncio_detailed( + client=client, + basket=basket, + o=o, + offset=offset, + page_limit=page_limit, + promotion_code=promotion_code, + q=q, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_retrieve.py new file mode 100644 index 0000000..4bf33a9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/modules_registrations/modules_registrations_selected_promotion_codes_retrieve.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.selected_promotion_code import SelectedPromotionCode +from ...types import Response + + +def _get_kwargs( + id: int, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/api/v2/modules_registrations/selected_promotion_codes/{id}/", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SelectedPromotionCode]: + if response.status_code == 200: + response_200 = SelectedPromotionCode.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SelectedPromotionCode]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedPromotionCode] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedPromotionCode + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: int, + *, + client: AuthenticatedClient, +) -> Response[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SelectedPromotionCode] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: int, + *, + client: AuthenticatedClient, +) -> Optional[SelectedPromotionCode]: + """This ViewSet manages SelectedPromotionCode. + It allows to save that the user has entered a valid promo code on the ticketoffice homepage. + It's linked by a ForeignKey to a PromotionCode (where the promo code comes from). + + Args: + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SelectedPromotionCode + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/schema/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/api/schema/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/schema/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/poly-ticket-api-client/poly_ticket_api_client/api/schema/schema_retrieve.py b/poly-ticket-api-client/poly_ticket_api_client/api/schema/schema_retrieve.py new file mode 100644 index 0000000..ab7bad4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/api/schema/schema_retrieve.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.schema_retrieve_format import SchemaRetrieveFormat +from ...models.schema_retrieve_lang import SchemaRetrieveLang +from ...models.schema_retrieve_response_200 import SchemaRetrieveResponse200 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + format_: Union[Unset, SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, SchemaRetrieveLang] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_format_: Union[Unset, str] = UNSET + if not isinstance(format_, Unset): + json_format_ = format_.value + + params["format"] = json_format_ + + json_lang: Union[Unset, str] = UNSET + if not isinstance(lang, Unset): + json_lang = lang.value + + params["lang"] = json_lang + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v2/schema/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SchemaRetrieveResponse200]: + if response.status_code == 200: + response_200 = SchemaRetrieveResponse200.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SchemaRetrieveResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + format_: Union[Unset, SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, SchemaRetrieveLang] = UNSET, +) -> Response[SchemaRetrieveResponse200]: + """OpenApi3 schema for this API. Format can be selected via content negotiation. + + - YAML: application/vnd.oai.openapi + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, SchemaRetrieveFormat]): + lang (Union[Unset, SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SchemaRetrieveResponse200] + """ + + kwargs = _get_kwargs( + format_=format_, + lang=lang, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + format_: Union[Unset, SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, SchemaRetrieveLang] = UNSET, +) -> Optional[SchemaRetrieveResponse200]: + """OpenApi3 schema for this API. Format can be selected via content negotiation. + + - YAML: application/vnd.oai.openapi + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, SchemaRetrieveFormat]): + lang (Union[Unset, SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SchemaRetrieveResponse200 + """ + + return sync_detailed( + client=client, + format_=format_, + lang=lang, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + format_: Union[Unset, SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, SchemaRetrieveLang] = UNSET, +) -> Response[SchemaRetrieveResponse200]: + """OpenApi3 schema for this API. Format can be selected via content negotiation. + + - YAML: application/vnd.oai.openapi + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, SchemaRetrieveFormat]): + lang (Union[Unset, SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SchemaRetrieveResponse200] + """ + + kwargs = _get_kwargs( + format_=format_, + lang=lang, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + format_: Union[Unset, SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, SchemaRetrieveLang] = UNSET, +) -> Optional[SchemaRetrieveResponse200]: + """OpenApi3 schema for this API. Format can be selected via content negotiation. + + - YAML: application/vnd.oai.openapi + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, SchemaRetrieveFormat]): + lang (Union[Unset, SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SchemaRetrieveResponse200 + """ + + return ( + await asyncio_detailed( + client=client, + format_=format_, + lang=lang, + ) + ).parsed diff --git a/poly-ticket-api-client/poly_ticket_api_client/client.py b/poly-ticket-api-client/poly_ticket_api_client/client.py new file mode 100644 index 0000000..e80446f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/client.py @@ -0,0 +1,268 @@ +import ssl +from typing import Any, Optional, Union + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/poly-ticket-api-client/poly_ticket_api_client/errors.py b/poly-ticket-api-client/poly_ticket_api_client/errors.py new file mode 100644 index 0000000..5f92e76 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/__init__.py b/poly-ticket-api-client/poly_ticket_api_client/models/__init__.py new file mode 100644 index 0000000..8ac01c5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/__init__.py @@ -0,0 +1,475 @@ +"""Contains all the data models used in inputs/outputs""" + +from .access_management_place import AccessManagementPlace +from .accounting_invoices_list_status import AccountingInvoicesListStatus +from .add_to_basket_node_extra_info import AddToBasketNodeExtraInfo +from .add_to_basket_node_extra_info_group import AddToBasketNodeExtraInfoGroup +from .api_token import ApiToken +from .billing_information import BillingInformation +from .blank_enum import BlankEnum +from .cancel_error import CancelError +from .category_enum import CategoryEnum +from .completion_started import CompletionStarted +from .condition import Condition +from .confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule +from .confirmation_page_extra_text_configuration import ConfirmationPageExtraTextConfiguration +from .core_unitmemberships_list_role import CoreUnitmembershipsListRole +from .create_anonymous_login import CreateAnonymousLogin +from .create_trusted_email_login import CreateTrustedEmailLogin +from .document import Document +from .document_type_enum import DocumentTypeEnum +from .event import Event +from .event_moderation import EventModeration +from .event_public_infos import EventPublicInfos +from .event_statistics import EventStatistics +from .event_statistics_invoices_refunded import EventStatisticsInvoicesRefunded +from .event_statistics_invoices_refunded_value import EventStatisticsInvoicesRefundedValue +from .event_statistics_invoices_resolved import EventStatisticsInvoicesResolved +from .event_statistics_invoices_resolved_value import EventStatisticsInvoicesResolvedValue +from .event_status_enum import EventStatusEnum +from .events_events_actions_export_create_file_type import EventsEventsActionsExportCreateFileType +from .events_events_actions_statistics_retrieve_granularity import EventsEventsActionsStatisticsRetrieveGranularity +from .frontend_basket import FrontendBasket +from .frontend_login import FrontendLogin +from .invoice import Invoice +from .left_hand_operand_enum import LeftHandOperandEnum +from .logical_operator_enum import LogicalOperatorEnum +from .login import Login +from .login_jwt import LoginJWT +from .login_method import LoginMethod +from .login_result import LoginResult +from .mode_enum import ModeEnum +from .model_form_line_type import ModelFormLineType +from .moderation_status_enum import ModerationStatusEnum +from .module_auth_anonymous_login_active_module import ModuleAuthAnonymousLoginActiveModule +from .module_auth_anonymous_login_configuration import ModuleAuthAnonymousLoginConfiguration +from .module_auth_third_party_token_login_active_module import ModuleAuthThirdPartyTokenLoginActiveModule +from .module_auth_third_party_token_login_configuration import ModuleAuthThirdPartyTokenLoginConfiguration +from .module_auth_trusted_email_active_module import ModuleAuthTrustedEmailActiveModule +from .module_auth_trusted_email_configuration import ModuleAuthTrustedEmailConfiguration +from .module_completion_email_registration_completed_active_module import ( + ModuleCompletionEmailRegistrationCompletedActiveModule, +) +from .module_completion_email_registration_completed_configuration import ( + ModuleCompletionEmailRegistrationCompletedConfiguration, +) +from .module_completion_email_registration_creation_active_module import ( + ModuleCompletionEmailRegistrationCreationActiveModule, +) +from .module_completion_email_registration_creation_configuration import ( + ModuleCompletionEmailRegistrationCreationConfiguration, +) +from .module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule +from .module_completion_pdf_ticket_configuration import ModuleCompletionPDFTicketConfiguration +from .module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule +from .module_completion_redirect_configuration import ModuleCompletionRedirectConfiguration +from .module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule +from .module_payment_payrexx_configuration import ModulePaymentPayrexxConfiguration +from .module_payment_payrexx_configuration_global_limit import ModulePaymentPayrexxConfigurationGlobalLimit +from .module_payment_payrexx_configuration_limit import ModulePaymentPayrexxConfigurationLimit +from .module_payment_payrexx_configuration_price_rule import ModulePaymentPayrexxConfigurationPriceRule +from .module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule +from .module_payment_point_of_sale_configuration import ModulePaymentPointOfSaleConfiguration +from .module_payment_point_of_sale_configuration_global_limit import ModulePaymentPointOfSaleConfigurationGlobalLimit +from .module_payment_point_of_sale_configuration_limit import ModulePaymentPointOfSaleConfigurationLimit +from .module_payment_point_of_sale_configuration_price_rule import ModulePaymentPointOfSaleConfigurationPriceRule +from .module_registration_access_management_active_module import ModuleRegistrationAccessManagementActiveModule +from .module_registration_options_active_module import ModuleRegistrationOptionsActiveModule +from .module_registration_options_configuration import ModuleRegistrationOptionsConfiguration +from .module_registrations_access_management_configuration import ModuleRegistrationsAccessManagementConfiguration +from .modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve_inline_type import ( + ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType, +) +from .node import Node +from .node_access import NodeAccess +from .node_access_m2m import NodeAccessM2M +from .node_availability import NodeAvailability +from .node_availability_m2m import NodeAvailabilityM2M +from .node_cart_configuration import NodeCartConfiguration +from .node_configuration import NodeConfiguration +from .node_extra_info import NodeExtraInfo +from .node_extra_info_group import NodeExtraInfoGroup +from .node_extra_info_group_m2m import NodeExtraInfoGroupM2M +from .node_limit import NodeLimit +from .node_limit_m2m import NodeLimitM2M +from .node_limit_usage import NodeLimitUsage +from .node_price_rule import NodePriceRule +from .node_price_rule_m2m import NodePriceRuleM2M +from .node_stock import NodeStock +from .node_tag import NodeTag +from .operator_enum import OperatorEnum +from .paginated_access_management_place_list import PaginatedAccessManagementPlaceList +from .paginated_api_token_list import PaginatedApiTokenList +from .paginated_billing_information_list import PaginatedBillingInformationList +from .paginated_condition_list import PaginatedConditionList +from .paginated_confirmation_page_extra_text_active_module_list import ( + PaginatedConfirmationPageExtraTextActiveModuleList, +) +from .paginated_document_list import PaginatedDocumentList +from .paginated_event_list import PaginatedEventList +from .paginated_frontend_basket_list import PaginatedFrontendBasketList +from .paginated_frontend_login_list import PaginatedFrontendLoginList +from .paginated_invoice_list import PaginatedInvoiceList +from .paginated_login_method_list import PaginatedLoginMethodList +from .paginated_module_auth_anonymous_login_active_module_list import PaginatedModuleAuthAnonymousLoginActiveModuleList +from .paginated_module_auth_third_party_token_login_active_module_list import ( + PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList, +) +from .paginated_module_auth_trusted_email_active_module_list import PaginatedModuleAuthTrustedEmailActiveModuleList +from .paginated_module_completion_email_registration_completed_active_module_list import ( + PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList, +) +from .paginated_module_completion_email_registration_creation_active_module_list import ( + PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList, +) +from .paginated_module_completion_pdf_ticket_active_module_list import ( + PaginatedModuleCompletionPDFTicketActiveModuleList, +) +from .paginated_module_completion_redirect_active_module_list import PaginatedModuleCompletionRedirectActiveModuleList +from .paginated_module_payment_payrexx_active_module_list import PaginatedModulePaymentPayrexxActiveModuleList +from .paginated_module_payment_point_of_sale_active_module_list import PaginatedModulePaymentPointOfSaleActiveModuleList +from .paginated_module_registration_access_management_active_module_list import ( + PaginatedModuleRegistrationAccessManagementActiveModuleList, +) +from .paginated_module_registration_options_active_module_list import PaginatedModuleRegistrationOptionsActiveModuleList +from .paginated_node_access_list import PaginatedNodeAccessList +from .paginated_node_access_m2m_list import PaginatedNodeAccessM2MList +from .paginated_node_availability_list import PaginatedNodeAvailabilityList +from .paginated_node_availability_m2m_list import PaginatedNodeAvailabilityM2MList +from .paginated_node_cart_configuration_list import PaginatedNodeCartConfigurationList +from .paginated_node_configuration_list import PaginatedNodeConfigurationList +from .paginated_node_extra_info_group_list import PaginatedNodeExtraInfoGroupList +from .paginated_node_extra_info_group_m2m_list import PaginatedNodeExtraInfoGroupM2MList +from .paginated_node_extra_info_list import PaginatedNodeExtraInfoList +from .paginated_node_limit_list import PaginatedNodeLimitList +from .paginated_node_limit_m2m_list import PaginatedNodeLimitM2MList +from .paginated_node_list import PaginatedNodeList +from .paginated_node_price_rule_list import PaginatedNodePriceRuleList +from .paginated_node_price_rule_m2m_list import PaginatedNodePriceRuleM2MList +from .paginated_node_tag_list import PaginatedNodeTagList +from .paginated_payment_intent_list import PaginatedPaymentIntentList +from .paginated_payment_method_list import PaginatedPaymentMethodList +from .paginated_point_of_sale_place_read_only_list import PaginatedPointOfSalePlaceReadOnlyList +from .paginated_poly_ticket_user_list import PaginatedPolyTicketUserList +from .paginated_promotion_code_list import PaginatedPromotionCodeList +from .paginated_selected_node_extra_info_group_list import PaginatedSelectedNodeExtraInfoGroupList +from .paginated_selected_node_extra_info_list import PaginatedSelectedNodeExtraInfoList +from .paginated_selected_node_list import PaginatedSelectedNodeList +from .paginated_selected_promotion_code_list import PaginatedSelectedPromotionCodeList +from .paginated_statement_list import PaginatedStatementList +from .paginated_unit_list import PaginatedUnitList +from .paginated_unit_membership_list import PaginatedUnitMembershipList +from .paginated_uploaded_image_list import PaginatedUploadedImageList +from .password_change_success import PasswordChangeSuccess +from .password_reset_success import PasswordResetSuccess +from .patched_access_management_place import PatchedAccessManagementPlace +from .patched_condition import PatchedCondition +from .patched_confirmation_page_extra_text_active_module import PatchedConfirmationPageExtraTextActiveModule +from .patched_event import PatchedEvent +from .patched_frontend_basket import PatchedFrontendBasket +from .patched_module_auth_anonymous_login_active_module import PatchedModuleAuthAnonymousLoginActiveModule +from .patched_module_auth_third_party_token_login_active_module import PatchedModuleAuthThirdPartyTokenLoginActiveModule +from .patched_module_auth_trusted_email_active_module import PatchedModuleAuthTrustedEmailActiveModule +from .patched_module_completion_email_registration_completed_active_module import ( + PatchedModuleCompletionEmailRegistrationCompletedActiveModule, +) +from .patched_module_completion_email_registration_creation_active_module import ( + PatchedModuleCompletionEmailRegistrationCreationActiveModule, +) +from .patched_module_completion_pdf_ticket_active_module import PatchedModuleCompletionPDFTicketActiveModule +from .patched_module_completion_redirect_active_module import PatchedModuleCompletionRedirectActiveModule +from .patched_module_payment_payrexx_active_module import PatchedModulePaymentPayrexxActiveModule +from .patched_module_payment_point_of_sale_active_module import PatchedModulePaymentPointOfSaleActiveModule +from .patched_module_registration_access_management_active_module import ( + PatchedModuleRegistrationAccessManagementActiveModule, +) +from .patched_module_registration_options_active_module import PatchedModuleRegistrationOptionsActiveModule +from .patched_node import PatchedNode +from .patched_node_access import PatchedNodeAccess +from .patched_node_availability import PatchedNodeAvailability +from .patched_node_cart_configuration import PatchedNodeCartConfiguration +from .patched_node_configuration import PatchedNodeConfiguration +from .patched_node_extra_info import PatchedNodeExtraInfo +from .patched_node_extra_info_group import PatchedNodeExtraInfoGroup +from .patched_node_limit import PatchedNodeLimit +from .patched_node_price_rule import PatchedNodePriceRule +from .patched_node_tag import PatchedNodeTag +from .patched_point_of_sale_place_read_only import PatchedPointOfSalePlaceReadOnly +from .patched_poly_ticket_user import PatchedPolyTicketUser +from .patched_promotion_code import PatchedPromotionCode +from .patched_selected_node_extra_info import PatchedSelectedNodeExtraInfo +from .patched_statement import PatchedStatement +from .patched_unit import PatchedUnit +from .patched_unit_membership import PatchedUnitMembership +from .patched_uploaded_image import PatchedUploadedImage +from .payment_intent import PaymentIntent +from .payment_intent_request_update import PaymentIntentRequestUpdate +from .payment_intent_request_update_status_enum import PaymentIntentRequestUpdateStatusEnum +from .payment_method import PaymentMethod +from .payment_start import PaymentStart +from .payrexx_payment import PayrexxPayment +from .payrexx_transaction import PayrexxTransaction +from .point_of_sale_place import PointOfSalePlace +from .point_of_sale_place_read_only import PointOfSalePlaceReadOnly +from .poly_ticket_user import PolyTicketUser +from .privacy_level_enum import PrivacyLevelEnum +from .promotion_code import PromotionCode +from .refund import Refund +from .schema_retrieve_format import SchemaRetrieveFormat +from .schema_retrieve_lang import SchemaRetrieveLang +from .schema_retrieve_response_200 import SchemaRetrieveResponse200 +from .selected_node import SelectedNode +from .selected_node_creation import SelectedNodeCreation +from .selected_node_deletion import SelectedNodeDeletion +from .selected_node_extra_info import SelectedNodeExtraInfo +from .selected_node_extra_info_group import SelectedNodeExtraInfoGroup +from .selected_node_status_enum import SelectedNodeStatusEnum +from .selected_promotion_code import SelectedPromotionCode +from .statement import Statement +from .ticket_office_article_calculated_price import TicketOfficeArticleCalculatedPrice +from .ticket_office_infos import TicketOfficeInfos +from .ticket_office_node_configuration import TicketOfficeNodeConfiguration +from .ticket_office_node_extra_info import TicketOfficeNodeExtraInfo +from .ticket_office_node_extra_info_group import TicketOfficeNodeExtraInfoGroup +from .ticket_office_node_limit import TicketOfficeNodeLimit +from .ticket_office_node_tag import TicketOfficeNodeTag +from .unit import Unit +from .unit_member_ship_creation_by_email import UnitMemberShipCreationByEmail +from .unit_member_ship_creation_by_email_role_enum import UnitMemberShipCreationByEmailRoleEnum +from .unit_membership import UnitMembership +from .unit_membership_role_enum import UnitMembershipRoleEnum +from .uploaded_image import UploadedImage +from .user_password_change import UserPasswordChange +from .user_password_reset import UserPasswordReset +from .user_password_reset_request import UserPasswordResetRequest +from .user_registration import UserRegistration +from .user_verification import UserVerification +from .validate_third_party_token_login import ValidateThirdPartyTokenLogin +from .validate_trusted_email_login import ValidateTrustedEmailLogin +from .verification_error import VerificationError +from .verification_success import VerificationSuccess +from .webhooks import Webhooks + +__all__ = ( + "AccessManagementPlace", + "AccountingInvoicesListStatus", + "AddToBasketNodeExtraInfo", + "AddToBasketNodeExtraInfoGroup", + "ApiToken", + "BillingInformation", + "BlankEnum", + "CancelError", + "CategoryEnum", + "CompletionStarted", + "Condition", + "ConfirmationPageExtraTextActiveModule", + "ConfirmationPageExtraTextConfiguration", + "CoreUnitmembershipsListRole", + "CreateAnonymousLogin", + "CreateTrustedEmailLogin", + "Document", + "DocumentTypeEnum", + "Event", + "EventModeration", + "EventPublicInfos", + "EventsEventsActionsExportCreateFileType", + "EventsEventsActionsStatisticsRetrieveGranularity", + "EventStatistics", + "EventStatisticsInvoicesRefunded", + "EventStatisticsInvoicesRefundedValue", + "EventStatisticsInvoicesResolved", + "EventStatisticsInvoicesResolvedValue", + "EventStatusEnum", + "FrontendBasket", + "FrontendLogin", + "Invoice", + "LeftHandOperandEnum", + "LogicalOperatorEnum", + "Login", + "LoginJWT", + "LoginMethod", + "LoginResult", + "ModeEnum", + "ModelFormLineType", + "ModerationStatusEnum", + "ModuleAuthAnonymousLoginActiveModule", + "ModuleAuthAnonymousLoginConfiguration", + "ModuleAuthThirdPartyTokenLoginActiveModule", + "ModuleAuthThirdPartyTokenLoginConfiguration", + "ModuleAuthTrustedEmailActiveModule", + "ModuleAuthTrustedEmailConfiguration", + "ModuleCompletionEmailRegistrationCompletedActiveModule", + "ModuleCompletionEmailRegistrationCompletedConfiguration", + "ModuleCompletionEmailRegistrationCreationActiveModule", + "ModuleCompletionEmailRegistrationCreationConfiguration", + "ModuleCompletionPDFTicketActiveModule", + "ModuleCompletionPDFTicketConfiguration", + "ModuleCompletionRedirectActiveModule", + "ModuleCompletionRedirectConfiguration", + "ModulePaymentPayrexxActiveModule", + "ModulePaymentPayrexxConfiguration", + "ModulePaymentPayrexxConfigurationGlobalLimit", + "ModulePaymentPayrexxConfigurationLimit", + "ModulePaymentPayrexxConfigurationPriceRule", + "ModulePaymentPointOfSaleActiveModule", + "ModulePaymentPointOfSaleConfiguration", + "ModulePaymentPointOfSaleConfigurationGlobalLimit", + "ModulePaymentPointOfSaleConfigurationLimit", + "ModulePaymentPointOfSaleConfigurationPriceRule", + "ModuleRegistrationAccessManagementActiveModule", + "ModuleRegistrationOptionsActiveModule", + "ModuleRegistrationOptionsConfiguration", + "ModuleRegistrationsAccessManagementConfiguration", + "ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType", + "Node", + "NodeAccess", + "NodeAccessM2M", + "NodeAvailability", + "NodeAvailabilityM2M", + "NodeCartConfiguration", + "NodeConfiguration", + "NodeExtraInfo", + "NodeExtraInfoGroup", + "NodeExtraInfoGroupM2M", + "NodeLimit", + "NodeLimitM2M", + "NodeLimitUsage", + "NodePriceRule", + "NodePriceRuleM2M", + "NodeStock", + "NodeTag", + "OperatorEnum", + "PaginatedAccessManagementPlaceList", + "PaginatedApiTokenList", + "PaginatedBillingInformationList", + "PaginatedConditionList", + "PaginatedConfirmationPageExtraTextActiveModuleList", + "PaginatedDocumentList", + "PaginatedEventList", + "PaginatedFrontendBasketList", + "PaginatedFrontendLoginList", + "PaginatedInvoiceList", + "PaginatedLoginMethodList", + "PaginatedModuleAuthAnonymousLoginActiveModuleList", + "PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList", + "PaginatedModuleAuthTrustedEmailActiveModuleList", + "PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList", + "PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList", + "PaginatedModuleCompletionPDFTicketActiveModuleList", + "PaginatedModuleCompletionRedirectActiveModuleList", + "PaginatedModulePaymentPayrexxActiveModuleList", + "PaginatedModulePaymentPointOfSaleActiveModuleList", + "PaginatedModuleRegistrationAccessManagementActiveModuleList", + "PaginatedModuleRegistrationOptionsActiveModuleList", + "PaginatedNodeAccessList", + "PaginatedNodeAccessM2MList", + "PaginatedNodeAvailabilityList", + "PaginatedNodeAvailabilityM2MList", + "PaginatedNodeCartConfigurationList", + "PaginatedNodeConfigurationList", + "PaginatedNodeExtraInfoGroupList", + "PaginatedNodeExtraInfoGroupM2MList", + "PaginatedNodeExtraInfoList", + "PaginatedNodeLimitList", + "PaginatedNodeLimitM2MList", + "PaginatedNodeList", + "PaginatedNodePriceRuleList", + "PaginatedNodePriceRuleM2MList", + "PaginatedNodeTagList", + "PaginatedPaymentIntentList", + "PaginatedPaymentMethodList", + "PaginatedPointOfSalePlaceReadOnlyList", + "PaginatedPolyTicketUserList", + "PaginatedPromotionCodeList", + "PaginatedSelectedNodeExtraInfoGroupList", + "PaginatedSelectedNodeExtraInfoList", + "PaginatedSelectedNodeList", + "PaginatedSelectedPromotionCodeList", + "PaginatedStatementList", + "PaginatedUnitList", + "PaginatedUnitMembershipList", + "PaginatedUploadedImageList", + "PasswordChangeSuccess", + "PasswordResetSuccess", + "PatchedAccessManagementPlace", + "PatchedCondition", + "PatchedConfirmationPageExtraTextActiveModule", + "PatchedEvent", + "PatchedFrontendBasket", + "PatchedModuleAuthAnonymousLoginActiveModule", + "PatchedModuleAuthThirdPartyTokenLoginActiveModule", + "PatchedModuleAuthTrustedEmailActiveModule", + "PatchedModuleCompletionEmailRegistrationCompletedActiveModule", + "PatchedModuleCompletionEmailRegistrationCreationActiveModule", + "PatchedModuleCompletionPDFTicketActiveModule", + "PatchedModuleCompletionRedirectActiveModule", + "PatchedModulePaymentPayrexxActiveModule", + "PatchedModulePaymentPointOfSaleActiveModule", + "PatchedModuleRegistrationAccessManagementActiveModule", + "PatchedModuleRegistrationOptionsActiveModule", + "PatchedNode", + "PatchedNodeAccess", + "PatchedNodeAvailability", + "PatchedNodeCartConfiguration", + "PatchedNodeConfiguration", + "PatchedNodeExtraInfo", + "PatchedNodeExtraInfoGroup", + "PatchedNodeLimit", + "PatchedNodePriceRule", + "PatchedNodeTag", + "PatchedPointOfSalePlaceReadOnly", + "PatchedPolyTicketUser", + "PatchedPromotionCode", + "PatchedSelectedNodeExtraInfo", + "PatchedStatement", + "PatchedUnit", + "PatchedUnitMembership", + "PatchedUploadedImage", + "PaymentIntent", + "PaymentIntentRequestUpdate", + "PaymentIntentRequestUpdateStatusEnum", + "PaymentMethod", + "PaymentStart", + "PayrexxPayment", + "PayrexxTransaction", + "PointOfSalePlace", + "PointOfSalePlaceReadOnly", + "PolyTicketUser", + "PrivacyLevelEnum", + "PromotionCode", + "Refund", + "SchemaRetrieveFormat", + "SchemaRetrieveLang", + "SchemaRetrieveResponse200", + "SelectedNode", + "SelectedNodeCreation", + "SelectedNodeDeletion", + "SelectedNodeExtraInfo", + "SelectedNodeExtraInfoGroup", + "SelectedNodeStatusEnum", + "SelectedPromotionCode", + "Statement", + "TicketOfficeArticleCalculatedPrice", + "TicketOfficeInfos", + "TicketOfficeNodeConfiguration", + "TicketOfficeNodeExtraInfo", + "TicketOfficeNodeExtraInfoGroup", + "TicketOfficeNodeLimit", + "TicketOfficeNodeTag", + "Unit", + "UnitMembership", + "UnitMemberShipCreationByEmail", + "UnitMemberShipCreationByEmailRoleEnum", + "UnitMembershipRoleEnum", + "UploadedImage", + "UserPasswordChange", + "UserPasswordReset", + "UserPasswordResetRequest", + "UserRegistration", + "UserVerification", + "ValidateThirdPartyTokenLogin", + "ValidateTrustedEmailLogin", + "VerificationError", + "VerificationSuccess", + "Webhooks", +) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/access_management_place.py b/poly-ticket-api-client/poly_ticket_api_client/models/access_management_place.py new file mode 100644 index 0000000..0eadb0e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/access_management_place.py @@ -0,0 +1,151 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AccessManagementPlace") + + +@_attrs_define +class AccessManagementPlace: + """Serializer for AccessManagementPlace model + + Attributes: + id (int): + name (str): + configuration (int): + monomode_testing_url (str): URL of the access management scanner for this place, in testing mode. + monomode_url (str): URL of the access management scanner for this place. + expires_at (Union[None, Unset, datetime.datetime]): + """ + + id: int + name: str + configuration: int + monomode_testing_url: str + monomode_url: str + expires_at: Union[None, Unset, datetime.datetime] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + configuration = self.configuration + + monomode_testing_url = self.monomode_testing_url + + monomode_url = self.monomode_url + + expires_at: Union[None, Unset, str] + if isinstance(self.expires_at, Unset): + expires_at = UNSET + elif isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "configuration": configuration, + "monomode_testing_url": monomode_testing_url, + "monomode_url": monomode_url, + } + ) + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("configuration", (None, str(self.configuration).encode(), "text/plain"))) + + files.append(("monomode_testing_url", (None, str(self.monomode_testing_url).encode(), "text/plain"))) + + files.append(("monomode_url", (None, str(self.monomode_url).encode(), "text/plain"))) + + if not isinstance(self.expires_at, Unset): + if isinstance(self.expires_at, datetime.datetime): + files.append(("expires_at", (None, self.expires_at.isoformat().encode(), "text/plain"))) + else: + files.append(("expires_at", (None, str(self.expires_at).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + configuration = d.pop("configuration") + + monomode_testing_url = d.pop("monomode_testing_url") + + monomode_url = d.pop("monomode_url") + + def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = isoparse(data) + + return expires_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) + + access_management_place = cls( + id=id, + name=name, + configuration=configuration, + monomode_testing_url=monomode_testing_url, + monomode_url=monomode_url, + expires_at=expires_at, + ) + + access_management_place.additional_properties = d + return access_management_place + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/accounting_invoices_list_status.py b/poly-ticket-api-client/poly_ticket_api_client/models/accounting_invoices_list_status.py new file mode 100644 index 0000000..dfde539 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/accounting_invoices_list_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class AccountingInvoicesListStatus(str, Enum): + CANCELLED = "cancelled" + CREATED = "created" + RESOLVED = "resolved" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info.py b/poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info.py new file mode 100644 index 0000000..8b0f822 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info.py @@ -0,0 +1,69 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AddToBasketNodeExtraInfo") + + +@_attrs_define +class AddToBasketNodeExtraInfo: + """A serializer to be used exclusively inside the AddToBasketNodeExtraInfoGroupSerializer. + This is used to specify which NodeExtraInfo you are submitting a value for, and the value itself in one go + + Attributes: + node_extra_info (int): + value (str): + """ + + node_extra_info: int + value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + node_extra_info = self.node_extra_info + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "node_extra_info": node_extra_info, + "value": value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + node_extra_info = d.pop("node_extra_info") + + value = d.pop("value") + + add_to_basket_node_extra_info = cls( + node_extra_info=node_extra_info, + value=value, + ) + + add_to_basket_node_extra_info.additional_properties = d + return add_to_basket_node_extra_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info_group.py b/poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info_group.py new file mode 100644 index 0000000..5158052 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/add_to_basket_node_extra_info_group.py @@ -0,0 +1,83 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.add_to_basket_node_extra_info import AddToBasketNodeExtraInfo + + +T = TypeVar("T", bound="AddToBasketNodeExtraInfoGroup") + + +@_attrs_define +class AddToBasketNodeExtraInfoGroup: + """A serializer to be used exclusively inside the SelectedNodeCreationSerializer. + This facilates submitting the values (responses) for all NodeExtraInfos of a NodeExtraInfoGroup in one go + + Attributes: + node_extra_infos (list['AddToBasketNodeExtraInfo']): + node_extra_info_group (int): + """ + + node_extra_infos: list["AddToBasketNodeExtraInfo"] + node_extra_info_group: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + node_extra_infos = [] + for node_extra_infos_item_data in self.node_extra_infos: + node_extra_infos_item = node_extra_infos_item_data.to_dict() + node_extra_infos.append(node_extra_infos_item) + + node_extra_info_group = self.node_extra_info_group + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "node_extra_infos": node_extra_infos, + "node_extra_info_group": node_extra_info_group, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.add_to_basket_node_extra_info import AddToBasketNodeExtraInfo + + d = dict(src_dict) + node_extra_infos = [] + _node_extra_infos = d.pop("node_extra_infos") + for node_extra_infos_item_data in _node_extra_infos: + node_extra_infos_item = AddToBasketNodeExtraInfo.from_dict(node_extra_infos_item_data) + + node_extra_infos.append(node_extra_infos_item) + + node_extra_info_group = d.pop("node_extra_info_group") + + add_to_basket_node_extra_info_group = cls( + node_extra_infos=node_extra_infos, + node_extra_info_group=node_extra_info_group, + ) + + add_to_basket_node_extra_info_group.additional_properties = d + return add_to_basket_node_extra_info_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/api_token.py b/poly-ticket-api-client/poly_ticket_api_client/models/api_token.py new file mode 100644 index 0000000..5f5feac --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/api_token.py @@ -0,0 +1,125 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="ApiToken") + + +@_attrs_define +class ApiToken: + """ + Attributes: + id (int): + user (Union[None, int]): + frontend_logins (list[int]): + is_automatic (bool): True if the token has been generated automatically + name (str): Informative name, for you :) + expiration (Union[None, datetime.datetime]): When the token should expire. Leave blank for an infinitely valid + token (not recommended!) + """ + + id: int + user: Union[None, int] + frontend_logins: list[int] + is_automatic: bool + name: str + expiration: Union[None, datetime.datetime] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + user: Union[None, int] + user = self.user + + frontend_logins = self.frontend_logins + + is_automatic = self.is_automatic + + name = self.name + + expiration: Union[None, str] + if isinstance(self.expiration, datetime.datetime): + expiration = self.expiration.isoformat() + else: + expiration = self.expiration + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "user": user, + "frontend_logins": frontend_logins, + "is_automatic": is_automatic, + "name": name, + "expiration": expiration, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + def _parse_user(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + user = _parse_user(d.pop("user")) + + frontend_logins = cast(list[int], d.pop("frontend_logins")) + + is_automatic = d.pop("is_automatic") + + name = d.pop("name") + + def _parse_expiration(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + expiration_type_0 = isoparse(data) + + return expiration_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + expiration = _parse_expiration(d.pop("expiration")) + + api_token = cls( + id=id, + user=user, + frontend_logins=frontend_logins, + is_automatic=is_automatic, + name=name, + expiration=expiration, + ) + + api_token.additional_properties = d + return api_token + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/billing_information.py b/poly-ticket-api-client/poly_ticket_api_client/models/billing_information.py new file mode 100644 index 0000000..ff622e3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/billing_information.py @@ -0,0 +1,212 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BillingInformation") + + +@_attrs_define +class BillingInformation: + """Serializer for BillingInformation model + Requires to be logged in as a user or to provide a frontend login associated with your request + + Attributes: + id (int): + email (str): + user (Union[None, int]): + frontendbasket_set (list[int]): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + address (Union[Unset, str]): + postal_code (Union[Unset, str]): + city (Union[Unset, str]): + country (Union[Unset, str]): + created_by (Union[None, Unset, int]): + """ + + id: int + email: str + user: Union[None, int] + frontendbasket_set: list[int] + first_name: Union[Unset, str] = UNSET + last_name: Union[Unset, str] = UNSET + address: Union[Unset, str] = UNSET + postal_code: Union[Unset, str] = UNSET + city: Union[Unset, str] = UNSET + country: Union[Unset, str] = UNSET + created_by: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + email = self.email + + user: Union[None, int] + user = self.user + + frontendbasket_set = self.frontendbasket_set + + first_name = self.first_name + + last_name = self.last_name + + address = self.address + + postal_code = self.postal_code + + city = self.city + + country = self.country + + created_by: Union[None, Unset, int] + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "email": email, + "user": user, + "frontendbasket_set": frontendbasket_set, + } + ) + if first_name is not UNSET: + field_dict["first_name"] = first_name + if last_name is not UNSET: + field_dict["last_name"] = last_name + if address is not UNSET: + field_dict["address"] = address + if postal_code is not UNSET: + field_dict["postal_code"] = postal_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if created_by is not UNSET: + field_dict["created_by"] = created_by + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + if isinstance(self.user, int): + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + else: + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + + for frontendbasket_set_item_element in self.frontendbasket_set: + files.append(("frontendbasket_set", (None, str(frontendbasket_set_item_element).encode(), "text/plain"))) + + if not isinstance(self.first_name, Unset): + files.append(("first_name", (None, str(self.first_name).encode(), "text/plain"))) + + if not isinstance(self.last_name, Unset): + files.append(("last_name", (None, str(self.last_name).encode(), "text/plain"))) + + if not isinstance(self.address, Unset): + files.append(("address", (None, str(self.address).encode(), "text/plain"))) + + if not isinstance(self.postal_code, Unset): + files.append(("postal_code", (None, str(self.postal_code).encode(), "text/plain"))) + + if not isinstance(self.city, Unset): + files.append(("city", (None, str(self.city).encode(), "text/plain"))) + + if not isinstance(self.country, Unset): + files.append(("country", (None, str(self.country).encode(), "text/plain"))) + + if not isinstance(self.created_by, Unset): + if isinstance(self.created_by, int): + files.append(("created_by", (None, str(self.created_by).encode(), "text/plain"))) + else: + files.append(("created_by", (None, str(self.created_by).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + email = d.pop("email") + + def _parse_user(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + user = _parse_user(d.pop("user")) + + frontendbasket_set = cast(list[int], d.pop("frontendbasket_set")) + + first_name = d.pop("first_name", UNSET) + + last_name = d.pop("last_name", UNSET) + + address = d.pop("address", UNSET) + + postal_code = d.pop("postal_code", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + def _parse_created_by(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + created_by = _parse_created_by(d.pop("created_by", UNSET)) + + billing_information = cls( + id=id, + email=email, + user=user, + frontendbasket_set=frontendbasket_set, + first_name=first_name, + last_name=last_name, + address=address, + postal_code=postal_code, + city=city, + country=country, + created_by=created_by, + ) + + billing_information.additional_properties = d + return billing_information + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/blank_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/blank_enum.py new file mode 100644 index 0000000..8a87569 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/blank_enum.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class BlankEnum(str, Enum): + VALUE_0 = "" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/cancel_error.py b/poly-ticket-api-client/poly_ticket_api_client/models/cancel_error.py new file mode 100644 index 0000000..e26558e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/cancel_error.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelError") + + +@_attrs_define +class CancelError: + """ + Attributes: + error (str): Error in case the payment intent was not in a cancellable state (paid or already cancelled). + """ + + error: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + error = d.pop("error") + + cancel_error = cls( + error=error, + ) + + cancel_error.additional_properties = d + return cancel_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/category_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/category_enum.py new file mode 100644 index 0000000..358aef2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/category_enum.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class CategoryEnum(str, Enum): + ACCOMODATION = "accomodation" + ACTIVITY = "activity" + GROUP = "group" + ITEM = "item" + TICKET = "ticket" + TYPE = "type" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/completion_started.py b/poly-ticket-api-client/poly_ticket_api_client/models/completion_started.py new file mode 100644 index 0000000..1c8246d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/completion_started.py @@ -0,0 +1,72 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="CompletionStarted") + + +@_attrs_define +class CompletionStarted: + """Serializer for CompletionStartedViewSet + + Attributes: + basket_id (int): The ID of the frontend basket. + """ + + basket_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + basket_id = self.basket_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "basket_id": basket_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("basket_id", (None, str(self.basket_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + basket_id = d.pop("basket_id") + + completion_started = cls( + basket_id=basket_id, + ) + + completion_started.additional_properties = d + return completion_started + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/condition.py b/poly-ticket-api-client/poly_ticket_api_client/models/condition.py new file mode 100644 index 0000000..07c49c9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/condition.py @@ -0,0 +1,129 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.logical_operator_enum import LogicalOperatorEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Condition") + + +@_attrs_define +class Condition: + """Serializer (read/write) for `Condition` model + + Attributes: + event (int): + event_id (int): + id (int): + logical_operator (LogicalOperatorEnum): * `or` - OR + * `and` - AND + name (Union[Unset, str]): + is_implicit (Union[Unset, bool]): can store a combination of conditions as a single condition + """ + + event: int + event_id: int + id: int + logical_operator: LogicalOperatorEnum + name: Union[Unset, str] = UNSET + is_implicit: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + logical_operator = self.logical_operator.value + + name = self.name + + is_implicit = self.is_implicit + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "logical_operator": logical_operator, + } + ) + if name is not UNSET: + field_dict["name"] = name + if is_implicit is not UNSET: + field_dict["is_implicit"] = is_implicit + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("logical_operator", (None, str(self.logical_operator.value).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.is_implicit, Unset): + files.append(("is_implicit", (None, str(self.is_implicit).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + logical_operator = LogicalOperatorEnum(d.pop("logical_operator")) + + name = d.pop("name", UNSET) + + is_implicit = d.pop("is_implicit", UNSET) + + condition = cls( + event=event, + event_id=event_id, + id=id, + logical_operator=logical_operator, + name=name, + is_implicit=is_implicit, + ) + + condition.additional_properties = d + return condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_active_module.py new file mode 100644 index 0000000..ed58d18 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_active_module.py @@ -0,0 +1,114 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.confirmation_page_extra_text_configuration import ConfirmationPageExtraTextConfiguration + + +T = TypeVar("T", bound="ConfirmationPageExtraTextActiveModule") + + +@_attrs_define +class ConfirmationPageExtraTextActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText` + + Attributes: + id (int): + event (int): + config (ConfirmationPageExtraTextConfiguration): Serializer for + `ModuleCompletionConfirmationPageExtraTextConfiguration` nested in + `ConfirmationPageExtraTextActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ConfirmationPageExtraTextConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.confirmation_page_extra_text_configuration import ConfirmationPageExtraTextConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ConfirmationPageExtraTextConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + confirmation_page_extra_text_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + confirmation_page_extra_text_active_module.additional_properties = d + return confirmation_page_extra_text_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_configuration.py new file mode 100644 index 0000000..93ad53c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/confirmation_page_extra_text_configuration.py @@ -0,0 +1,111 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ConfirmationPageExtraTextConfiguration") + + +@_attrs_define +class ConfirmationPageExtraTextConfiguration: + """Serializer for `ModuleCompletionConfirmationPageExtraTextConfiguration` nested in + `ConfirmationPageExtraTextActiveModuleSerializer` + + Attributes: + id (int): + text (Union[Unset, str]): Text that is displayed on the order confirmation page. Some restricted HTML markup is + allowed, everything else is filtered out automatically. + image (Union[None, Unset, int]): The image used for the module + is_text_used (Union[Unset, bool]): + is_image_used (Union[Unset, bool]): + """ + + id: int + text: Union[Unset, str] = UNSET + image: Union[None, Unset, int] = UNSET + is_text_used: Union[Unset, bool] = UNSET + is_image_used: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + text = self.text + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + is_text_used = self.is_text_used + + is_image_used = self.is_image_used + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if text is not UNSET: + field_dict["text"] = text + if image is not UNSET: + field_dict["image"] = image + if is_text_used is not UNSET: + field_dict["is_text_used"] = is_text_used + if is_image_used is not UNSET: + field_dict["is_image_used"] = is_image_used + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + text = d.pop("text", UNSET) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + is_text_used = d.pop("is_text_used", UNSET) + + is_image_used = d.pop("is_image_used", UNSET) + + confirmation_page_extra_text_configuration = cls( + id=id, + text=text, + image=image, + is_text_used=is_text_used, + is_image_used=is_image_used, + ) + + confirmation_page_extra_text_configuration.additional_properties = d + return confirmation_page_extra_text_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/core_unitmemberships_list_role.py b/poly-ticket-api-client/poly_ticket_api_client/models/core_unitmemberships_list_role.py new file mode 100644 index 0000000..8a117f7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/core_unitmemberships_list_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class CoreUnitmembershipsListRole(str, Enum): + MEMBER = "member" + OWNER = "owner" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/create_anonymous_login.py b/poly-ticket-api-client/poly_ticket_api_client/models/create_anonymous_login.py new file mode 100644 index 0000000..7f917f1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/create_anonymous_login.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateAnonymousLogin") + + +@_attrs_define +class CreateAnonymousLogin: + """Serializer used for AnonymousLogin creation. + Adds `testing` (default to False) in data if not given. + + Attributes: + active_module_id (int): + testing (Union[Unset, bool]): Default: False. + """ + + active_module_id: int + testing: Union[Unset, bool] = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_module_id = self.active_module_id + + testing = self.testing + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_module_id": active_module_id, + } + ) + if testing is not UNSET: + field_dict["testing"] = testing + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("active_module_id", (None, str(self.active_module_id).encode(), "text/plain"))) + + if not isinstance(self.testing, Unset): + files.append(("testing", (None, str(self.testing).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_module_id = d.pop("active_module_id") + + testing = d.pop("testing", UNSET) + + create_anonymous_login = cls( + active_module_id=active_module_id, + testing=testing, + ) + + create_anonymous_login.additional_properties = d + return create_anonymous_login + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/create_trusted_email_login.py b/poly-ticket-api-client/poly_ticket_api_client/models/create_trusted_email_login.py new file mode 100644 index 0000000..ea00f21 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/create_trusted_email_login.py @@ -0,0 +1,96 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateTrustedEmailLogin") + + +@_attrs_define +class CreateTrustedEmailLogin: + """Serializer used for TrustedEmailLogin creation. + Adds `testing` (default to False) in data if not given and forces `email` to be provided. + + Attributes: + active_module_id (int): + email (str): + testing (Union[Unset, bool]): Default: False. + """ + + active_module_id: int + email: str + testing: Union[Unset, bool] = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_module_id = self.active_module_id + + email = self.email + + testing = self.testing + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_module_id": active_module_id, + "email": email, + } + ) + if testing is not UNSET: + field_dict["testing"] = testing + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("active_module_id", (None, str(self.active_module_id).encode(), "text/plain"))) + + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + if not isinstance(self.testing, Unset): + files.append(("testing", (None, str(self.testing).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_module_id = d.pop("active_module_id") + + email = d.pop("email") + + testing = d.pop("testing", UNSET) + + create_trusted_email_login = cls( + active_module_id=active_module_id, + email=email, + testing=testing, + ) + + create_trusted_email_login.additional_properties = d + return create_trusted_email_login + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/document.py b/poly-ticket-api-client/poly_ticket_api_client/models/document.py new file mode 100644 index 0000000..8b9df2a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/document.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.document_type_enum import DocumentTypeEnum + +T = TypeVar("T", bound="Document") + + +@_attrs_define +class Document: + """Serializer for `Document` model + + Attributes: + id (int): + is_active (bool): + type_ (DocumentTypeEnum): * `privacy_policy` - Privacy policy + * `terms_of_service` - Terms of service + * `imprint` - Imprint + file (str): + """ + + id: int + is_active: bool + type_: DocumentTypeEnum + file: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + is_active = self.is_active + + type_ = self.type_.value + + file = self.file + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "is_active": is_active, + "type": type_, + "file": file, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("is_active", (None, str(self.is_active).encode(), "text/plain"))) + + files.append(("type", (None, str(self.type_.value).encode(), "text/plain"))) + + files.append(("file", (None, str(self.file).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + is_active = d.pop("is_active") + + type_ = DocumentTypeEnum(d.pop("type")) + + file = d.pop("file") + + document = cls( + id=id, + is_active=is_active, + type_=type_, + file=file, + ) + + document.additional_properties = d + return document + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/document_type_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/document_type_enum.py new file mode 100644 index 0000000..8d10523 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/document_type_enum.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class DocumentTypeEnum(str, Enum): + IMPRINT = "imprint" + PRIVACY_POLICY = "privacy_policy" + TERMS_OF_SERVICE = "terms_of_service" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event.py b/poly-ticket-api-client/poly_ticket_api_client/models/event.py new file mode 100644 index 0000000..f8c7b40 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event.py @@ -0,0 +1,708 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..models.event_status_enum import EventStatusEnum +from ..models.moderation_status_enum import ModerationStatusEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Event") + + +@_attrs_define +class Event: + """Serializer for Node model + + Attributes: + id (int): + unit_id (int): + name (str): + moderation_status (ModerationStatusEnum): * `not_requested` - Not requested + * `requested` - Requested + * `change_requested` - Change requested + * `validated` - Validated + are_registrations_allowed (bool): + are_payments_allowed (bool): + frontend_title (str): Main name of the event shown to end users. I.e. shown on the Ticket Office webpage + frontend_path (str): Root of public path of the event url + location_address (str): + ticket_office_url (str): + ticket_office_testing_url (str): + is_status_public (bool): + status (Union[Unset, EventStatusEnum]): * `draft` - Draft + * `public` - Public + * `closed` - Closed (force) + * `archived` - Archived + registrations_start_date (Union[None, Unset, datetime.datetime]): + payments_start_date (Union[None, Unset, datetime.datetime]): + payments_end_date (Union[None, Unset, datetime.datetime]): + closed_start_date (Union[None, Unset, datetime.date]): + registrations_end_date (Union[None, Unset, datetime.datetime]): + start_date (Union[None, Unset, datetime.datetime]): + end_date (Union[None, Unset, datetime.datetime]): + custom_key (Union[Unset, str]): + welcome_text (Union[Unset, str]): Welcome text displayed on the Ticket Office event page. Some restricted HTML + markup is allowed, everything else is filtered out automatically. + frontend_url (Union[Unset, str]): External url provided by the organizer. I.e. their website or social media + page + frontend_organizers (Union[Unset, str]): Name of the organizer, displayed on the Ticket Office event page + multiple_registration_per_login (Union[Unset, bool]): + user_nickname_enabled (Union[Unset, bool]): + user_registration_link_unique (Union[Unset, bool]): + description_header_image (Union[None, Unset, int]): + terms_of_service (Union[Unset, str]): + location_text (Union[Unset, str]): + location (Union[None, Unset, str]): + is_public_visible (Union[Unset, bool]): + is_unit_visible (Union[Unset, bool]): + is_basket_item_modification_allowed (Union[Unset, bool]): This field informs the front end on what actions + should be allowed or prevented, in the front end only. + is_in_lausanne (Union[Unset, bool]): if the event physically takes place in the city of Lausanne, set this + boolean so that taxes are calculated properly + """ + + id: int + unit_id: int + name: str + moderation_status: ModerationStatusEnum + are_registrations_allowed: bool + are_payments_allowed: bool + frontend_title: str + frontend_path: str + location_address: str + ticket_office_url: str + ticket_office_testing_url: str + is_status_public: bool + status: Union[Unset, EventStatusEnum] = UNSET + registrations_start_date: Union[None, Unset, datetime.datetime] = UNSET + payments_start_date: Union[None, Unset, datetime.datetime] = UNSET + payments_end_date: Union[None, Unset, datetime.datetime] = UNSET + closed_start_date: Union[None, Unset, datetime.date] = UNSET + registrations_end_date: Union[None, Unset, datetime.datetime] = UNSET + start_date: Union[None, Unset, datetime.datetime] = UNSET + end_date: Union[None, Unset, datetime.datetime] = UNSET + custom_key: Union[Unset, str] = UNSET + welcome_text: Union[Unset, str] = UNSET + frontend_url: Union[Unset, str] = UNSET + frontend_organizers: Union[Unset, str] = UNSET + multiple_registration_per_login: Union[Unset, bool] = UNSET + user_nickname_enabled: Union[Unset, bool] = UNSET + user_registration_link_unique: Union[Unset, bool] = UNSET + description_header_image: Union[None, Unset, int] = UNSET + terms_of_service: Union[Unset, str] = UNSET + location_text: Union[Unset, str] = UNSET + location: Union[None, Unset, str] = UNSET + is_public_visible: Union[Unset, bool] = UNSET + is_unit_visible: Union[Unset, bool] = UNSET + is_basket_item_modification_allowed: Union[Unset, bool] = UNSET + is_in_lausanne: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + unit_id = self.unit_id + + name = self.name + + moderation_status = self.moderation_status.value + + are_registrations_allowed = self.are_registrations_allowed + + are_payments_allowed = self.are_payments_allowed + + frontend_title = self.frontend_title + + frontend_path = self.frontend_path + + location_address = self.location_address + + ticket_office_url = self.ticket_office_url + + ticket_office_testing_url = self.ticket_office_testing_url + + is_status_public = self.is_status_public + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + registrations_start_date: Union[None, Unset, str] + if isinstance(self.registrations_start_date, Unset): + registrations_start_date = UNSET + elif isinstance(self.registrations_start_date, datetime.datetime): + registrations_start_date = self.registrations_start_date.isoformat() + else: + registrations_start_date = self.registrations_start_date + + payments_start_date: Union[None, Unset, str] + if isinstance(self.payments_start_date, Unset): + payments_start_date = UNSET + elif isinstance(self.payments_start_date, datetime.datetime): + payments_start_date = self.payments_start_date.isoformat() + else: + payments_start_date = self.payments_start_date + + payments_end_date: Union[None, Unset, str] + if isinstance(self.payments_end_date, Unset): + payments_end_date = UNSET + elif isinstance(self.payments_end_date, datetime.datetime): + payments_end_date = self.payments_end_date.isoformat() + else: + payments_end_date = self.payments_end_date + + closed_start_date: Union[None, Unset, str] + if isinstance(self.closed_start_date, Unset): + closed_start_date = UNSET + elif isinstance(self.closed_start_date, datetime.date): + closed_start_date = self.closed_start_date.isoformat() + else: + closed_start_date = self.closed_start_date + + registrations_end_date: Union[None, Unset, str] + if isinstance(self.registrations_end_date, Unset): + registrations_end_date = UNSET + elif isinstance(self.registrations_end_date, datetime.datetime): + registrations_end_date = self.registrations_end_date.isoformat() + else: + registrations_end_date = self.registrations_end_date + + start_date: Union[None, Unset, str] + if isinstance(self.start_date, Unset): + start_date = UNSET + elif isinstance(self.start_date, datetime.datetime): + start_date = self.start_date.isoformat() + else: + start_date = self.start_date + + end_date: Union[None, Unset, str] + if isinstance(self.end_date, Unset): + end_date = UNSET + elif isinstance(self.end_date, datetime.datetime): + end_date = self.end_date.isoformat() + else: + end_date = self.end_date + + custom_key = self.custom_key + + welcome_text = self.welcome_text + + frontend_url = self.frontend_url + + frontend_organizers = self.frontend_organizers + + multiple_registration_per_login = self.multiple_registration_per_login + + user_nickname_enabled = self.user_nickname_enabled + + user_registration_link_unique = self.user_registration_link_unique + + description_header_image: Union[None, Unset, int] + if isinstance(self.description_header_image, Unset): + description_header_image = UNSET + else: + description_header_image = self.description_header_image + + terms_of_service = self.terms_of_service + + location_text = self.location_text + + location: Union[None, Unset, str] + if isinstance(self.location, Unset): + location = UNSET + else: + location = self.location + + is_public_visible = self.is_public_visible + + is_unit_visible = self.is_unit_visible + + is_basket_item_modification_allowed = self.is_basket_item_modification_allowed + + is_in_lausanne = self.is_in_lausanne + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "unit_id": unit_id, + "name": name, + "moderation_status": moderation_status, + "are_registrations_allowed": are_registrations_allowed, + "are_payments_allowed": are_payments_allowed, + "frontend_title": frontend_title, + "frontend_path": frontend_path, + "location_address": location_address, + "ticket_office_url": ticket_office_url, + "ticket_office_testing_url": ticket_office_testing_url, + "is_status_public": is_status_public, + } + ) + if status is not UNSET: + field_dict["status"] = status + if registrations_start_date is not UNSET: + field_dict["registrations_start_date"] = registrations_start_date + if payments_start_date is not UNSET: + field_dict["payments_start_date"] = payments_start_date + if payments_end_date is not UNSET: + field_dict["payments_end_date"] = payments_end_date + if closed_start_date is not UNSET: + field_dict["closed_start_date"] = closed_start_date + if registrations_end_date is not UNSET: + field_dict["registrations_end_date"] = registrations_end_date + if start_date is not UNSET: + field_dict["start_date"] = start_date + if end_date is not UNSET: + field_dict["end_date"] = end_date + if custom_key is not UNSET: + field_dict["custom_key"] = custom_key + if welcome_text is not UNSET: + field_dict["welcome_text"] = welcome_text + if frontend_url is not UNSET: + field_dict["frontend_url"] = frontend_url + if frontend_organizers is not UNSET: + field_dict["frontend_organizers"] = frontend_organizers + if multiple_registration_per_login is not UNSET: + field_dict["multiple_registration_per_login"] = multiple_registration_per_login + if user_nickname_enabled is not UNSET: + field_dict["user_nickname_enabled"] = user_nickname_enabled + if user_registration_link_unique is not UNSET: + field_dict["user_registration_link_unique"] = user_registration_link_unique + if description_header_image is not UNSET: + field_dict["description_header_image"] = description_header_image + if terms_of_service is not UNSET: + field_dict["terms_of_service"] = terms_of_service + if location_text is not UNSET: + field_dict["location_text"] = location_text + if location is not UNSET: + field_dict["location"] = location + if is_public_visible is not UNSET: + field_dict["is_public_visible"] = is_public_visible + if is_unit_visible is not UNSET: + field_dict["is_unit_visible"] = is_unit_visible + if is_basket_item_modification_allowed is not UNSET: + field_dict["is_basket_item_modification_allowed"] = is_basket_item_modification_allowed + if is_in_lausanne is not UNSET: + field_dict["is_in_lausanne"] = is_in_lausanne + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("unit_id", (None, str(self.unit_id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("moderation_status", (None, str(self.moderation_status.value).encode(), "text/plain"))) + + files.append(("are_registrations_allowed", (None, str(self.are_registrations_allowed).encode(), "text/plain"))) + + files.append(("are_payments_allowed", (None, str(self.are_payments_allowed).encode(), "text/plain"))) + + files.append(("frontend_title", (None, str(self.frontend_title).encode(), "text/plain"))) + + files.append(("frontend_path", (None, str(self.frontend_path).encode(), "text/plain"))) + + files.append(("location_address", (None, str(self.location_address).encode(), "text/plain"))) + + files.append(("ticket_office_url", (None, str(self.ticket_office_url).encode(), "text/plain"))) + + files.append(("ticket_office_testing_url", (None, str(self.ticket_office_testing_url).encode(), "text/plain"))) + + files.append(("is_status_public", (None, str(self.is_status_public).encode(), "text/plain"))) + + if not isinstance(self.status, Unset): + files.append(("status", (None, str(self.status.value).encode(), "text/plain"))) + + if not isinstance(self.registrations_start_date, Unset): + if isinstance(self.registrations_start_date, datetime.datetime): + files.append( + ( + "registrations_start_date", + (None, self.registrations_start_date.isoformat().encode(), "text/plain"), + ) + ) + else: + files.append( + ("registrations_start_date", (None, str(self.registrations_start_date).encode(), "text/plain")) + ) + + if not isinstance(self.payments_start_date, Unset): + if isinstance(self.payments_start_date, datetime.datetime): + files.append( + ("payments_start_date", (None, self.payments_start_date.isoformat().encode(), "text/plain")) + ) + else: + files.append(("payments_start_date", (None, str(self.payments_start_date).encode(), "text/plain"))) + + if not isinstance(self.payments_end_date, Unset): + if isinstance(self.payments_end_date, datetime.datetime): + files.append(("payments_end_date", (None, self.payments_end_date.isoformat().encode(), "text/plain"))) + else: + files.append(("payments_end_date", (None, str(self.payments_end_date).encode(), "text/plain"))) + + if not isinstance(self.closed_start_date, Unset): + if isinstance(self.closed_start_date, datetime.date): + files.append(("closed_start_date", (None, self.closed_start_date.isoformat().encode(), "text/plain"))) + else: + files.append(("closed_start_date", (None, str(self.closed_start_date).encode(), "text/plain"))) + + if not isinstance(self.registrations_end_date, Unset): + if isinstance(self.registrations_end_date, datetime.datetime): + files.append( + ("registrations_end_date", (None, self.registrations_end_date.isoformat().encode(), "text/plain")) + ) + else: + files.append( + ("registrations_end_date", (None, str(self.registrations_end_date).encode(), "text/plain")) + ) + + if not isinstance(self.start_date, Unset): + if isinstance(self.start_date, datetime.datetime): + files.append(("start_date", (None, self.start_date.isoformat().encode(), "text/plain"))) + else: + files.append(("start_date", (None, str(self.start_date).encode(), "text/plain"))) + + if not isinstance(self.end_date, Unset): + if isinstance(self.end_date, datetime.datetime): + files.append(("end_date", (None, self.end_date.isoformat().encode(), "text/plain"))) + else: + files.append(("end_date", (None, str(self.end_date).encode(), "text/plain"))) + + if not isinstance(self.custom_key, Unset): + files.append(("custom_key", (None, str(self.custom_key).encode(), "text/plain"))) + + if not isinstance(self.welcome_text, Unset): + files.append(("welcome_text", (None, str(self.welcome_text).encode(), "text/plain"))) + + if not isinstance(self.frontend_url, Unset): + files.append(("frontend_url", (None, str(self.frontend_url).encode(), "text/plain"))) + + if not isinstance(self.frontend_organizers, Unset): + files.append(("frontend_organizers", (None, str(self.frontend_organizers).encode(), "text/plain"))) + + if not isinstance(self.multiple_registration_per_login, Unset): + files.append( + ( + "multiple_registration_per_login", + (None, str(self.multiple_registration_per_login).encode(), "text/plain"), + ) + ) + + if not isinstance(self.user_nickname_enabled, Unset): + files.append(("user_nickname_enabled", (None, str(self.user_nickname_enabled).encode(), "text/plain"))) + + if not isinstance(self.user_registration_link_unique, Unset): + files.append( + ( + "user_registration_link_unique", + (None, str(self.user_registration_link_unique).encode(), "text/plain"), + ) + ) + + if not isinstance(self.description_header_image, Unset): + if isinstance(self.description_header_image, int): + files.append( + ("description_header_image", (None, str(self.description_header_image).encode(), "text/plain")) + ) + else: + files.append( + ("description_header_image", (None, str(self.description_header_image).encode(), "text/plain")) + ) + + if not isinstance(self.terms_of_service, Unset): + files.append(("terms_of_service", (None, str(self.terms_of_service).encode(), "text/plain"))) + + if not isinstance(self.location_text, Unset): + files.append(("location_text", (None, str(self.location_text).encode(), "text/plain"))) + + if not isinstance(self.location, Unset): + if isinstance(self.location, str): + files.append(("location", (None, str(self.location).encode(), "text/plain"))) + else: + files.append(("location", (None, str(self.location).encode(), "text/plain"))) + + if not isinstance(self.is_public_visible, Unset): + files.append(("is_public_visible", (None, str(self.is_public_visible).encode(), "text/plain"))) + + if not isinstance(self.is_unit_visible, Unset): + files.append(("is_unit_visible", (None, str(self.is_unit_visible).encode(), "text/plain"))) + + if not isinstance(self.is_basket_item_modification_allowed, Unset): + files.append( + ( + "is_basket_item_modification_allowed", + (None, str(self.is_basket_item_modification_allowed).encode(), "text/plain"), + ) + ) + + if not isinstance(self.is_in_lausanne, Unset): + files.append(("is_in_lausanne", (None, str(self.is_in_lausanne).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + unit_id = d.pop("unit_id") + + name = d.pop("name") + + moderation_status = ModerationStatusEnum(d.pop("moderation_status")) + + are_registrations_allowed = d.pop("are_registrations_allowed") + + are_payments_allowed = d.pop("are_payments_allowed") + + frontend_title = d.pop("frontend_title") + + frontend_path = d.pop("frontend_path") + + location_address = d.pop("location_address") + + ticket_office_url = d.pop("ticket_office_url") + + ticket_office_testing_url = d.pop("ticket_office_testing_url") + + is_status_public = d.pop("is_status_public") + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusEnum] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusEnum(_status) + + def _parse_registrations_start_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + registrations_start_date_type_0 = isoparse(data) + + return registrations_start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + registrations_start_date = _parse_registrations_start_date(d.pop("registrations_start_date", UNSET)) + + def _parse_payments_start_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + payments_start_date_type_0 = isoparse(data) + + return payments_start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + payments_start_date = _parse_payments_start_date(d.pop("payments_start_date", UNSET)) + + def _parse_payments_end_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + payments_end_date_type_0 = isoparse(data) + + return payments_end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + payments_end_date = _parse_payments_end_date(d.pop("payments_end_date", UNSET)) + + def _parse_closed_start_date(data: object) -> Union[None, Unset, datetime.date]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + closed_start_date_type_0 = isoparse(data).date() + + return closed_start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.date], data) + + closed_start_date = _parse_closed_start_date(d.pop("closed_start_date", UNSET)) + + def _parse_registrations_end_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + registrations_end_date_type_0 = isoparse(data) + + return registrations_end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + registrations_end_date = _parse_registrations_end_date(d.pop("registrations_end_date", UNSET)) + + def _parse_start_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + start_date_type_0 = isoparse(data) + + return start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + start_date = _parse_start_date(d.pop("start_date", UNSET)) + + def _parse_end_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + end_date_type_0 = isoparse(data) + + return end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + end_date = _parse_end_date(d.pop("end_date", UNSET)) + + custom_key = d.pop("custom_key", UNSET) + + welcome_text = d.pop("welcome_text", UNSET) + + frontend_url = d.pop("frontend_url", UNSET) + + frontend_organizers = d.pop("frontend_organizers", UNSET) + + multiple_registration_per_login = d.pop("multiple_registration_per_login", UNSET) + + user_nickname_enabled = d.pop("user_nickname_enabled", UNSET) + + user_registration_link_unique = d.pop("user_registration_link_unique", UNSET) + + def _parse_description_header_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + description_header_image = _parse_description_header_image(d.pop("description_header_image", UNSET)) + + terms_of_service = d.pop("terms_of_service", UNSET) + + location_text = d.pop("location_text", UNSET) + + def _parse_location(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + location = _parse_location(d.pop("location", UNSET)) + + is_public_visible = d.pop("is_public_visible", UNSET) + + is_unit_visible = d.pop("is_unit_visible", UNSET) + + is_basket_item_modification_allowed = d.pop("is_basket_item_modification_allowed", UNSET) + + is_in_lausanne = d.pop("is_in_lausanne", UNSET) + + event = cls( + id=id, + unit_id=unit_id, + name=name, + moderation_status=moderation_status, + are_registrations_allowed=are_registrations_allowed, + are_payments_allowed=are_payments_allowed, + frontend_title=frontend_title, + frontend_path=frontend_path, + location_address=location_address, + ticket_office_url=ticket_office_url, + ticket_office_testing_url=ticket_office_testing_url, + is_status_public=is_status_public, + status=status, + registrations_start_date=registrations_start_date, + payments_start_date=payments_start_date, + payments_end_date=payments_end_date, + closed_start_date=closed_start_date, + registrations_end_date=registrations_end_date, + start_date=start_date, + end_date=end_date, + custom_key=custom_key, + welcome_text=welcome_text, + frontend_url=frontend_url, + frontend_organizers=frontend_organizers, + multiple_registration_per_login=multiple_registration_per_login, + user_nickname_enabled=user_nickname_enabled, + user_registration_link_unique=user_registration_link_unique, + description_header_image=description_header_image, + terms_of_service=terms_of_service, + location_text=location_text, + location=location, + is_public_visible=is_public_visible, + is_unit_visible=is_unit_visible, + is_basket_item_modification_allowed=is_basket_item_modification_allowed, + is_in_lausanne=is_in_lausanne, + ) + + event.additional_properties = d + return event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_moderation.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_moderation.py new file mode 100644 index 0000000..ba65146 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_moderation.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EventModeration") + + +@_attrs_define +class EventModeration: + """Write only serializer, used by admin to validate an event. + + Attributes: + is_valid (bool): Whether the event is deemed valid by an admin. + required_changes (Union[Unset, str]): Short description of what the user should modify on his event, so we can + publish it. + """ + + is_valid: bool + required_changes: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + is_valid = self.is_valid + + required_changes = self.required_changes + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "is_valid": is_valid, + } + ) + if required_changes is not UNSET: + field_dict["required_changes"] = required_changes + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("is_valid", (None, str(self.is_valid).encode(), "text/plain"))) + + if not isinstance(self.required_changes, Unset): + files.append(("required_changes", (None, str(self.required_changes).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_valid = d.pop("is_valid") + + required_changes = d.pop("required_changes", UNSET) + + event_moderation = cls( + is_valid=is_valid, + required_changes=required_changes, + ) + + event_moderation.additional_properties = d + return event_moderation + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_public_infos.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_public_infos.py new file mode 100644 index 0000000..f9ccbe6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_public_infos.py @@ -0,0 +1,221 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="EventPublicInfos") + + +@_attrs_define +class EventPublicInfos: + """Serializer for the public infos endpoint + + Attributes: + id (int): + are_registrations_allowed (bool): + are_payments_allowed (bool): + welcome_text (str): Welcome text displayed on the Ticket Office event page + frontend_url (str): External url provided by the organizer. I.e. their website or social media page + frontend_title (str): Main name of the event shown to end users. I.e. shown on the Ticket Office webpage + frontend_organizers (str): Name of the organizer, displayed on the Ticket Office event page + description_header_image (Union[None, int]): + start_date (Union[None, datetime.datetime]): + end_date (Union[None, datetime.datetime]): + location_text (str): + location (Union[None, str]): + location_address (str): + is_basket_item_modification_allowed (bool): This field informs the front end on what actions should be allowed + or prevented, in the front end only. + is_status_public (bool): + """ + + id: int + are_registrations_allowed: bool + are_payments_allowed: bool + welcome_text: str + frontend_url: str + frontend_title: str + frontend_organizers: str + description_header_image: Union[None, int] + start_date: Union[None, datetime.datetime] + end_date: Union[None, datetime.datetime] + location_text: str + location: Union[None, str] + location_address: str + is_basket_item_modification_allowed: bool + is_status_public: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + are_registrations_allowed = self.are_registrations_allowed + + are_payments_allowed = self.are_payments_allowed + + welcome_text = self.welcome_text + + frontend_url = self.frontend_url + + frontend_title = self.frontend_title + + frontend_organizers = self.frontend_organizers + + description_header_image: Union[None, int] + description_header_image = self.description_header_image + + start_date: Union[None, str] + if isinstance(self.start_date, datetime.datetime): + start_date = self.start_date.isoformat() + else: + start_date = self.start_date + + end_date: Union[None, str] + if isinstance(self.end_date, datetime.datetime): + end_date = self.end_date.isoformat() + else: + end_date = self.end_date + + location_text = self.location_text + + location: Union[None, str] + location = self.location + + location_address = self.location_address + + is_basket_item_modification_allowed = self.is_basket_item_modification_allowed + + is_status_public = self.is_status_public + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "are_registrations_allowed": are_registrations_allowed, + "are_payments_allowed": are_payments_allowed, + "welcome_text": welcome_text, + "frontend_url": frontend_url, + "frontend_title": frontend_title, + "frontend_organizers": frontend_organizers, + "description_header_image": description_header_image, + "start_date": start_date, + "end_date": end_date, + "location_text": location_text, + "location": location, + "location_address": location_address, + "is_basket_item_modification_allowed": is_basket_item_modification_allowed, + "is_status_public": is_status_public, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + are_registrations_allowed = d.pop("are_registrations_allowed") + + are_payments_allowed = d.pop("are_payments_allowed") + + welcome_text = d.pop("welcome_text") + + frontend_url = d.pop("frontend_url") + + frontend_title = d.pop("frontend_title") + + frontend_organizers = d.pop("frontend_organizers") + + def _parse_description_header_image(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + description_header_image = _parse_description_header_image(d.pop("description_header_image")) + + def _parse_start_date(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + start_date_type_0 = isoparse(data) + + return start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + start_date = _parse_start_date(d.pop("start_date")) + + def _parse_end_date(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + end_date_type_0 = isoparse(data) + + return end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + end_date = _parse_end_date(d.pop("end_date")) + + location_text = d.pop("location_text") + + def _parse_location(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + location = _parse_location(d.pop("location")) + + location_address = d.pop("location_address") + + is_basket_item_modification_allowed = d.pop("is_basket_item_modification_allowed") + + is_status_public = d.pop("is_status_public") + + event_public_infos = cls( + id=id, + are_registrations_allowed=are_registrations_allowed, + are_payments_allowed=are_payments_allowed, + welcome_text=welcome_text, + frontend_url=frontend_url, + frontend_title=frontend_title, + frontend_organizers=frontend_organizers, + description_header_image=description_header_image, + start_date=start_date, + end_date=end_date, + location_text=location_text, + location=location, + location_address=location_address, + is_basket_item_modification_allowed=is_basket_item_modification_allowed, + is_status_public=is_status_public, + ) + + event_public_infos.additional_properties = d + return event_public_infos + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics.py new file mode 100644 index 0000000..89a120a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics.py @@ -0,0 +1,108 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.event_statistics_invoices_refunded import EventStatisticsInvoicesRefunded + from ..models.event_statistics_invoices_refunded_value import EventStatisticsInvoicesRefundedValue + from ..models.event_statistics_invoices_resolved import EventStatisticsInvoicesResolved + from ..models.event_statistics_invoices_resolved_value import EventStatisticsInvoicesResolvedValue + + +T = TypeVar("T", bound="EventStatistics") + + +@_attrs_define +class EventStatistics: + """Serializer for the action event-statistics used to display the dashboard of an event + + Attributes: + invoices_resolved (EventStatisticsInvoicesResolved): associate the number of invoices resolved (INCLUDING the + refunded ones) per timestamps + invoices_resolved_value (EventStatisticsInvoicesResolvedValue): associate the value of the total amount from the + invoices resolved (INCLUDING the refunded ones) per timestamps + invoices_refunded (EventStatisticsInvoicesRefunded): associate the number of invoices refunded (only those FULLY + refunded) per timestamps + invoices_refunded_value (EventStatisticsInvoicesRefundedValue): associate the value of the total amount from + invoices refunded (= invoices with negative amounts) per timestamps + invoices_in_progress (int): the count of invoices that are still in progress + """ + + invoices_resolved: "EventStatisticsInvoicesResolved" + invoices_resolved_value: "EventStatisticsInvoicesResolvedValue" + invoices_refunded: "EventStatisticsInvoicesRefunded" + invoices_refunded_value: "EventStatisticsInvoicesRefundedValue" + invoices_in_progress: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + invoices_resolved = self.invoices_resolved.to_dict() + + invoices_resolved_value = self.invoices_resolved_value.to_dict() + + invoices_refunded = self.invoices_refunded.to_dict() + + invoices_refunded_value = self.invoices_refunded_value.to_dict() + + invoices_in_progress = self.invoices_in_progress + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "invoices_resolved": invoices_resolved, + "invoices_resolved_value": invoices_resolved_value, + "invoices_refunded": invoices_refunded, + "invoices_refunded_value": invoices_refunded_value, + "invoices_in_progress": invoices_in_progress, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event_statistics_invoices_refunded import EventStatisticsInvoicesRefunded + from ..models.event_statistics_invoices_refunded_value import EventStatisticsInvoicesRefundedValue + from ..models.event_statistics_invoices_resolved import EventStatisticsInvoicesResolved + from ..models.event_statistics_invoices_resolved_value import EventStatisticsInvoicesResolvedValue + + d = dict(src_dict) + invoices_resolved = EventStatisticsInvoicesResolved.from_dict(d.pop("invoices_resolved")) + + invoices_resolved_value = EventStatisticsInvoicesResolvedValue.from_dict(d.pop("invoices_resolved_value")) + + invoices_refunded = EventStatisticsInvoicesRefunded.from_dict(d.pop("invoices_refunded")) + + invoices_refunded_value = EventStatisticsInvoicesRefundedValue.from_dict(d.pop("invoices_refunded_value")) + + invoices_in_progress = d.pop("invoices_in_progress") + + event_statistics = cls( + invoices_resolved=invoices_resolved, + invoices_resolved_value=invoices_resolved_value, + invoices_refunded=invoices_refunded, + invoices_refunded_value=invoices_refunded_value, + invoices_in_progress=invoices_in_progress, + ) + + event_statistics.additional_properties = d + return event_statistics + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded.py new file mode 100644 index 0000000..8f5b203 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EventStatisticsInvoicesRefunded") + + +@_attrs_define +class EventStatisticsInvoicesRefunded: + """associate the number of invoices refunded (only those FULLY refunded) per timestamps""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_statistics_invoices_refunded = cls() + + event_statistics_invoices_refunded.additional_properties = d + return event_statistics_invoices_refunded + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded_value.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded_value.py new file mode 100644 index 0000000..f8e120a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_refunded_value.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EventStatisticsInvoicesRefundedValue") + + +@_attrs_define +class EventStatisticsInvoicesRefundedValue: + """associate the value of the total amount from invoices refunded (= invoices with negative amounts) per timestamps""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_statistics_invoices_refunded_value = cls() + + event_statistics_invoices_refunded_value.additional_properties = d + return event_statistics_invoices_refunded_value + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved.py new file mode 100644 index 0000000..188bff7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EventStatisticsInvoicesResolved") + + +@_attrs_define +class EventStatisticsInvoicesResolved: + """associate the number of invoices resolved (INCLUDING the refunded ones) per timestamps""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_statistics_invoices_resolved = cls() + + event_statistics_invoices_resolved.additional_properties = d + return event_statistics_invoices_resolved + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved_value.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved_value.py new file mode 100644 index 0000000..0697baf --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_statistics_invoices_resolved_value.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EventStatisticsInvoicesResolvedValue") + + +@_attrs_define +class EventStatisticsInvoicesResolvedValue: + """associate the value of the total amount from the invoices resolved (INCLUDING the refunded ones) per timestamps""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_statistics_invoices_resolved_value = cls() + + event_statistics_invoices_resolved_value.additional_properties = d + return event_statistics_invoices_resolved_value + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/event_status_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/event_status_enum.py new file mode 100644 index 0000000..31960e2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/event_status_enum.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class EventStatusEnum(str, Enum): + ARCHIVED = "archived" + CLOSED = "closed" + DRAFT = "draft" + PUBLIC = "public" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_export_create_file_type.py b/poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_export_create_file_type.py new file mode 100644 index 0000000..48677d5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_export_create_file_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class EventsEventsActionsExportCreateFileType(str, Enum): + CSV = "csv" + XLSX = "xlsx" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_statistics_retrieve_granularity.py b/poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_statistics_retrieve_granularity.py new file mode 100644 index 0000000..37f1f89 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/events_events_actions_statistics_retrieve_granularity.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class EventsEventsActionsStatisticsRetrieveGranularity(str, Enum): + DAY = "day" + FIVE_MINUTE = "five_minute" + HOUR = "hour" + TIMESTAMP = "timestamp" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/frontend_basket.py b/poly-ticket-api-client/poly_ticket_api_client/models/frontend_basket.py new file mode 100644 index 0000000..804a98f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/frontend_basket.py @@ -0,0 +1,200 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FrontendBasket") + + +@_attrs_define +class FrontendBasket: + """ + Attributes: + id (int): + event (int): + testing (bool): + created_by_id (int): The id of the frontendlogin that created the basket. + total (str): + total_display (str): + invoices (list[int]): + unikey (str): Return a unique and checksummed-ish key + status (str): + registrations_count (int): The number of root Selected Nodes linked to this basket. + invoices_total (float): Invoices total amount. + invoices_total_exceeds_basket_total (bool): Whether the invoices total amount exceeds the basket total. + billing_information_id (Union[Unset, int]): The id of the billing information linked to the basket. + """ + + id: int + event: int + testing: bool + created_by_id: int + total: str + total_display: str + invoices: list[int] + unikey: str + status: str + registrations_count: int + invoices_total: float + invoices_total_exceeds_basket_total: bool + billing_information_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + testing = self.testing + + created_by_id = self.created_by_id + + total = self.total + + total_display = self.total_display + + invoices = self.invoices + + unikey = self.unikey + + status = self.status + + registrations_count = self.registrations_count + + invoices_total = self.invoices_total + + invoices_total_exceeds_basket_total = self.invoices_total_exceeds_basket_total + + billing_information_id = self.billing_information_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "testing": testing, + "created_by_id": created_by_id, + "total": total, + "total_display": total_display, + "invoices": invoices, + "unikey": unikey, + "status": status, + "registrations_count": registrations_count, + "invoices_total": invoices_total, + "invoices_total_exceeds_basket_total": invoices_total_exceeds_basket_total, + } + ) + if billing_information_id is not UNSET: + field_dict["billing_information_id"] = billing_information_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("testing", (None, str(self.testing).encode(), "text/plain"))) + + files.append(("created_by_id", (None, str(self.created_by_id).encode(), "text/plain"))) + + files.append(("total", (None, str(self.total).encode(), "text/plain"))) + + files.append(("total_display", (None, str(self.total_display).encode(), "text/plain"))) + + for invoices_item_element in self.invoices: + files.append(("invoices", (None, str(invoices_item_element).encode(), "text/plain"))) + + files.append(("unikey", (None, str(self.unikey).encode(), "text/plain"))) + + files.append(("status", (None, str(self.status).encode(), "text/plain"))) + + files.append(("registrations_count", (None, str(self.registrations_count).encode(), "text/plain"))) + + files.append(("invoices_total", (None, str(self.invoices_total).encode(), "text/plain"))) + + files.append( + ( + "invoices_total_exceeds_basket_total", + (None, str(self.invoices_total_exceeds_basket_total).encode(), "text/plain"), + ) + ) + + if not isinstance(self.billing_information_id, Unset): + files.append(("billing_information_id", (None, str(self.billing_information_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + testing = d.pop("testing") + + created_by_id = d.pop("created_by_id") + + total = d.pop("total") + + total_display = d.pop("total_display") + + invoices = cast(list[int], d.pop("invoices")) + + unikey = d.pop("unikey") + + status = d.pop("status") + + registrations_count = d.pop("registrations_count") + + invoices_total = d.pop("invoices_total") + + invoices_total_exceeds_basket_total = d.pop("invoices_total_exceeds_basket_total") + + billing_information_id = d.pop("billing_information_id", UNSET) + + frontend_basket = cls( + id=id, + event=event, + testing=testing, + created_by_id=created_by_id, + total=total, + total_display=total_display, + invoices=invoices, + unikey=unikey, + status=status, + registrations_count=registrations_count, + invoices_total=invoices_total, + invoices_total_exceeds_basket_total=invoices_total_exceeds_basket_total, + billing_information_id=billing_information_id, + ) + + frontend_basket.additional_properties = d + return frontend_basket + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/frontend_login.py b/poly-ticket-api-client/poly_ticket_api_client/models/frontend_login.py new file mode 100644 index 0000000..efd4fec --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/frontend_login.py @@ -0,0 +1,120 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FrontendLogin") + + +@_attrs_define +class FrontendLogin: + """Serializer for FrontendLogin + + Attributes: + id (int): + event (int): + testing (bool): + email (Union[None, str]): + username (str): + user (Union[None, int]): + display (str): + """ + + id: int + event: int + testing: bool + email: Union[None, str] + username: str + user: Union[None, int] + display: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + testing = self.testing + + email: Union[None, str] + email = self.email + + username = self.username + + user: Union[None, int] + user = self.user + + display = self.display + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "testing": testing, + "email": email, + "username": username, + "user": user, + "display": display, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + testing = d.pop("testing") + + def _parse_email(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + email = _parse_email(d.pop("email")) + + username = d.pop("username") + + def _parse_user(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + user = _parse_user(d.pop("user")) + + display = d.pop("display") + + frontend_login = cls( + id=id, + event=event, + testing=testing, + email=email, + username=username, + user=user, + display=display, + ) + + frontend_login.additional_properties = d + return frontend_login + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/invoice.py b/poly-ticket-api-client/poly_ticket_api_client/models/invoice.py new file mode 100644 index 0000000..6cf7f47 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/invoice.py @@ -0,0 +1,141 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="Invoice") + + +@_attrs_define +class Invoice: + """Serializer for `Invoice` model + + Attributes: + id (int): + amount (str): + due_date (Union[None, datetime.datetime]): + created_at (datetime.datetime): + basket (Union[None, int]): + is_cancelled (bool): + related_invoices (list[int]): + is_resolved (bool): + """ + + id: int + amount: str + due_date: Union[None, datetime.datetime] + created_at: datetime.datetime + basket: Union[None, int] + is_cancelled: bool + related_invoices: list[int] + is_resolved: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + amount = self.amount + + due_date: Union[None, str] + if isinstance(self.due_date, datetime.datetime): + due_date = self.due_date.isoformat() + else: + due_date = self.due_date + + created_at = self.created_at.isoformat() + + basket: Union[None, int] + basket = self.basket + + is_cancelled = self.is_cancelled + + related_invoices = self.related_invoices + + is_resolved = self.is_resolved + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "amount": amount, + "due_date": due_date, + "created_at": created_at, + "basket": basket, + "is_cancelled": is_cancelled, + "related_invoices": related_invoices, + "is_resolved": is_resolved, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + amount = d.pop("amount") + + def _parse_due_date(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + due_date_type_0 = isoparse(data) + + return due_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + due_date = _parse_due_date(d.pop("due_date")) + + created_at = isoparse(d.pop("created_at")) + + def _parse_basket(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + basket = _parse_basket(d.pop("basket")) + + is_cancelled = d.pop("is_cancelled") + + related_invoices = cast(list[int], d.pop("related_invoices")) + + is_resolved = d.pop("is_resolved") + + invoice = cls( + id=id, + amount=amount, + due_date=due_date, + created_at=created_at, + basket=basket, + is_cancelled=is_cancelled, + related_invoices=related_invoices, + is_resolved=is_resolved, + ) + + invoice.additional_properties = d + return invoice + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/left_hand_operand_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/left_hand_operand_enum.py new file mode 100644 index 0000000..a2f947a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/left_hand_operand_enum.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class LeftHandOperandEnum(str, Enum): + LOGIN = "login" + NODE = "node" + PROMOTION_CODE = "promotion_code" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/logical_operator_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/logical_operator_enum.py new file mode 100644 index 0000000..79a9d41 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/logical_operator_enum.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class LogicalOperatorEnum(str, Enum): + AND = "and" + OR = "or" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/login.py b/poly-ticket-api-client/poly_ticket_api_client/models/login.py new file mode 100644 index 0000000..3b04ec1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/login.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="Login") + + +@_attrs_define +class Login: + """Serializer used only for PolyTicketUser login. + + Attributes: + email (str): The email associated with your account + password (str): The password associated with your account + """ + + email: str + password: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + email = self.email + + password = self.password + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "email": email, + "password": password, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + files.append(("password", (None, str(self.password).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + password = d.pop("password") + + login = cls( + email=email, + password=password, + ) + + login.additional_properties = d + return login + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/login_jwt.py b/poly-ticket-api-client/poly_ticket_api_client/models/login_jwt.py new file mode 100644 index 0000000..8c95515 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/login_jwt.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LoginJWT") + + +@_attrs_define +class LoginJWT: + """Serializer used to return the login access token. + + Attributes: + jwt (str): The login JWT access token + """ + + jwt: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + jwt = self.jwt + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "jwt": jwt, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + jwt = d.pop("jwt") + + login_jwt = cls( + jwt=jwt, + ) + + login_jwt.additional_properties = d + return login_jwt + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/login_method.py b/poly-ticket-api-client/poly_ticket_api_client/models/login_method.py new file mode 100644 index 0000000..fa3b26b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/login_method.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LoginMethod") + + +@_attrs_define +class LoginMethod: + """A serializer returning info for a login method + + Attributes: + active_module_id (int): The id of the login method's active module + key (str): + name (str): Title of the login method + description (str): Description of the login method + """ + + active_module_id: int + key: str + name: str + description: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_module_id = self.active_module_id + + key = self.key + + name = self.name + + description = self.description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_module_id": active_module_id, + "key": key, + "name": name, + "description": description, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_module_id = d.pop("active_module_id") + + key = d.pop("key") + + name = d.pop("name") + + description = d.pop("description") + + login_method = cls( + active_module_id=active_module_id, + key=key, + name=name, + description=description, + ) + + login_method.additional_properties = d + return login_method + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/login_result.py b/poly-ticket-api-client/poly_ticket_api_client/models/login_result.py new file mode 100644 index 0000000..70374b8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/login_result.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LoginResult") + + +@_attrs_define +class LoginResult: + """Serializer used only to return the token after a user login. + + Attributes: + token (str): A JWT to be used in Bearer authentication in further requests. + """ + + token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + token = self.token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "token": token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + token = d.pop("token") + + login_result = cls( + token=token, + ) + + login_result.additional_properties = d + return login_result + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/mode_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/mode_enum.py new file mode 100644 index 0000000..d4a9154 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/mode_enum.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class ModeEnum(str, Enum): + DIVIDE = "divide" + MULTIPLY = "multiply" + PLUS = "plus" + PLUS_PERCENT = "plus_percent" + SET = "set" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/model_form_line_type.py b/poly-ticket-api-client/poly_ticket_api_client/models/model_form_line_type.py new file mode 100644 index 0000000..642ae37 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/model_form_line_type.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class ModelFormLineType(str, Enum): + BOOLEAN = "boolean" + CHOICE = "choice" + COUNTRY = "country" + DATE = "date" + DATETIME = "datetime" + DATE_MAJOR = "date_major" + EMAIL = "email" + FILE = "file" + NUMERICAL = "numerical" + PHONE = "phone" + TEXT = "text" + TEXTAREA = "textarea" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/moderation_status_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/moderation_status_enum.py new file mode 100644 index 0000000..7c6b754 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/moderation_status_enum.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class ModerationStatusEnum(str, Enum): + CHANGE_REQUESTED = "change_requested" + NOT_REQUESTED = "not_requested" + REQUESTED = "requested" + VALIDATED = "validated" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_active_module.py new file mode 100644 index 0000000..32ed07e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_anonymous_login_configuration import ModuleAuthAnonymousLoginConfiguration + + +T = TypeVar("T", bound="ModuleAuthAnonymousLoginActiveModule") + + +@_attrs_define +class ModuleAuthAnonymousLoginActiveModule: + """Serializer for `ActiveModule` linked to `ModuleAuthAnonymousLogin` + + Attributes: + id (int): + event (int): + config (ModuleAuthAnonymousLoginConfiguration): Serializer for `ModuleAuthAnonymousLoginConfiguration` nested in + `ModuleAuthAnonymousLoginActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleAuthAnonymousLoginConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_anonymous_login_configuration import ModuleAuthAnonymousLoginConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleAuthAnonymousLoginConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_auth_anonymous_login_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_auth_anonymous_login_active_module.additional_properties = d + return module_auth_anonymous_login_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_configuration.py new file mode 100644 index 0000000..3863c9d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_anonymous_login_configuration.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModuleAuthAnonymousLoginConfiguration") + + +@_attrs_define +class ModuleAuthAnonymousLoginConfiguration: + """Serializer for `ModuleAuthAnonymousLoginConfiguration` nested in `ModuleAuthAnonymousLoginActiveModuleSerializer` + + Attributes: + id (int): + """ + + id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + module_auth_anonymous_login_configuration = cls( + id=id, + ) + + module_auth_anonymous_login_configuration.additional_properties = d + return module_auth_anonymous_login_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_active_module.py new file mode 100644 index 0000000..f0ede93 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_active_module.py @@ -0,0 +1,115 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_third_party_token_login_configuration import ModuleAuthThirdPartyTokenLoginConfiguration + + +T = TypeVar("T", bound="ModuleAuthThirdPartyTokenLoginActiveModule") + + +@_attrs_define +class ModuleAuthThirdPartyTokenLoginActiveModule: + """Serializer for `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin` + + Attributes: + id (int): + event (int): + config (ModuleAuthThirdPartyTokenLoginConfiguration): Serializer for + `ModuleAuthThirdPartyTokenLoginConfiguration` nested in `ModuleAuthThirdPartyTokenLoginActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleAuthThirdPartyTokenLoginConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_third_party_token_login_configuration import ( + ModuleAuthThirdPartyTokenLoginConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleAuthThirdPartyTokenLoginConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_auth_third_party_token_login_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_auth_third_party_token_login_active_module.additional_properties = d + return module_auth_third_party_token_login_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_configuration.py new file mode 100644 index 0000000..fe6ce0d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_third_party_token_login_configuration.py @@ -0,0 +1,69 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModuleAuthThirdPartyTokenLoginConfiguration") + + +@_attrs_define +class ModuleAuthThirdPartyTokenLoginConfiguration: + """Serializer for `ModuleAuthThirdPartyTokenLoginConfiguration` nested in + `ModuleAuthThirdPartyTokenLoginActiveModuleSerializer` + + Attributes: + id (int): + jwt_secret_key (str): Secret key for the JWT token (any string). + """ + + id: int + jwt_secret_key: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + jwt_secret_key = self.jwt_secret_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "jwt_secret_key": jwt_secret_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + jwt_secret_key = d.pop("jwt_secret_key") + + module_auth_third_party_token_login_configuration = cls( + id=id, + jwt_secret_key=jwt_secret_key, + ) + + module_auth_third_party_token_login_configuration.additional_properties = d + return module_auth_third_party_token_login_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_active_module.py new file mode 100644 index 0000000..a23cd2c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_trusted_email_configuration import ModuleAuthTrustedEmailConfiguration + + +T = TypeVar("T", bound="ModuleAuthTrustedEmailActiveModule") + + +@_attrs_define +class ModuleAuthTrustedEmailActiveModule: + """Serializer for `ActiveModule` linked to `ModuleAuthTrustedEmail` + + Attributes: + id (int): + event (int): + config (ModuleAuthTrustedEmailConfiguration): Serializer for `ModuleAuthTrustedEmailConfiguration` nested in + `ModuleAuthTrustedEmailActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleAuthTrustedEmailConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_trusted_email_configuration import ModuleAuthTrustedEmailConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleAuthTrustedEmailConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_auth_trusted_email_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_auth_trusted_email_active_module.additional_properties = d + return module_auth_trusted_email_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_configuration.py new file mode 100644 index 0000000..5164fdb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_auth_trusted_email_configuration.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModuleAuthTrustedEmailConfiguration") + + +@_attrs_define +class ModuleAuthTrustedEmailConfiguration: + """Serializer for `ModuleAuthTrustedEmailConfiguration` nested in `ModuleAuthTrustedEmailActiveModuleSerializer` + + Attributes: + id (int): + """ + + id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + module_auth_trusted_email_configuration = cls( + id=id, + ) + + module_auth_trusted_email_configuration.additional_properties = d + return module_auth_trusted_email_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_active_module.py new file mode 100644 index 0000000..c10d8f2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_active_module.py @@ -0,0 +1,118 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_email_registration_completed_configuration import ( + ModuleCompletionEmailRegistrationCompletedConfiguration, + ) + + +T = TypeVar("T", bound="ModuleCompletionEmailRegistrationCompletedActiveModule") + + +@_attrs_define +class ModuleCompletionEmailRegistrationCompletedActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Attributes: + id (int): + event (int): + config (ModuleCompletionEmailRegistrationCompletedConfiguration): Serializer for + `ModuleCompletionEmailRegistrationCompletedConfiguration` nested in + `ModuleCompletionEmailRegistrationCompletedActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleCompletionEmailRegistrationCompletedConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_email_registration_completed_configuration import ( + ModuleCompletionEmailRegistrationCompletedConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleCompletionEmailRegistrationCompletedConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_completion_email_registration_completed_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_completion_email_registration_completed_active_module.additional_properties = d + return module_completion_email_registration_completed_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_configuration.py new file mode 100644 index 0000000..04df26c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_completed_configuration.py @@ -0,0 +1,158 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModuleCompletionEmailRegistrationCompletedConfiguration") + + +@_attrs_define +class ModuleCompletionEmailRegistrationCompletedConfiguration: + """Serializer for `ModuleCompletionEmailRegistrationCompletedConfiguration` nested in + `ModuleCompletionEmailRegistrationCompletedActiveModuleSerializer` + + Attributes: + id (int): + ticket_content (Union[Unset, str]): + event_details_dates (Union[Unset, str]): + event_details_location_text (Union[Unset, str]): + event_details_location_image (Union[None, Unset, str]): + text (Union[Unset, str]): custom text to be displayed on the confirmation email. Some restricted HTML markup is + allowed, everything else is filtered out automatically. + image (Union[None, Unset, int]): The image used for the module + is_text_used (Union[Unset, bool]): + is_image_used (Union[Unset, bool]): + """ + + id: int + ticket_content: Union[Unset, str] = UNSET + event_details_dates: Union[Unset, str] = UNSET + event_details_location_text: Union[Unset, str] = UNSET + event_details_location_image: Union[None, Unset, str] = UNSET + text: Union[Unset, str] = UNSET + image: Union[None, Unset, int] = UNSET + is_text_used: Union[Unset, bool] = UNSET + is_image_used: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + ticket_content = self.ticket_content + + event_details_dates = self.event_details_dates + + event_details_location_text = self.event_details_location_text + + event_details_location_image: Union[None, Unset, str] + if isinstance(self.event_details_location_image, Unset): + event_details_location_image = UNSET + else: + event_details_location_image = self.event_details_location_image + + text = self.text + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + is_text_used = self.is_text_used + + is_image_used = self.is_image_used + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if ticket_content is not UNSET: + field_dict["ticket_content"] = ticket_content + if event_details_dates is not UNSET: + field_dict["event_details_dates"] = event_details_dates + if event_details_location_text is not UNSET: + field_dict["event_details_location_text"] = event_details_location_text + if event_details_location_image is not UNSET: + field_dict["event_details_location_image"] = event_details_location_image + if text is not UNSET: + field_dict["text"] = text + if image is not UNSET: + field_dict["image"] = image + if is_text_used is not UNSET: + field_dict["is_text_used"] = is_text_used + if is_image_used is not UNSET: + field_dict["is_image_used"] = is_image_used + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + ticket_content = d.pop("ticket_content", UNSET) + + event_details_dates = d.pop("event_details_dates", UNSET) + + event_details_location_text = d.pop("event_details_location_text", UNSET) + + def _parse_event_details_location_image(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + event_details_location_image = _parse_event_details_location_image(d.pop("event_details_location_image", UNSET)) + + text = d.pop("text", UNSET) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + is_text_used = d.pop("is_text_used", UNSET) + + is_image_used = d.pop("is_image_used", UNSET) + + module_completion_email_registration_completed_configuration = cls( + id=id, + ticket_content=ticket_content, + event_details_dates=event_details_dates, + event_details_location_text=event_details_location_text, + event_details_location_image=event_details_location_image, + text=text, + image=image, + is_text_used=is_text_used, + is_image_used=is_image_used, + ) + + module_completion_email_registration_completed_configuration.additional_properties = d + return module_completion_email_registration_completed_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_active_module.py new file mode 100644 index 0000000..98643c3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_active_module.py @@ -0,0 +1,118 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_email_registration_creation_configuration import ( + ModuleCompletionEmailRegistrationCreationConfiguration, + ) + + +T = TypeVar("T", bound="ModuleCompletionEmailRegistrationCreationActiveModule") + + +@_attrs_define +class ModuleCompletionEmailRegistrationCreationActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Attributes: + id (int): + event (int): + config (ModuleCompletionEmailRegistrationCreationConfiguration): Serializer for + `ModuleCompletionEmailRegistrationCreationConfiguration` nested in + `ModuleCompletionEmailRegistrationCreationActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleCompletionEmailRegistrationCreationConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_email_registration_creation_configuration import ( + ModuleCompletionEmailRegistrationCreationConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleCompletionEmailRegistrationCreationConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_completion_email_registration_creation_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_completion_email_registration_creation_active_module.additional_properties = d + return module_completion_email_registration_creation_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_configuration.py new file mode 100644 index 0000000..54afc34 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_email_registration_creation_configuration.py @@ -0,0 +1,129 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModuleCompletionEmailRegistrationCreationConfiguration") + + +@_attrs_define +class ModuleCompletionEmailRegistrationCreationConfiguration: + """Serializer for `ModuleCompletionEmailRegistrationCreationConfiguration` nested in + `ModuleCompletionEmailRegistrationCreationActiveModuleSerializer` + + Attributes: + id (int): + delay (Union[Unset, int]): delay time in minutes + is_disabled_if_paid (Union[Unset, bool]): + text (Union[Unset, str]): custom text to be displayed on the reminder email. Some restricted HTML markup is + allowed, everything else is filtered out automatically. + image (Union[None, Unset, int]): The image used for the module + is_text_used (Union[Unset, bool]): + is_image_used (Union[Unset, bool]): + """ + + id: int + delay: Union[Unset, int] = UNSET + is_disabled_if_paid: Union[Unset, bool] = UNSET + text: Union[Unset, str] = UNSET + image: Union[None, Unset, int] = UNSET + is_text_used: Union[Unset, bool] = UNSET + is_image_used: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + delay = self.delay + + is_disabled_if_paid = self.is_disabled_if_paid + + text = self.text + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + is_text_used = self.is_text_used + + is_image_used = self.is_image_used + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if delay is not UNSET: + field_dict["delay"] = delay + if is_disabled_if_paid is not UNSET: + field_dict["is_disabled_if_paid"] = is_disabled_if_paid + if text is not UNSET: + field_dict["text"] = text + if image is not UNSET: + field_dict["image"] = image + if is_text_used is not UNSET: + field_dict["is_text_used"] = is_text_used + if is_image_used is not UNSET: + field_dict["is_image_used"] = is_image_used + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + delay = d.pop("delay", UNSET) + + is_disabled_if_paid = d.pop("is_disabled_if_paid", UNSET) + + text = d.pop("text", UNSET) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + is_text_used = d.pop("is_text_used", UNSET) + + is_image_used = d.pop("is_image_used", UNSET) + + module_completion_email_registration_creation_configuration = cls( + id=id, + delay=delay, + is_disabled_if_paid=is_disabled_if_paid, + text=text, + image=image, + is_text_used=is_text_used, + is_image_used=is_image_used, + ) + + module_completion_email_registration_creation_configuration.additional_properties = d + return module_completion_email_registration_creation_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_active_module.py new file mode 100644 index 0000000..407af6e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_pdf_ticket_configuration import ModuleCompletionPDFTicketConfiguration + + +T = TypeVar("T", bound="ModuleCompletionPDFTicketActiveModule") + + +@_attrs_define +class ModuleCompletionPDFTicketActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionPDFTicket` + + Attributes: + id (int): + event (int): + config (ModuleCompletionPDFTicketConfiguration): Serializer for `ModuleCompletionPDFTicketConfiguration` nested + in `ModuleCompletionPDFTicketActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleCompletionPDFTicketConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_pdf_ticket_configuration import ModuleCompletionPDFTicketConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleCompletionPDFTicketConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_completion_pdf_ticket_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_completion_pdf_ticket_active_module.additional_properties = d + return module_completion_pdf_ticket_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_configuration.py new file mode 100644 index 0000000..16777b6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_pdf_ticket_configuration.py @@ -0,0 +1,110 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModuleCompletionPDFTicketConfiguration") + + +@_attrs_define +class ModuleCompletionPDFTicketConfiguration: + """Serializer for `ModuleCompletionPDFTicketConfiguration` nested in `ModuleCompletionPDFTicketActiveModuleSerializer` + + Attributes: + id (int): + text (Union[Unset, str]): The complementary informations's text on the PDF ticket. Some restricted HTML markup + is allowed, everything else is filtered out automatically. + image (Union[None, Unset, int]): The image used for the module + is_text_used (Union[Unset, bool]): + is_image_used (Union[Unset, bool]): + """ + + id: int + text: Union[Unset, str] = UNSET + image: Union[None, Unset, int] = UNSET + is_text_used: Union[Unset, bool] = UNSET + is_image_used: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + text = self.text + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + is_text_used = self.is_text_used + + is_image_used = self.is_image_used + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if text is not UNSET: + field_dict["text"] = text + if image is not UNSET: + field_dict["image"] = image + if is_text_used is not UNSET: + field_dict["is_text_used"] = is_text_used + if is_image_used is not UNSET: + field_dict["is_image_used"] = is_image_used + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + text = d.pop("text", UNSET) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + is_text_used = d.pop("is_text_used", UNSET) + + is_image_used = d.pop("is_image_used", UNSET) + + module_completion_pdf_ticket_configuration = cls( + id=id, + text=text, + image=image, + is_text_used=is_text_used, + is_image_used=is_image_used, + ) + + module_completion_pdf_ticket_configuration.additional_properties = d + return module_completion_pdf_ticket_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_active_module.py new file mode 100644 index 0000000..334af23 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_redirect_configuration import ModuleCompletionRedirectConfiguration + + +T = TypeVar("T", bound="ModuleCompletionRedirectActiveModule") + + +@_attrs_define +class ModuleCompletionRedirectActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionRedirect` + + Attributes: + id (int): + event (int): + config (ModuleCompletionRedirectConfiguration): Serializer for `ModuleCompletionRedirectConfiguration` nested in + `ModuleCompletionRedirectActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleCompletionRedirectConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_redirect_configuration import ModuleCompletionRedirectConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleCompletionRedirectConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_completion_redirect_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_completion_redirect_active_module.additional_properties = d + return module_completion_redirect_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_configuration.py new file mode 100644 index 0000000..82468c6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_completion_redirect_configuration.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModuleCompletionRedirectConfiguration") + + +@_attrs_define +class ModuleCompletionRedirectConfiguration: + """Serializer for `ModuleCompletionRedirectConfiguration` nested in `ModuleCompletionRedirectActiveModuleSerializer` + + Attributes: + id (int): + redirect_url (str): Redirect URL once the payment is done. + """ + + id: int + redirect_url: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + redirect_url = self.redirect_url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "redirect_url": redirect_url, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + redirect_url = d.pop("redirect_url") + + module_completion_redirect_configuration = cls( + id=id, + redirect_url=redirect_url, + ) + + module_completion_redirect_configuration.additional_properties = d + return module_completion_redirect_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_active_module.py new file mode 100644 index 0000000..6050dfe --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_payrexx_configuration import ModulePaymentPayrexxConfiguration + + +T = TypeVar("T", bound="ModulePaymentPayrexxActiveModule") + + +@_attrs_define +class ModulePaymentPayrexxActiveModule: + """Serializer for `ActiveModule` linked to `ModulePaymentPayrexx` + + Attributes: + id (int): + event (int): + config (ModulePaymentPayrexxConfiguration): Serializer for `ModulePaymentPayrexxConfiguration` nested in + `ModulePaymentPayrexxActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModulePaymentPayrexxConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_payrexx_configuration import ModulePaymentPayrexxConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModulePaymentPayrexxConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_payment_payrexx_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_payment_payrexx_active_module.additional_properties = d + return module_payment_payrexx_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration.py new file mode 100644 index 0000000..2fef052 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration.py @@ -0,0 +1,169 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_payrexx_configuration_global_limit import ModulePaymentPayrexxConfigurationGlobalLimit + from ..models.module_payment_payrexx_configuration_limit import ModulePaymentPayrexxConfigurationLimit + from ..models.module_payment_payrexx_configuration_price_rule import ModulePaymentPayrexxConfigurationPriceRule + + +T = TypeVar("T", bound="ModulePaymentPayrexxConfiguration") + + +@_attrs_define +class ModulePaymentPayrexxConfiguration: + """Serializer for `ModulePaymentPayrexxConfiguration` nested in `ModulePaymentPayrexxActiveModuleSerializer` + + Attributes: + id (int): + price_rules (list['ModulePaymentPayrexxConfigurationPriceRule']): + limits (list['ModulePaymentPayrexxConfigurationLimit']): + global_limits (list['ModulePaymentPayrexxConfigurationGlobalLimit']): + is_feature_disabled (Union[Unset, bool]): + payment_list_title (Union[Unset, str]): + payment_list_description (Union[Unset, str]): + timeout (Union[None, Unset, int]): + """ + + id: int + price_rules: list["ModulePaymentPayrexxConfigurationPriceRule"] + limits: list["ModulePaymentPayrexxConfigurationLimit"] + global_limits: list["ModulePaymentPayrexxConfigurationGlobalLimit"] + is_feature_disabled: Union[Unset, bool] = UNSET + payment_list_title: Union[Unset, str] = UNSET + payment_list_description: Union[Unset, str] = UNSET + timeout: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + price_rules = [] + for price_rules_item_data in self.price_rules: + price_rules_item = price_rules_item_data.to_dict() + price_rules.append(price_rules_item) + + limits = [] + for limits_item_data in self.limits: + limits_item = limits_item_data.to_dict() + limits.append(limits_item) + + global_limits = [] + for global_limits_item_data in self.global_limits: + global_limits_item = global_limits_item_data.to_dict() + global_limits.append(global_limits_item) + + is_feature_disabled = self.is_feature_disabled + + payment_list_title = self.payment_list_title + + payment_list_description = self.payment_list_description + + timeout: Union[None, Unset, int] + if isinstance(self.timeout, Unset): + timeout = UNSET + else: + timeout = self.timeout + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "price_rules": price_rules, + "limits": limits, + "global_limits": global_limits, + } + ) + if is_feature_disabled is not UNSET: + field_dict["is_feature_disabled"] = is_feature_disabled + if payment_list_title is not UNSET: + field_dict["payment_list_title"] = payment_list_title + if payment_list_description is not UNSET: + field_dict["payment_list_description"] = payment_list_description + if timeout is not UNSET: + field_dict["timeout"] = timeout + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_payrexx_configuration_global_limit import ( + ModulePaymentPayrexxConfigurationGlobalLimit, + ) + from ..models.module_payment_payrexx_configuration_limit import ModulePaymentPayrexxConfigurationLimit + from ..models.module_payment_payrexx_configuration_price_rule import ModulePaymentPayrexxConfigurationPriceRule + + d = dict(src_dict) + id = d.pop("id") + + price_rules = [] + _price_rules = d.pop("price_rules") + for price_rules_item_data in _price_rules: + price_rules_item = ModulePaymentPayrexxConfigurationPriceRule.from_dict(price_rules_item_data) + + price_rules.append(price_rules_item) + + limits = [] + _limits = d.pop("limits") + for limits_item_data in _limits: + limits_item = ModulePaymentPayrexxConfigurationLimit.from_dict(limits_item_data) + + limits.append(limits_item) + + global_limits = [] + _global_limits = d.pop("global_limits") + for global_limits_item_data in _global_limits: + global_limits_item = ModulePaymentPayrexxConfigurationGlobalLimit.from_dict(global_limits_item_data) + + global_limits.append(global_limits_item) + + is_feature_disabled = d.pop("is_feature_disabled", UNSET) + + payment_list_title = d.pop("payment_list_title", UNSET) + + payment_list_description = d.pop("payment_list_description", UNSET) + + def _parse_timeout(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + timeout = _parse_timeout(d.pop("timeout", UNSET)) + + module_payment_payrexx_configuration = cls( + id=id, + price_rules=price_rules, + limits=limits, + global_limits=global_limits, + is_feature_disabled=is_feature_disabled, + payment_list_title=payment_list_title, + payment_list_description=payment_list_description, + timeout=timeout, + ) + + module_payment_payrexx_configuration.additional_properties = d + return module_payment_payrexx_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_global_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_global_limit.py new file mode 100644 index 0000000..f02257f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_global_limit.py @@ -0,0 +1,89 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModulePaymentPayrexxConfigurationGlobalLimit") + + +@_attrs_define +class ModulePaymentPayrexxConfigurationGlobalLimit: + """ + Attributes: + id (int): + order (int): + key (str): + conditions_json (Union[None, str]): + """ + + id: int + order: int + key: str + conditions_json: Union[None, str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + key = self.key + + conditions_json: Union[None, str] + conditions_json = self.conditions_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "key": key, + "conditions_json": conditions_json, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + key = d.pop("key") + + def _parse_conditions_json(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + conditions_json = _parse_conditions_json(d.pop("conditions_json")) + + module_payment_payrexx_configuration_global_limit = cls( + id=id, + order=order, + key=key, + conditions_json=conditions_json, + ) + + module_payment_payrexx_configuration_global_limit.additional_properties = d + return module_payment_payrexx_configuration_global_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_limit.py new file mode 100644 index 0000000..2e8a5c1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_limit.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModulePaymentPayrexxConfigurationLimit") + + +@_attrs_define +class ModulePaymentPayrexxConfigurationLimit: + """ + Attributes: + id (int): + order (int): + global_order (int): + label (str): + maximum (int): + conditions_json (Union[None, str]): + """ + + id: int + order: int + global_order: int + label: str + maximum: int + conditions_json: Union[None, str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + global_order = self.global_order + + label = self.label + + maximum = self.maximum + + conditions_json: Union[None, str] + conditions_json = self.conditions_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "global_order": global_order, + "label": label, + "maximum": maximum, + "conditions_json": conditions_json, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + global_order = d.pop("global_order") + + label = d.pop("label") + + maximum = d.pop("maximum") + + def _parse_conditions_json(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + conditions_json = _parse_conditions_json(d.pop("conditions_json")) + + module_payment_payrexx_configuration_limit = cls( + id=id, + order=order, + global_order=global_order, + label=label, + maximum=maximum, + conditions_json=conditions_json, + ) + + module_payment_payrexx_configuration_limit.additional_properties = d + return module_payment_payrexx_configuration_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_price_rule.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_price_rule.py new file mode 100644 index 0000000..7fd67b9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_payrexx_configuration_price_rule.py @@ -0,0 +1,127 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.mode_enum import ModeEnum + +T = TypeVar("T", bound="ModulePaymentPayrexxConfigurationPriceRule") + + +@_attrs_define +class ModulePaymentPayrexxConfigurationPriceRule: + """ + Attributes: + id (int): + global_order (int): + order (int): + mode (ModeEnum): * `plus` - + [Current price + value] + * `set` - = [Set price to] + * `plus_percent` - +% [Current price + current price * value / 100] + * `multiply` - * [Current price * value] + * `divide` - / [Current price / value] + value (str): + label (str): + should_propagate (bool): does this rule apply on children of the node + conditions_json (Union[None, str]): + """ + + id: int + global_order: int + order: int + mode: ModeEnum + value: str + label: str + should_propagate: bool + conditions_json: Union[None, str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + global_order = self.global_order + + order = self.order + + mode = self.mode.value + + value = self.value + + label = self.label + + should_propagate = self.should_propagate + + conditions_json: Union[None, str] + conditions_json = self.conditions_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "global_order": global_order, + "order": order, + "mode": mode, + "value": value, + "label": label, + "should_propagate": should_propagate, + "conditions_json": conditions_json, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + global_order = d.pop("global_order") + + order = d.pop("order") + + mode = ModeEnum(d.pop("mode")) + + value = d.pop("value") + + label = d.pop("label") + + should_propagate = d.pop("should_propagate") + + def _parse_conditions_json(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + conditions_json = _parse_conditions_json(d.pop("conditions_json")) + + module_payment_payrexx_configuration_price_rule = cls( + id=id, + global_order=global_order, + order=order, + mode=mode, + value=value, + label=label, + should_propagate=should_propagate, + conditions_json=conditions_json, + ) + + module_payment_payrexx_configuration_price_rule.additional_properties = d + return module_payment_payrexx_configuration_price_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_active_module.py new file mode 100644 index 0000000..f080409 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_point_of_sale_configuration import ModulePaymentPointOfSaleConfiguration + + +T = TypeVar("T", bound="ModulePaymentPointOfSaleActiveModule") + + +@_attrs_define +class ModulePaymentPointOfSaleActiveModule: + """Serializer for `ActiveModule` linked to `ModulePaymentPointOfSale` + + Attributes: + id (int): + event (int): + config (ModulePaymentPointOfSaleConfiguration): Serializer for `ModulePaymentPointOfSaleConfiguration` nested in + `ModulePaymentPointOfSaleActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModulePaymentPointOfSaleConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_point_of_sale_configuration import ModulePaymentPointOfSaleConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModulePaymentPointOfSaleConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_payment_point_of_sale_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_payment_point_of_sale_active_module.additional_properties = d + return module_payment_point_of_sale_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration.py new file mode 100644 index 0000000..93bd4bf --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration.py @@ -0,0 +1,211 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_point_of_sale_configuration_global_limit import ( + ModulePaymentPointOfSaleConfigurationGlobalLimit, + ) + from ..models.module_payment_point_of_sale_configuration_limit import ModulePaymentPointOfSaleConfigurationLimit + from ..models.module_payment_point_of_sale_configuration_price_rule import ( + ModulePaymentPointOfSaleConfigurationPriceRule, + ) + from ..models.point_of_sale_place import PointOfSalePlace + + +T = TypeVar("T", bound="ModulePaymentPointOfSaleConfiguration") + + +@_attrs_define +class ModulePaymentPointOfSaleConfiguration: + """Serializer for `ModulePaymentPointOfSaleConfiguration` nested in `ModulePaymentPointOfSaleActiveModuleSerializer` + + Attributes: + id (int): + places (list['PointOfSalePlace']): + price_rules (list['ModulePaymentPointOfSaleConfigurationPriceRule']): + limits (list['ModulePaymentPointOfSaleConfigurationLimit']): + global_limits (list['ModulePaymentPointOfSaleConfigurationGlobalLimit']): + is_feature_disabled (Union[Unset, bool]): + payment_list_title (Union[Unset, str]): + payment_list_description (Union[Unset, str]): + places_list_title (Union[Unset, str]): + places_list_text (Union[Unset, str]): + timeout (Union[None, Unset, int]): In minutes + """ + + id: int + places: list["PointOfSalePlace"] + price_rules: list["ModulePaymentPointOfSaleConfigurationPriceRule"] + limits: list["ModulePaymentPointOfSaleConfigurationLimit"] + global_limits: list["ModulePaymentPointOfSaleConfigurationGlobalLimit"] + is_feature_disabled: Union[Unset, bool] = UNSET + payment_list_title: Union[Unset, str] = UNSET + payment_list_description: Union[Unset, str] = UNSET + places_list_title: Union[Unset, str] = UNSET + places_list_text: Union[Unset, str] = UNSET + timeout: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + places = [] + for places_item_data in self.places: + places_item = places_item_data.to_dict() + places.append(places_item) + + price_rules = [] + for price_rules_item_data in self.price_rules: + price_rules_item = price_rules_item_data.to_dict() + price_rules.append(price_rules_item) + + limits = [] + for limits_item_data in self.limits: + limits_item = limits_item_data.to_dict() + limits.append(limits_item) + + global_limits = [] + for global_limits_item_data in self.global_limits: + global_limits_item = global_limits_item_data.to_dict() + global_limits.append(global_limits_item) + + is_feature_disabled = self.is_feature_disabled + + payment_list_title = self.payment_list_title + + payment_list_description = self.payment_list_description + + places_list_title = self.places_list_title + + places_list_text = self.places_list_text + + timeout: Union[None, Unset, int] + if isinstance(self.timeout, Unset): + timeout = UNSET + else: + timeout = self.timeout + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "places": places, + "price_rules": price_rules, + "limits": limits, + "global_limits": global_limits, + } + ) + if is_feature_disabled is not UNSET: + field_dict["is_feature_disabled"] = is_feature_disabled + if payment_list_title is not UNSET: + field_dict["payment_list_title"] = payment_list_title + if payment_list_description is not UNSET: + field_dict["payment_list_description"] = payment_list_description + if places_list_title is not UNSET: + field_dict["places_list_title"] = places_list_title + if places_list_text is not UNSET: + field_dict["places_list_text"] = places_list_text + if timeout is not UNSET: + field_dict["timeout"] = timeout + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_point_of_sale_configuration_global_limit import ( + ModulePaymentPointOfSaleConfigurationGlobalLimit, + ) + from ..models.module_payment_point_of_sale_configuration_limit import ModulePaymentPointOfSaleConfigurationLimit + from ..models.module_payment_point_of_sale_configuration_price_rule import ( + ModulePaymentPointOfSaleConfigurationPriceRule, + ) + from ..models.point_of_sale_place import PointOfSalePlace + + d = dict(src_dict) + id = d.pop("id") + + places = [] + _places = d.pop("places") + for places_item_data in _places: + places_item = PointOfSalePlace.from_dict(places_item_data) + + places.append(places_item) + + price_rules = [] + _price_rules = d.pop("price_rules") + for price_rules_item_data in _price_rules: + price_rules_item = ModulePaymentPointOfSaleConfigurationPriceRule.from_dict(price_rules_item_data) + + price_rules.append(price_rules_item) + + limits = [] + _limits = d.pop("limits") + for limits_item_data in _limits: + limits_item = ModulePaymentPointOfSaleConfigurationLimit.from_dict(limits_item_data) + + limits.append(limits_item) + + global_limits = [] + _global_limits = d.pop("global_limits") + for global_limits_item_data in _global_limits: + global_limits_item = ModulePaymentPointOfSaleConfigurationGlobalLimit.from_dict(global_limits_item_data) + + global_limits.append(global_limits_item) + + is_feature_disabled = d.pop("is_feature_disabled", UNSET) + + payment_list_title = d.pop("payment_list_title", UNSET) + + payment_list_description = d.pop("payment_list_description", UNSET) + + places_list_title = d.pop("places_list_title", UNSET) + + places_list_text = d.pop("places_list_text", UNSET) + + def _parse_timeout(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + timeout = _parse_timeout(d.pop("timeout", UNSET)) + + module_payment_point_of_sale_configuration = cls( + id=id, + places=places, + price_rules=price_rules, + limits=limits, + global_limits=global_limits, + is_feature_disabled=is_feature_disabled, + payment_list_title=payment_list_title, + payment_list_description=payment_list_description, + places_list_title=places_list_title, + places_list_text=places_list_text, + timeout=timeout, + ) + + module_payment_point_of_sale_configuration.additional_properties = d + return module_payment_point_of_sale_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_global_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_global_limit.py new file mode 100644 index 0000000..90891a2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_global_limit.py @@ -0,0 +1,83 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModulePaymentPointOfSaleConfigurationGlobalLimit") + + +@_attrs_define +class ModulePaymentPointOfSaleConfigurationGlobalLimit: + """ + Attributes: + id (int): + order (int): + key (str): + conditions_json (str): + """ + + id: int + order: int + key: str + conditions_json: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + key = self.key + + conditions_json = self.conditions_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "key": key, + "conditions_json": conditions_json, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + key = d.pop("key") + + conditions_json = d.pop("conditions_json") + + module_payment_point_of_sale_configuration_global_limit = cls( + id=id, + order=order, + key=key, + conditions_json=conditions_json, + ) + + module_payment_point_of_sale_configuration_global_limit.additional_properties = d + return module_payment_point_of_sale_configuration_global_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_limit.py new file mode 100644 index 0000000..37a28b5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_limit.py @@ -0,0 +1,99 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModulePaymentPointOfSaleConfigurationLimit") + + +@_attrs_define +class ModulePaymentPointOfSaleConfigurationLimit: + """ + Attributes: + id (int): + order (int): + global_order (int): + label (str): + maximum (int): + conditions_json (str): + """ + + id: int + order: int + global_order: int + label: str + maximum: int + conditions_json: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + global_order = self.global_order + + label = self.label + + maximum = self.maximum + + conditions_json = self.conditions_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "global_order": global_order, + "label": label, + "maximum": maximum, + "conditions_json": conditions_json, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + global_order = d.pop("global_order") + + label = d.pop("label") + + maximum = d.pop("maximum") + + conditions_json = d.pop("conditions_json") + + module_payment_point_of_sale_configuration_limit = cls( + id=id, + order=order, + global_order=global_order, + label=label, + maximum=maximum, + conditions_json=conditions_json, + ) + + module_payment_point_of_sale_configuration_limit.additional_properties = d + return module_payment_point_of_sale_configuration_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_price_rule.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_price_rule.py new file mode 100644 index 0000000..f65876a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_payment_point_of_sale_configuration_price_rule.py @@ -0,0 +1,121 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.mode_enum import ModeEnum + +T = TypeVar("T", bound="ModulePaymentPointOfSaleConfigurationPriceRule") + + +@_attrs_define +class ModulePaymentPointOfSaleConfigurationPriceRule: + """ + Attributes: + id (int): + global_order (int): + order (int): + mode (ModeEnum): * `plus` - + [Current price + value] + * `set` - = [Set price to] + * `plus_percent` - +% [Current price + current price * value / 100] + * `multiply` - * [Current price * value] + * `divide` - / [Current price / value] + value (str): + label (str): + should_propagate (bool): does this rule apply on children of the node + conditions_json (str): + """ + + id: int + global_order: int + order: int + mode: ModeEnum + value: str + label: str + should_propagate: bool + conditions_json: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + global_order = self.global_order + + order = self.order + + mode = self.mode.value + + value = self.value + + label = self.label + + should_propagate = self.should_propagate + + conditions_json = self.conditions_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "global_order": global_order, + "order": order, + "mode": mode, + "value": value, + "label": label, + "should_propagate": should_propagate, + "conditions_json": conditions_json, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + global_order = d.pop("global_order") + + order = d.pop("order") + + mode = ModeEnum(d.pop("mode")) + + value = d.pop("value") + + label = d.pop("label") + + should_propagate = d.pop("should_propagate") + + conditions_json = d.pop("conditions_json") + + module_payment_point_of_sale_configuration_price_rule = cls( + id=id, + global_order=global_order, + order=order, + mode=mode, + value=value, + label=label, + should_propagate=should_propagate, + conditions_json=conditions_json, + ) + + module_payment_point_of_sale_configuration_price_rule.additional_properties = d + return module_payment_point_of_sale_configuration_price_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_access_management_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_access_management_active_module.py new file mode 100644 index 0000000..aca270b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_access_management_active_module.py @@ -0,0 +1,117 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_registrations_access_management_configuration import ( + ModuleRegistrationsAccessManagementConfiguration, + ) + + +T = TypeVar("T", bound="ModuleRegistrationAccessManagementActiveModule") + + +@_attrs_define +class ModuleRegistrationAccessManagementActiveModule: + """Serializer for `ActiveModule` linked to `ModuleRegistrationOptions` + + Attributes: + id (int): + event (int): + config (ModuleRegistrationsAccessManagementConfiguration): Serializer for + `ModuleRegistrationOptionsConfiguration` nested in `ModuleRegistrationOptionsActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleRegistrationsAccessManagementConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_registrations_access_management_configuration import ( + ModuleRegistrationsAccessManagementConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleRegistrationsAccessManagementConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_registration_access_management_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_registration_access_management_active_module.additional_properties = d + return module_registration_access_management_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_active_module.py new file mode 100644 index 0000000..e6f7b75 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_active_module.py @@ -0,0 +1,113 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_registration_options_configuration import ModuleRegistrationOptionsConfiguration + + +T = TypeVar("T", bound="ModuleRegistrationOptionsActiveModule") + + +@_attrs_define +class ModuleRegistrationOptionsActiveModule: + """Serializer for `ActiveModule` linked to `ModuleRegistrationOptions` + + Attributes: + id (int): + event (int): + config (ModuleRegistrationOptionsConfiguration): Serializer for `ModuleRegistrationOptionsConfiguration` nested + in `ModuleRegistrationOptionsActiveModuleSerializer` + is_deleted (Union[Unset, bool]): + """ + + id: int + event: int + config: "ModuleRegistrationOptionsConfiguration" + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + config = self.config.to_dict() + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "config": config, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_registration_options_configuration import ModuleRegistrationOptionsConfiguration + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + config = ModuleRegistrationOptionsConfiguration.from_dict(d.pop("config")) + + is_deleted = d.pop("is_deleted", UNSET) + + module_registration_options_active_module = cls( + id=id, + event=event, + config=config, + is_deleted=is_deleted, + ) + + module_registration_options_active_module.additional_properties = d + return module_registration_options_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_configuration.py new file mode 100644 index 0000000..36c3246 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_registration_options_configuration.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModuleRegistrationOptionsConfiguration") + + +@_attrs_define +class ModuleRegistrationOptionsConfiguration: + """Serializer for `ModuleRegistrationOptionsConfiguration` nested in `ModuleRegistrationOptionsActiveModuleSerializer` + + Attributes: + id (int): + root_node (Union[None, int]): + title (Union[Unset, str]): + description (Union[Unset, str]): + title_summary (Union[Unset, str]): + display_summary (Union[Unset, bool]): + """ + + id: int + root_node: Union[None, int] + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + title_summary: Union[Unset, str] = UNSET + display_summary: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + root_node: Union[None, int] + root_node = self.root_node + + title = self.title + + description = self.description + + title_summary = self.title_summary + + display_summary = self.display_summary + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "root_node": root_node, + } + ) + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if title_summary is not UNSET: + field_dict["title_summary"] = title_summary + if display_summary is not UNSET: + field_dict["display_summary"] = display_summary + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + def _parse_root_node(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + root_node = _parse_root_node(d.pop("root_node")) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + title_summary = d.pop("title_summary", UNSET) + + display_summary = d.pop("display_summary", UNSET) + + module_registration_options_configuration = cls( + id=id, + root_node=root_node, + title=title, + description=description, + title_summary=title_summary, + display_summary=display_summary, + ) + + module_registration_options_configuration.additional_properties = d + return module_registration_options_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/module_registrations_access_management_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/module_registrations_access_management_configuration.py new file mode 100644 index 0000000..5967691 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/module_registrations_access_management_configuration.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModuleRegistrationsAccessManagementConfiguration") + + +@_attrs_define +class ModuleRegistrationsAccessManagementConfiguration: + """Serializer for `ModuleRegistrationOptionsConfiguration` nested in `ModuleRegistrationOptionsActiveModuleSerializer` + + Attributes: + id (int): + """ + + id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + module_registrations_access_management_configuration = cls( + id=id, + ) + + module_registrations_access_management_configuration.additional_properties = d + return module_registrations_access_management_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve_inline_type.py b/poly-ticket-api-client/poly_ticket_api_client/models/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve_inline_type.py new file mode 100644 index 0000000..b526dd5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/modules_basket_frontend_baskets_actions_validate_extra_infos_retrieve_inline_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ModulesBasketFrontendBasketsActionsValidateExtraInfosRetrieveInlineType(str, Enum): + ALL = "all" + INLINE_ONLY = "inline_only" + NO_INLINE = "no_inline" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node.py b/poly-ticket-api-client/poly_ticket_api_client/models/node.py new file mode 100644 index 0000000..6a0a3fc --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node.py @@ -0,0 +1,158 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Node") + + +@_attrs_define +class Node: + """Serializer for Node model + + Attributes: + id (int): + order (int): Local order between nodes that share the same parent + parent_id (int): + configuration_id (int): + children_ids (list[int]): + event (int): + event_id (int): + internal_key (Union[Unset, str]): + cart_configuration_id (Union[Unset, int]): + """ + + id: int + order: int + parent_id: int + configuration_id: int + children_ids: list[int] + event: int + event_id: int + internal_key: Union[Unset, str] = UNSET + cart_configuration_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + parent_id = self.parent_id + + configuration_id = self.configuration_id + + children_ids = self.children_ids + + event = self.event + + event_id = self.event_id + + internal_key = self.internal_key + + cart_configuration_id = self.cart_configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "parent_id": parent_id, + "configuration_id": configuration_id, + "children_ids": children_ids, + "event": event, + "event_id": event_id, + } + ) + if internal_key is not UNSET: + field_dict["internal_key"] = internal_key + if cart_configuration_id is not UNSET: + field_dict["cart_configuration_id"] = cart_configuration_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + files.append(("parent_id", (None, str(self.parent_id).encode(), "text/plain"))) + + files.append(("configuration_id", (None, str(self.configuration_id).encode(), "text/plain"))) + + for children_ids_item_element in self.children_ids: + files.append(("children_ids", (None, str(children_ids_item_element).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.internal_key, Unset): + files.append(("internal_key", (None, str(self.internal_key).encode(), "text/plain"))) + + if not isinstance(self.cart_configuration_id, Unset): + files.append(("cart_configuration_id", (None, str(self.cart_configuration_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + parent_id = d.pop("parent_id") + + configuration_id = d.pop("configuration_id") + + children_ids = cast(list[int], d.pop("children_ids")) + + event = d.pop("event") + + event_id = d.pop("event_id") + + internal_key = d.pop("internal_key", UNSET) + + cart_configuration_id = d.pop("cart_configuration_id", UNSET) + + node = cls( + id=id, + order=order, + parent_id=parent_id, + configuration_id=configuration_id, + children_ids=children_ids, + event=event, + event_id=event_id, + internal_key=internal_key, + cart_configuration_id=cart_configuration_id, + ) + + node.additional_properties = d + return node + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_access.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_access.py new file mode 100644 index 0000000..b43b0df --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_access.py @@ -0,0 +1,141 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeAccess") + + +@_attrs_define +class NodeAccess: + """Serializer (read/write) for `NodeAccess` model + + Attributes: + event (int): + event_id (int): + id (int): + label (str): + node_configuration_ids (list[int]): + condition_id (Union[Unset, int]): + is_accessible (Union[Unset, bool]): if True and user matches the conditions they should have access to the node, + if False and user matches the conditions they should not have access to the node + """ + + event: int + event_id: int + id: int + label: str + node_configuration_ids: list[int] + condition_id: Union[Unset, int] = UNSET + is_accessible: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + label = self.label + + node_configuration_ids = self.node_configuration_ids + + condition_id = self.condition_id + + is_accessible = self.is_accessible + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "label": label, + "node_configuration_ids": node_configuration_ids, + } + ) + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + if is_accessible is not UNSET: + field_dict["is_accessible"] = is_accessible + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("label", (None, str(self.label).encode(), "text/plain"))) + + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + if not isinstance(self.is_accessible, Unset): + files.append(("is_accessible", (None, str(self.is_accessible).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + label = d.pop("label") + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids")) + + condition_id = d.pop("condition_id", UNSET) + + is_accessible = d.pop("is_accessible", UNSET) + + node_access = cls( + event=event, + event_id=event_id, + id=id, + label=label, + node_configuration_ids=node_configuration_ids, + condition_id=condition_id, + is_accessible=is_accessible, + ) + + node_access.additional_properties = d + return node_access + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_access_m2m.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_access_m2m.py new file mode 100644 index 0000000..ecca7d8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_access_m2m.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="NodeAccessM2M") + + +@_attrs_define +class NodeAccessM2M: + """Serializer (read/write) for `NodeAccessM2M` relation model + + Attributes: + event (int): + event_id (int): + id (int): + access_id (int): + node_configuration_id (int): + """ + + event: int + event_id: int + id: int + access_id: int + node_configuration_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + access_id = self.access_id + + node_configuration_id = self.node_configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "access_id": access_id, + "node_configuration_id": node_configuration_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("access_id", (None, str(self.access_id).encode(), "text/plain"))) + + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + access_id = d.pop("access_id") + + node_configuration_id = d.pop("node_configuration_id") + + node_access_m2m = cls( + event=event, + event_id=event_id, + id=id, + access_id=access_id, + node_configuration_id=node_configuration_id, + ) + + node_access_m2m.additional_properties = d + return node_access_m2m + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_availability.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_availability.py new file mode 100644 index 0000000..59aea1e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_availability.py @@ -0,0 +1,202 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeAvailability") + + +@_attrs_define +class NodeAvailability: + """Serializer (read/write) for NodeAvailability model + + Attributes: + id (int): + name (str): + node_configuration_ids (list[int]): + event (int): + event_id (int): + condition_id (Union[Unset, int]): + starts_at (Union[None, Unset, datetime.datetime]): + ends_at (Union[None, Unset, datetime.datetime]): + """ + + id: int + name: str + node_configuration_ids: list[int] + event: int + event_id: int + condition_id: Union[Unset, int] = UNSET + starts_at: Union[None, Unset, datetime.datetime] = UNSET + ends_at: Union[None, Unset, datetime.datetime] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + node_configuration_ids = self.node_configuration_ids + + event = self.event + + event_id = self.event_id + + condition_id = self.condition_id + + starts_at: Union[None, Unset, str] + if isinstance(self.starts_at, Unset): + starts_at = UNSET + elif isinstance(self.starts_at, datetime.datetime): + starts_at = self.starts_at.isoformat() + else: + starts_at = self.starts_at + + ends_at: Union[None, Unset, str] + if isinstance(self.ends_at, Unset): + ends_at = UNSET + elif isinstance(self.ends_at, datetime.datetime): + ends_at = self.ends_at.isoformat() + else: + ends_at = self.ends_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "node_configuration_ids": node_configuration_ids, + "event": event, + "event_id": event_id, + } + ) + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + if starts_at is not UNSET: + field_dict["starts_at"] = starts_at + if ends_at is not UNSET: + field_dict["ends_at"] = ends_at + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + if not isinstance(self.starts_at, Unset): + if isinstance(self.starts_at, datetime.datetime): + files.append(("starts_at", (None, self.starts_at.isoformat().encode(), "text/plain"))) + else: + files.append(("starts_at", (None, str(self.starts_at).encode(), "text/plain"))) + + if not isinstance(self.ends_at, Unset): + if isinstance(self.ends_at, datetime.datetime): + files.append(("ends_at", (None, self.ends_at.isoformat().encode(), "text/plain"))) + else: + files.append(("ends_at", (None, str(self.ends_at).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids")) + + event = d.pop("event") + + event_id = d.pop("event_id") + + condition_id = d.pop("condition_id", UNSET) + + def _parse_starts_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + starts_at_type_0 = isoparse(data) + + return starts_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + starts_at = _parse_starts_at(d.pop("starts_at", UNSET)) + + def _parse_ends_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + ends_at_type_0 = isoparse(data) + + return ends_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + ends_at = _parse_ends_at(d.pop("ends_at", UNSET)) + + node_availability = cls( + id=id, + name=name, + node_configuration_ids=node_configuration_ids, + event=event, + event_id=event_id, + condition_id=condition_id, + starts_at=starts_at, + ends_at=ends_at, + ) + + node_availability.additional_properties = d + return node_availability + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_availability_m2m.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_availability_m2m.py new file mode 100644 index 0000000..d91d63b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_availability_m2m.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="NodeAvailabilityM2M") + + +@_attrs_define +class NodeAvailabilityM2M: + """Serializer (read/write) for `NodeAvailabilityM2M` relation model + + Attributes: + id (int): + availability_id (int): + node_configuration_id (int): + event (int): + event_id (int): + """ + + id: int + availability_id: int + node_configuration_id: int + event: int + event_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + availability_id = self.availability_id + + node_configuration_id = self.node_configuration_id + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "availability_id": availability_id, + "node_configuration_id": node_configuration_id, + "event": event, + "event_id": event_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("availability_id", (None, str(self.availability_id).encode(), "text/plain"))) + + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + availability_id = d.pop("availability_id") + + node_configuration_id = d.pop("node_configuration_id") + + event = d.pop("event") + + event_id = d.pop("event_id") + + node_availability_m2m = cls( + id=id, + availability_id=availability_id, + node_configuration_id=node_configuration_id, + event=event, + event_id=event_id, + ) + + node_availability_m2m.additional_properties = d + return node_availability_m2m + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_cart_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_cart_configuration.py new file mode 100644 index 0000000..558e36e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_cart_configuration.py @@ -0,0 +1,129 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeCartConfiguration") + + +@_attrs_define +class NodeCartConfiguration: + """Serializer (read/write) for NodeCartConfiguration model + + Attributes: + id (int): + event (int): + event_id (int): + weight (Union[Unset, int]): + range_min (Union[Unset, int]): + range_max (Union[Unset, int]): + """ + + id: int + event: int + event_id: int + weight: Union[Unset, int] = UNSET + range_min: Union[Unset, int] = UNSET + range_max: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + event_id = self.event_id + + weight = self.weight + + range_min = self.range_min + + range_max = self.range_max + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "event_id": event_id, + } + ) + if weight is not UNSET: + field_dict["weight"] = weight + if range_min is not UNSET: + field_dict["range_min"] = range_min + if range_max is not UNSET: + field_dict["range_max"] = range_max + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.weight, Unset): + files.append(("weight", (None, str(self.weight).encode(), "text/plain"))) + + if not isinstance(self.range_min, Unset): + files.append(("range_min", (None, str(self.range_min).encode(), "text/plain"))) + + if not isinstance(self.range_max, Unset): + files.append(("range_max", (None, str(self.range_max).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + event_id = d.pop("event_id") + + weight = d.pop("weight", UNSET) + + range_min = d.pop("range_min", UNSET) + + range_max = d.pop("range_max", UNSET) + + node_cart_configuration = cls( + id=id, + event=event, + event_id=event_id, + weight=weight, + range_min=range_min, + range_max=range_max, + ) + + node_cart_configuration.additional_properties = d + return node_cart_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_configuration.py new file mode 100644 index 0000000..aa0f2c7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_configuration.py @@ -0,0 +1,359 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..models.category_enum import CategoryEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeConfiguration") + + +@_attrs_define +class NodeConfiguration: + """Serializer (read/write) for NodeConfiguration model + + Attributes: + id (int): + event (int): + event_id (int): + description (Union[Unset, str]): description for the node. Some restricted HTML markup is allowed, everything + else is filtered out automatically. + title (Union[Unset, str]): + category (Union[Unset, CategoryEnum]): * `ticket` - Ticket + * `item` - Item + * `activity` - Activity + * `accomodation` - Accomodation + * `type` - Type + * `group` - Group + image (Union[None, Unset, int]): + image_style (Union[Unset, Any]): + item_style (Union[Unset, Any]): + display_price_difference (Union[Unset, bool]): + display_limits_difference (Union[Unset, bool]): + is_title_displayable (Union[Unset, bool]): + is_image_displayable (Union[Unset, bool]): + is_description_displayable (Union[Unset, bool]): + is_tags_displayable (Union[Unset, bool]): + starts_at (Union[None, Unset, datetime.datetime]): Optional start datetime for this node. For display only. + ends_at (Union[None, Unset, datetime.datetime]): Optional end datetime for this node. For display only. + is_subject_to_lausanne_tax (Union[Unset, bool]): + """ + + id: int + event: int + event_id: int + description: Union[Unset, str] = UNSET + title: Union[Unset, str] = UNSET + category: Union[Unset, CategoryEnum] = UNSET + image: Union[None, Unset, int] = UNSET + image_style: Union[Unset, Any] = UNSET + item_style: Union[Unset, Any] = UNSET + display_price_difference: Union[Unset, bool] = UNSET + display_limits_difference: Union[Unset, bool] = UNSET + is_title_displayable: Union[Unset, bool] = UNSET + is_image_displayable: Union[Unset, bool] = UNSET + is_description_displayable: Union[Unset, bool] = UNSET + is_tags_displayable: Union[Unset, bool] = UNSET + starts_at: Union[None, Unset, datetime.datetime] = UNSET + ends_at: Union[None, Unset, datetime.datetime] = UNSET + is_subject_to_lausanne_tax: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + event_id = self.event_id + + description = self.description + + title = self.title + + category: Union[Unset, str] = UNSET + if not isinstance(self.category, Unset): + category = self.category.value + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + image_style = self.image_style + + item_style = self.item_style + + display_price_difference = self.display_price_difference + + display_limits_difference = self.display_limits_difference + + is_title_displayable = self.is_title_displayable + + is_image_displayable = self.is_image_displayable + + is_description_displayable = self.is_description_displayable + + is_tags_displayable = self.is_tags_displayable + + starts_at: Union[None, Unset, str] + if isinstance(self.starts_at, Unset): + starts_at = UNSET + elif isinstance(self.starts_at, datetime.datetime): + starts_at = self.starts_at.isoformat() + else: + starts_at = self.starts_at + + ends_at: Union[None, Unset, str] + if isinstance(self.ends_at, Unset): + ends_at = UNSET + elif isinstance(self.ends_at, datetime.datetime): + ends_at = self.ends_at.isoformat() + else: + ends_at = self.ends_at + + is_subject_to_lausanne_tax = self.is_subject_to_lausanne_tax + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "event_id": event_id, + } + ) + if description is not UNSET: + field_dict["description"] = description + if title is not UNSET: + field_dict["title"] = title + if category is not UNSET: + field_dict["category"] = category + if image is not UNSET: + field_dict["image"] = image + if image_style is not UNSET: + field_dict["image_style"] = image_style + if item_style is not UNSET: + field_dict["item_style"] = item_style + if display_price_difference is not UNSET: + field_dict["display_price_difference"] = display_price_difference + if display_limits_difference is not UNSET: + field_dict["display_limits_difference"] = display_limits_difference + if is_title_displayable is not UNSET: + field_dict["is_title_displayable"] = is_title_displayable + if is_image_displayable is not UNSET: + field_dict["is_image_displayable"] = is_image_displayable + if is_description_displayable is not UNSET: + field_dict["is_description_displayable"] = is_description_displayable + if is_tags_displayable is not UNSET: + field_dict["is_tags_displayable"] = is_tags_displayable + if starts_at is not UNSET: + field_dict["starts_at"] = starts_at + if ends_at is not UNSET: + field_dict["ends_at"] = ends_at + if is_subject_to_lausanne_tax is not UNSET: + field_dict["is_subject_to_lausanne_tax"] = is_subject_to_lausanne_tax + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.description, Unset): + files.append(("description", (None, str(self.description).encode(), "text/plain"))) + + if not isinstance(self.title, Unset): + files.append(("title", (None, str(self.title).encode(), "text/plain"))) + + if not isinstance(self.category, Unset): + files.append(("category", (None, str(self.category.value).encode(), "text/plain"))) + + if not isinstance(self.image, Unset): + if isinstance(self.image, int): + files.append(("image", (None, str(self.image).encode(), "text/plain"))) + else: + files.append(("image", (None, str(self.image).encode(), "text/plain"))) + + if not isinstance(self.image_style, Unset): + files.append(("image_style", (None, str(self.image_style).encode(), "text/plain"))) + + if not isinstance(self.item_style, Unset): + files.append(("item_style", (None, str(self.item_style).encode(), "text/plain"))) + + if not isinstance(self.display_price_difference, Unset): + files.append( + ("display_price_difference", (None, str(self.display_price_difference).encode(), "text/plain")) + ) + + if not isinstance(self.display_limits_difference, Unset): + files.append( + ("display_limits_difference", (None, str(self.display_limits_difference).encode(), "text/plain")) + ) + + if not isinstance(self.is_title_displayable, Unset): + files.append(("is_title_displayable", (None, str(self.is_title_displayable).encode(), "text/plain"))) + + if not isinstance(self.is_image_displayable, Unset): + files.append(("is_image_displayable", (None, str(self.is_image_displayable).encode(), "text/plain"))) + + if not isinstance(self.is_description_displayable, Unset): + files.append( + ("is_description_displayable", (None, str(self.is_description_displayable).encode(), "text/plain")) + ) + + if not isinstance(self.is_tags_displayable, Unset): + files.append(("is_tags_displayable", (None, str(self.is_tags_displayable).encode(), "text/plain"))) + + if not isinstance(self.starts_at, Unset): + if isinstance(self.starts_at, datetime.datetime): + files.append(("starts_at", (None, self.starts_at.isoformat().encode(), "text/plain"))) + else: + files.append(("starts_at", (None, str(self.starts_at).encode(), "text/plain"))) + + if not isinstance(self.ends_at, Unset): + if isinstance(self.ends_at, datetime.datetime): + files.append(("ends_at", (None, self.ends_at.isoformat().encode(), "text/plain"))) + else: + files.append(("ends_at", (None, str(self.ends_at).encode(), "text/plain"))) + + if not isinstance(self.is_subject_to_lausanne_tax, Unset): + files.append( + ("is_subject_to_lausanne_tax", (None, str(self.is_subject_to_lausanne_tax).encode(), "text/plain")) + ) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + event_id = d.pop("event_id") + + description = d.pop("description", UNSET) + + title = d.pop("title", UNSET) + + _category = d.pop("category", UNSET) + category: Union[Unset, CategoryEnum] + if isinstance(_category, Unset): + category = UNSET + else: + category = CategoryEnum(_category) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + image_style = d.pop("image_style", UNSET) + + item_style = d.pop("item_style", UNSET) + + display_price_difference = d.pop("display_price_difference", UNSET) + + display_limits_difference = d.pop("display_limits_difference", UNSET) + + is_title_displayable = d.pop("is_title_displayable", UNSET) + + is_image_displayable = d.pop("is_image_displayable", UNSET) + + is_description_displayable = d.pop("is_description_displayable", UNSET) + + is_tags_displayable = d.pop("is_tags_displayable", UNSET) + + def _parse_starts_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + starts_at_type_0 = isoparse(data) + + return starts_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + starts_at = _parse_starts_at(d.pop("starts_at", UNSET)) + + def _parse_ends_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + ends_at_type_0 = isoparse(data) + + return ends_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + ends_at = _parse_ends_at(d.pop("ends_at", UNSET)) + + is_subject_to_lausanne_tax = d.pop("is_subject_to_lausanne_tax", UNSET) + + node_configuration = cls( + id=id, + event=event, + event_id=event_id, + description=description, + title=title, + category=category, + image=image, + image_style=image_style, + item_style=item_style, + display_price_difference=display_price_difference, + display_limits_difference=display_limits_difference, + is_title_displayable=is_title_displayable, + is_image_displayable=is_image_displayable, + is_description_displayable=is_description_displayable, + is_tags_displayable=is_tags_displayable, + starts_at=starts_at, + ends_at=ends_at, + is_subject_to_lausanne_tax=is_subject_to_lausanne_tax, + ) + + node_configuration.additional_properties = d + return node_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info.py new file mode 100644 index 0000000..ec00690 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info.py @@ -0,0 +1,257 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.model_form_line_type import ModelFormLineType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeExtraInfo") + + +@_attrs_define +class NodeExtraInfo: + """Serializer (read/write) for `NodeExtraInfo` model + + Attributes: + id (int): + group_id (int): + order (int): + type_ (ModelFormLineType): * `text` - Simple text + * `email` - Email + * `phone` - Phone + * `country` - Country + * `numerical` - Numerical + * `textarea` - Multi-line text input + * `boolean` - Boolean + * `datetime` - Datetime + * `date` - Date + * `date_major` - Birthdate with majority required + * `choice` - Choice + * `file` - File + name (str): + text (str): + event (int): + event_id (int): + help_text (Union[Unset, str]): + is_required (Union[Unset, bool]): + choices_json (Union[None, Unset, str]): + major_json (Union[None, Unset, str]): + range_json (Union[None, Unset, str]): + """ + + id: int + group_id: int + order: int + type_: ModelFormLineType + name: str + text: str + event: int + event_id: int + help_text: Union[Unset, str] = UNSET + is_required: Union[Unset, bool] = UNSET + choices_json: Union[None, Unset, str] = UNSET + major_json: Union[None, Unset, str] = UNSET + range_json: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + group_id = self.group_id + + order = self.order + + type_ = self.type_.value + + name = self.name + + text = self.text + + event = self.event + + event_id = self.event_id + + help_text = self.help_text + + is_required = self.is_required + + choices_json: Union[None, Unset, str] + if isinstance(self.choices_json, Unset): + choices_json = UNSET + else: + choices_json = self.choices_json + + major_json: Union[None, Unset, str] + if isinstance(self.major_json, Unset): + major_json = UNSET + else: + major_json = self.major_json + + range_json: Union[None, Unset, str] + if isinstance(self.range_json, Unset): + range_json = UNSET + else: + range_json = self.range_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "group_id": group_id, + "order": order, + "type": type_, + "name": name, + "text": text, + "event": event, + "event_id": event_id, + } + ) + if help_text is not UNSET: + field_dict["help_text"] = help_text + if is_required is not UNSET: + field_dict["is_required"] = is_required + if choices_json is not UNSET: + field_dict["choices_json"] = choices_json + if major_json is not UNSET: + field_dict["major_json"] = major_json + if range_json is not UNSET: + field_dict["range_json"] = range_json + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("group_id", (None, str(self.group_id).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + files.append(("type", (None, str(self.type_.value).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("text", (None, str(self.text).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.help_text, Unset): + files.append(("help_text", (None, str(self.help_text).encode(), "text/plain"))) + + if not isinstance(self.is_required, Unset): + files.append(("is_required", (None, str(self.is_required).encode(), "text/plain"))) + + if not isinstance(self.choices_json, Unset): + if isinstance(self.choices_json, str): + files.append(("choices_json", (None, str(self.choices_json).encode(), "text/plain"))) + else: + files.append(("choices_json", (None, str(self.choices_json).encode(), "text/plain"))) + + if not isinstance(self.major_json, Unset): + if isinstance(self.major_json, str): + files.append(("major_json", (None, str(self.major_json).encode(), "text/plain"))) + else: + files.append(("major_json", (None, str(self.major_json).encode(), "text/plain"))) + + if not isinstance(self.range_json, Unset): + if isinstance(self.range_json, str): + files.append(("range_json", (None, str(self.range_json).encode(), "text/plain"))) + else: + files.append(("range_json", (None, str(self.range_json).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + group_id = d.pop("group_id") + + order = d.pop("order") + + type_ = ModelFormLineType(d.pop("type")) + + name = d.pop("name") + + text = d.pop("text") + + event = d.pop("event") + + event_id = d.pop("event_id") + + help_text = d.pop("help_text", UNSET) + + is_required = d.pop("is_required", UNSET) + + def _parse_choices_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + choices_json = _parse_choices_json(d.pop("choices_json", UNSET)) + + def _parse_major_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + major_json = _parse_major_json(d.pop("major_json", UNSET)) + + def _parse_range_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + range_json = _parse_range_json(d.pop("range_json", UNSET)) + + node_extra_info = cls( + id=id, + group_id=group_id, + order=order, + type_=type_, + name=name, + text=text, + event=event, + event_id=event_id, + help_text=help_text, + is_required=is_required, + choices_json=choices_json, + major_json=major_json, + range_json=range_json, + ) + + node_extra_info.additional_properties = d + return node_extra_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group.py new file mode 100644 index 0000000..5ecdfe0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group.py @@ -0,0 +1,161 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeExtraInfoGroup") + + +@_attrs_define +class NodeExtraInfoGroup: + """Serializer (read/write) for `NodeExtraInfoGroup` model + + Attributes: + id (int): + name (str): + order (int): + node_configuration_ids (list[int]): + extra_info_ids (list[int]): + event (int): + event_id (int): + is_inline (Union[Unset, bool]): + is_required (Union[Unset, bool]): + """ + + id: int + name: str + order: int + node_configuration_ids: list[int] + extra_info_ids: list[int] + event: int + event_id: int + is_inline: Union[Unset, bool] = UNSET + is_required: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + order = self.order + + node_configuration_ids = self.node_configuration_ids + + extra_info_ids = self.extra_info_ids + + event = self.event + + event_id = self.event_id + + is_inline = self.is_inline + + is_required = self.is_required + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "order": order, + "node_configuration_ids": node_configuration_ids, + "extra_info_ids": extra_info_ids, + "event": event, + "event_id": event_id, + } + ) + if is_inline is not UNSET: + field_dict["is_inline"] = is_inline + if is_required is not UNSET: + field_dict["is_required"] = is_required + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + for extra_info_ids_item_element in self.extra_info_ids: + files.append(("extra_info_ids", (None, str(extra_info_ids_item_element).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.is_inline, Unset): + files.append(("is_inline", (None, str(self.is_inline).encode(), "text/plain"))) + + if not isinstance(self.is_required, Unset): + files.append(("is_required", (None, str(self.is_required).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + order = d.pop("order") + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids")) + + extra_info_ids = cast(list[int], d.pop("extra_info_ids")) + + event = d.pop("event") + + event_id = d.pop("event_id") + + is_inline = d.pop("is_inline", UNSET) + + is_required = d.pop("is_required", UNSET) + + node_extra_info_group = cls( + id=id, + name=name, + order=order, + node_configuration_ids=node_configuration_ids, + extra_info_ids=extra_info_ids, + event=event, + event_id=event_id, + is_inline=is_inline, + is_required=is_required, + ) + + node_extra_info_group.additional_properties = d + return node_extra_info_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group_m2m.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group_m2m.py new file mode 100644 index 0000000..7b262e5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_extra_info_group_m2m.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="NodeExtraInfoGroupM2M") + + +@_attrs_define +class NodeExtraInfoGroupM2M: + """Serializer (read/write) for `NodeExtraInfoGroupM2M` relation model + + Attributes: + id (int): + group_id (int): + node_configuration_id (int): + event (int): + event_id (int): + """ + + id: int + group_id: int + node_configuration_id: int + event: int + event_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + group_id = self.group_id + + node_configuration_id = self.node_configuration_id + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "group_id": group_id, + "node_configuration_id": node_configuration_id, + "event": event, + "event_id": event_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("group_id", (None, str(self.group_id).encode(), "text/plain"))) + + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + group_id = d.pop("group_id") + + node_configuration_id = d.pop("node_configuration_id") + + event = d.pop("event") + + event_id = d.pop("event_id") + + node_extra_info_group_m2m = cls( + id=id, + group_id=group_id, + node_configuration_id=node_configuration_id, + event=event, + event_id=event_id, + ) + + node_extra_info_group_m2m.additional_properties = d + return node_extra_info_group_m2m + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_limit.py new file mode 100644 index 0000000..9ff6bbb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_limit.py @@ -0,0 +1,180 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodeLimit") + + +@_attrs_define +class NodeLimit: + """Serializer (read/write) for `NodeLimit` model + + Attributes: + event (int): + event_id (int): + id (int): + key (str): + label (str): + maximum (int): + order (int): + global_order (int): + node_configuration_ids (list[int]): + is_deleted (Union[Unset, bool]): + condition_id (Union[Unset, int]): + """ + + event: int + event_id: int + id: int + key: str + label: str + maximum: int + order: int + global_order: int + node_configuration_ids: list[int] + is_deleted: Union[Unset, bool] = UNSET + condition_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + key = self.key + + label = self.label + + maximum = self.maximum + + order = self.order + + global_order = self.global_order + + node_configuration_ids = self.node_configuration_ids + + is_deleted = self.is_deleted + + condition_id = self.condition_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "key": key, + "label": label, + "maximum": maximum, + "order": order, + "global_order": global_order, + "node_configuration_ids": node_configuration_ids, + } + ) + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("key", (None, str(self.key).encode(), "text/plain"))) + + files.append(("label", (None, str(self.label).encode(), "text/plain"))) + + files.append(("maximum", (None, str(self.maximum).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + files.append(("global_order", (None, str(self.global_order).encode(), "text/plain"))) + + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + key = d.pop("key") + + label = d.pop("label") + + maximum = d.pop("maximum") + + order = d.pop("order") + + global_order = d.pop("global_order") + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids")) + + is_deleted = d.pop("is_deleted", UNSET) + + condition_id = d.pop("condition_id", UNSET) + + node_limit = cls( + event=event, + event_id=event_id, + id=id, + key=key, + label=label, + maximum=maximum, + order=order, + global_order=global_order, + node_configuration_ids=node_configuration_ids, + is_deleted=is_deleted, + condition_id=condition_id, + ) + + node_limit.additional_properties = d + return node_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_limit_m2m.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_limit_m2m.py new file mode 100644 index 0000000..512cb58 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_limit_m2m.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="NodeLimitM2M") + + +@_attrs_define +class NodeLimitM2M: + """Serializer (read/write) for `NodeLimitM2M` relation model + + Attributes: + event (int): + event_id (int): + id (int): + limit_id (int): + node_configuration_id (int): + """ + + event: int + event_id: int + id: int + limit_id: int + node_configuration_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + limit_id = self.limit_id + + node_configuration_id = self.node_configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "limit_id": limit_id, + "node_configuration_id": node_configuration_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("limit_id", (None, str(self.limit_id).encode(), "text/plain"))) + + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + limit_id = d.pop("limit_id") + + node_configuration_id = d.pop("node_configuration_id") + + node_limit_m2m = cls( + event=event, + event_id=event_id, + id=id, + limit_id=limit_id, + node_configuration_id=node_configuration_id, + ) + + node_limit_m2m.additional_properties = d + return node_limit_m2m + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_limit_usage.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_limit_usage.py new file mode 100644 index 0000000..8ab6278 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_limit_usage.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="NodeLimitUsage") + + +@_attrs_define +class NodeLimitUsage: + """Serializer for node used on node stock endpoints. + + Attributes: + label (str): Label of related limit. + count_reserved (int): Number of times this limit has been taken. + maximum (int): Maximum of times this limit can be taken. + remaining (int): Number of times left. + """ + + label: str + count_reserved: int + maximum: int + remaining: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + label = self.label + + count_reserved = self.count_reserved + + maximum = self.maximum + + remaining = self.remaining + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "label": label, + "count_reserved": count_reserved, + "maximum": maximum, + "remaining": remaining, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + label = d.pop("label") + + count_reserved = d.pop("count_reserved") + + maximum = d.pop("maximum") + + remaining = d.pop("remaining") + + node_limit_usage = cls( + label=label, + count_reserved=count_reserved, + maximum=maximum, + remaining=remaining, + ) + + node_limit_usage.additional_properties = d + return node_limit_usage + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule.py new file mode 100644 index 0000000..27b3b9e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule.py @@ -0,0 +1,185 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.mode_enum import ModeEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NodePriceRule") + + +@_attrs_define +class NodePriceRule: + """Serializer (read/write) for `NodePriceRule` model + + Attributes: + event (int): + event_id (int): + id (int): + global_order (int): + order (int): + mode (ModeEnum): * `plus` - + [Current price + value] + * `set` - = [Set price to] + * `plus_percent` - +% [Current price + current price * value / 100] + * `multiply` - * [Current price * value] + * `divide` - / [Current price / value] + value (str): + label (str): + node_configuration_ids (list[int]): + condition_id (Union[Unset, int]): + should_propagate (Union[Unset, bool]): does this rule apply on children of the node + """ + + event: int + event_id: int + id: int + global_order: int + order: int + mode: ModeEnum + value: str + label: str + node_configuration_ids: list[int] + condition_id: Union[Unset, int] = UNSET + should_propagate: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + global_order = self.global_order + + order = self.order + + mode = self.mode.value + + value = self.value + + label = self.label + + node_configuration_ids = self.node_configuration_ids + + condition_id = self.condition_id + + should_propagate = self.should_propagate + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "global_order": global_order, + "order": order, + "mode": mode, + "value": value, + "label": label, + "node_configuration_ids": node_configuration_ids, + } + ) + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + if should_propagate is not UNSET: + field_dict["should_propagate"] = should_propagate + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("global_order", (None, str(self.global_order).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + files.append(("mode", (None, str(self.mode.value).encode(), "text/plain"))) + + files.append(("value", (None, str(self.value).encode(), "text/plain"))) + + files.append(("label", (None, str(self.label).encode(), "text/plain"))) + + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + if not isinstance(self.should_propagate, Unset): + files.append(("should_propagate", (None, str(self.should_propagate).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + global_order = d.pop("global_order") + + order = d.pop("order") + + mode = ModeEnum(d.pop("mode")) + + value = d.pop("value") + + label = d.pop("label") + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids")) + + condition_id = d.pop("condition_id", UNSET) + + should_propagate = d.pop("should_propagate", UNSET) + + node_price_rule = cls( + event=event, + event_id=event_id, + id=id, + global_order=global_order, + order=order, + mode=mode, + value=value, + label=label, + node_configuration_ids=node_configuration_ids, + condition_id=condition_id, + should_propagate=should_propagate, + ) + + node_price_rule.additional_properties = d + return node_price_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule_m2m.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule_m2m.py new file mode 100644 index 0000000..1b37857 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_price_rule_m2m.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="NodePriceRuleM2M") + + +@_attrs_define +class NodePriceRuleM2M: + """Serializer (read/write) for `NodePriceRuleM2M` relation model + + Attributes: + event (int): + event_id (int): + id (int): + price_rule_id (int): + node_configuration_id (int): + """ + + event: int + event_id: int + id: int + price_rule_id: int + node_configuration_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + price_rule_id = self.price_rule_id + + node_configuration_id = self.node_configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "price_rule_id": price_rule_id, + "node_configuration_id": node_configuration_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("price_rule_id", (None, str(self.price_rule_id).encode(), "text/plain"))) + + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + price_rule_id = d.pop("price_rule_id") + + node_configuration_id = d.pop("node_configuration_id") + + node_price_rule_m2m = cls( + event=event, + event_id=event_id, + id=id, + price_rule_id=price_rule_id, + node_configuration_id=node_configuration_id, + ) + + node_price_rule_m2m.additional_properties = d + return node_price_rule_m2m + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_stock.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_stock.py new file mode 100644 index 0000000..a0828e1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_stock.py @@ -0,0 +1,147 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.node_limit_usage import NodeLimitUsage + + +T = TypeVar("T", bound="NodeStock") + + +@_attrs_define +class NodeStock: + """Serializer for mapping the stock of each Node. + + Attributes: + id (int): Id of node + title (str): Title of the equivalent `SelectedRootNode` + root_path (list[str]): List of title on the path from root to the node. + count_total (int): Total number of items that have been purchased, are being purchased, have been refunded or + are only added to a basket. + count_new (int): Number of items that are in a basket (but not purchased, nor are being purchased, nor refunded) + count_payment_in_progress (int): Number of items that are currently being purchased. + count_validated (int): Number of items that have been purchased. + count_reserved (int): Number of items that are reserved (validated + being paid). + count_refunded (int): Number of items that have been refunded. + limits (list['NodeLimitUsage']): Any stock limits that this item has + """ + + id: int + title: str + root_path: list[str] + count_total: int + count_new: int + count_payment_in_progress: int + count_validated: int + count_reserved: int + count_refunded: int + limits: list["NodeLimitUsage"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + title = self.title + + root_path = self.root_path + + count_total = self.count_total + + count_new = self.count_new + + count_payment_in_progress = self.count_payment_in_progress + + count_validated = self.count_validated + + count_reserved = self.count_reserved + + count_refunded = self.count_refunded + + limits = [] + for limits_item_data in self.limits: + limits_item = limits_item_data.to_dict() + limits.append(limits_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "title": title, + "root_path": root_path, + "count_total": count_total, + "count_new": count_new, + "count_payment_in_progress": count_payment_in_progress, + "count_validated": count_validated, + "count_reserved": count_reserved, + "count_refunded": count_refunded, + "limits": limits, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_limit_usage import NodeLimitUsage + + d = dict(src_dict) + id = d.pop("id") + + title = d.pop("title") + + root_path = cast(list[str], d.pop("root_path")) + + count_total = d.pop("count_total") + + count_new = d.pop("count_new") + + count_payment_in_progress = d.pop("count_payment_in_progress") + + count_validated = d.pop("count_validated") + + count_reserved = d.pop("count_reserved") + + count_refunded = d.pop("count_refunded") + + limits = [] + _limits = d.pop("limits") + for limits_item_data in _limits: + limits_item = NodeLimitUsage.from_dict(limits_item_data) + + limits.append(limits_item) + + node_stock = cls( + id=id, + title=title, + root_path=root_path, + count_total=count_total, + count_new=count_new, + count_payment_in_progress=count_payment_in_progress, + count_validated=count_validated, + count_reserved=count_reserved, + count_refunded=count_refunded, + limits=limits, + ) + + node_stock.additional_properties = d + return node_stock + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/node_tag.py b/poly-ticket-api-client/poly_ticket_api_client/models/node_tag.py new file mode 100644 index 0000000..ac1f1e6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/node_tag.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="NodeTag") + + +@_attrs_define +class NodeTag: + """Serializer (read/write) for `NodeTag` model + + Attributes: + event (int): + event_id (int): + id (int): + name (str): + node_configuration_id (int): + """ + + event: int + event_id: int + id: int + name: str + node_configuration_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + name = self.name + + node_configuration_id = self.node_configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "name": name, + "node_configuration_id": node_configuration_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + name = d.pop("name") + + node_configuration_id = d.pop("node_configuration_id") + + node_tag = cls( + event=event, + event_id=event_id, + id=id, + name=name, + node_configuration_id=node_configuration_id, + ) + + node_tag.additional_properties = d + return node_tag + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/operator_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/operator_enum.py new file mode 100644 index 0000000..830fb5d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/operator_enum.py @@ -0,0 +1,16 @@ +from enum import Enum + + +class OperatorEnum(str, Enum): + CONTAINS = "contains" + EXISTS = "exists" + IS_IN = "is in" + VALUE_0 = ">" + VALUE_1 = ">=" + VALUE_2 = "=" + VALUE_3 = "!=" + VALUE_4 = "<" + VALUE_5 = "<=" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_access_management_place_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_access_management_place_list.py new file mode 100644 index 0000000..ed0a531 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_access_management_place_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.access_management_place import AccessManagementPlace + + +T = TypeVar("T", bound="PaginatedAccessManagementPlaceList") + + +@_attrs_define +class PaginatedAccessManagementPlaceList: + """ + Attributes: + count (int): Example: 123. + results (list['AccessManagementPlace']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["AccessManagementPlace"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.access_management_place import AccessManagementPlace + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = AccessManagementPlace.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_access_management_place_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_access_management_place_list.additional_properties = d + return paginated_access_management_place_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_api_token_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_api_token_list.py new file mode 100644 index 0000000..d2d99de --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_api_token_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.api_token import ApiToken + + +T = TypeVar("T", bound="PaginatedApiTokenList") + + +@_attrs_define +class PaginatedApiTokenList: + """ + Attributes: + count (int): Example: 123. + results (list['ApiToken']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ApiToken"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.api_token import ApiToken + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ApiToken.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_api_token_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_api_token_list.additional_properties = d + return paginated_api_token_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_billing_information_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_billing_information_list.py new file mode 100644 index 0000000..aa2ea8c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_billing_information_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.billing_information import BillingInformation + + +T = TypeVar("T", bound="PaginatedBillingInformationList") + + +@_attrs_define +class PaginatedBillingInformationList: + """ + Attributes: + count (int): Example: 123. + results (list['BillingInformation']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["BillingInformation"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.billing_information import BillingInformation + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = BillingInformation.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_billing_information_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_billing_information_list.additional_properties = d + return paginated_billing_information_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_condition_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_condition_list.py new file mode 100644 index 0000000..6763b13 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_condition_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.condition import Condition + + +T = TypeVar("T", bound="PaginatedConditionList") + + +@_attrs_define +class PaginatedConditionList: + """ + Attributes: + count (int): Example: 123. + results (list['Condition']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Condition"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.condition import Condition + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Condition.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_condition_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_condition_list.additional_properties = d + return paginated_condition_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_confirmation_page_extra_text_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_confirmation_page_extra_text_active_module_list.py new file mode 100644 index 0000000..46e53b3 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_confirmation_page_extra_text_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule + + +T = TypeVar("T", bound="PaginatedConfirmationPageExtraTextActiveModuleList") + + +@_attrs_define +class PaginatedConfirmationPageExtraTextActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ConfirmationPageExtraTextActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ConfirmationPageExtraTextActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.confirmation_page_extra_text_active_module import ConfirmationPageExtraTextActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ConfirmationPageExtraTextActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_confirmation_page_extra_text_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_confirmation_page_extra_text_active_module_list.additional_properties = d + return paginated_confirmation_page_extra_text_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_document_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_document_list.py new file mode 100644 index 0000000..f4bcbb5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_document_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.document import Document + + +T = TypeVar("T", bound="PaginatedDocumentList") + + +@_attrs_define +class PaginatedDocumentList: + """ + Attributes: + count (int): Example: 123. + results (list['Document']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Document"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.document import Document + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Document.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_document_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_document_list.additional_properties = d + return paginated_document_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_event_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_event_list.py new file mode 100644 index 0000000..93da94e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_event_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event import Event + + +T = TypeVar("T", bound="PaginatedEventList") + + +@_attrs_define +class PaginatedEventList: + """ + Attributes: + count (int): Example: 123. + results (list['Event']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Event"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event import Event + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Event.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_event_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_event_list.additional_properties = d + return paginated_event_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_basket_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_basket_list.py new file mode 100644 index 0000000..58b5cbb --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_basket_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.frontend_basket import FrontendBasket + + +T = TypeVar("T", bound="PaginatedFrontendBasketList") + + +@_attrs_define +class PaginatedFrontendBasketList: + """ + Attributes: + count (int): Example: 123. + results (list['FrontendBasket']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["FrontendBasket"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_basket import FrontendBasket + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = FrontendBasket.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_frontend_basket_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_frontend_basket_list.additional_properties = d + return paginated_frontend_basket_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_login_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_login_list.py new file mode 100644 index 0000000..2e7e184 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_frontend_login_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.frontend_login import FrontendLogin + + +T = TypeVar("T", bound="PaginatedFrontendLoginList") + + +@_attrs_define +class PaginatedFrontendLoginList: + """ + Attributes: + count (int): Example: 123. + results (list['FrontendLogin']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["FrontendLogin"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_login import FrontendLogin + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = FrontendLogin.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_frontend_login_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_frontend_login_list.additional_properties = d + return paginated_frontend_login_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_invoice_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_invoice_list.py new file mode 100644 index 0000000..3b9094f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_invoice_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.invoice import Invoice + + +T = TypeVar("T", bound="PaginatedInvoiceList") + + +@_attrs_define +class PaginatedInvoiceList: + """ + Attributes: + count (int): Example: 123. + results (list['Invoice']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Invoice"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.invoice import Invoice + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Invoice.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_invoice_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_invoice_list.additional_properties = d + return paginated_invoice_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_login_method_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_login_method_list.py new file mode 100644 index 0000000..77b54ef --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_login_method_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.login_method import LoginMethod + + +T = TypeVar("T", bound="PaginatedLoginMethodList") + + +@_attrs_define +class PaginatedLoginMethodList: + """ + Attributes: + count (int): Example: 123. + results (list['LoginMethod']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["LoginMethod"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.login_method import LoginMethod + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = LoginMethod.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_login_method_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_login_method_list.additional_properties = d + return paginated_login_method_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_anonymous_login_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_anonymous_login_active_module_list.py new file mode 100644 index 0000000..0f9825b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_anonymous_login_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_anonymous_login_active_module import ModuleAuthAnonymousLoginActiveModule + + +T = TypeVar("T", bound="PaginatedModuleAuthAnonymousLoginActiveModuleList") + + +@_attrs_define +class PaginatedModuleAuthAnonymousLoginActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleAuthAnonymousLoginActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleAuthAnonymousLoginActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_anonymous_login_active_module import ModuleAuthAnonymousLoginActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleAuthAnonymousLoginActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_auth_anonymous_login_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_auth_anonymous_login_active_module_list.additional_properties = d + return paginated_module_auth_anonymous_login_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_third_party_token_login_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_third_party_token_login_active_module_list.py new file mode 100644 index 0000000..64c647f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_third_party_token_login_active_module_list.py @@ -0,0 +1,125 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_third_party_token_login_active_module import ModuleAuthThirdPartyTokenLoginActiveModule + + +T = TypeVar("T", bound="PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList") + + +@_attrs_define +class PaginatedModuleAuthThirdPartyTokenLoginActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleAuthThirdPartyTokenLoginActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleAuthThirdPartyTokenLoginActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_third_party_token_login_active_module import ( + ModuleAuthThirdPartyTokenLoginActiveModule, + ) + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleAuthThirdPartyTokenLoginActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_auth_third_party_token_login_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_auth_third_party_token_login_active_module_list.additional_properties = d + return paginated_module_auth_third_party_token_login_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_trusted_email_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_trusted_email_active_module_list.py new file mode 100644 index 0000000..6776241 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_auth_trusted_email_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_trusted_email_active_module import ModuleAuthTrustedEmailActiveModule + + +T = TypeVar("T", bound="PaginatedModuleAuthTrustedEmailActiveModuleList") + + +@_attrs_define +class PaginatedModuleAuthTrustedEmailActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleAuthTrustedEmailActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleAuthTrustedEmailActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_trusted_email_active_module import ModuleAuthTrustedEmailActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleAuthTrustedEmailActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_auth_trusted_email_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_auth_trusted_email_active_module_list.additional_properties = d + return paginated_module_auth_trusted_email_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_completed_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_completed_active_module_list.py new file mode 100644 index 0000000..5e885ad --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_completed_active_module_list.py @@ -0,0 +1,127 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_email_registration_completed_active_module import ( + ModuleCompletionEmailRegistrationCompletedActiveModule, + ) + + +T = TypeVar("T", bound="PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList") + + +@_attrs_define +class PaginatedModuleCompletionEmailRegistrationCompletedActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleCompletionEmailRegistrationCompletedActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleCompletionEmailRegistrationCompletedActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_email_registration_completed_active_module import ( + ModuleCompletionEmailRegistrationCompletedActiveModule, + ) + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleCompletionEmailRegistrationCompletedActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_completion_email_registration_completed_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_completion_email_registration_completed_active_module_list.additional_properties = d + return paginated_module_completion_email_registration_completed_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_creation_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_creation_active_module_list.py new file mode 100644 index 0000000..9fc4537 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_email_registration_creation_active_module_list.py @@ -0,0 +1,127 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_email_registration_creation_active_module import ( + ModuleCompletionEmailRegistrationCreationActiveModule, + ) + + +T = TypeVar("T", bound="PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList") + + +@_attrs_define +class PaginatedModuleCompletionEmailRegistrationCreationActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleCompletionEmailRegistrationCreationActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleCompletionEmailRegistrationCreationActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_email_registration_creation_active_module import ( + ModuleCompletionEmailRegistrationCreationActiveModule, + ) + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleCompletionEmailRegistrationCreationActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_completion_email_registration_creation_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_completion_email_registration_creation_active_module_list.additional_properties = d + return paginated_module_completion_email_registration_creation_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_pdf_ticket_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_pdf_ticket_active_module_list.py new file mode 100644 index 0000000..f77ded7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_pdf_ticket_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule + + +T = TypeVar("T", bound="PaginatedModuleCompletionPDFTicketActiveModuleList") + + +@_attrs_define +class PaginatedModuleCompletionPDFTicketActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleCompletionPDFTicketActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleCompletionPDFTicketActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_pdf_ticket_active_module import ModuleCompletionPDFTicketActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleCompletionPDFTicketActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_completion_pdf_ticket_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_completion_pdf_ticket_active_module_list.additional_properties = d + return paginated_module_completion_pdf_ticket_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_redirect_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_redirect_active_module_list.py new file mode 100644 index 0000000..c3ad54e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_completion_redirect_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule + + +T = TypeVar("T", bound="PaginatedModuleCompletionRedirectActiveModuleList") + + +@_attrs_define +class PaginatedModuleCompletionRedirectActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleCompletionRedirectActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleCompletionRedirectActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_redirect_active_module import ModuleCompletionRedirectActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleCompletionRedirectActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_completion_redirect_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_completion_redirect_active_module_list.additional_properties = d + return paginated_module_completion_redirect_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_payrexx_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_payrexx_active_module_list.py new file mode 100644 index 0000000..52b3e35 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_payrexx_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule + + +T = TypeVar("T", bound="PaginatedModulePaymentPayrexxActiveModuleList") + + +@_attrs_define +class PaginatedModulePaymentPayrexxActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModulePaymentPayrexxActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModulePaymentPayrexxActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModulePaymentPayrexxActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_payment_payrexx_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_payment_payrexx_active_module_list.additional_properties = d + return paginated_module_payment_payrexx_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_point_of_sale_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_point_of_sale_active_module_list.py new file mode 100644 index 0000000..c5f834e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_payment_point_of_sale_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule + + +T = TypeVar("T", bound="PaginatedModulePaymentPointOfSaleActiveModuleList") + + +@_attrs_define +class PaginatedModulePaymentPointOfSaleActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModulePaymentPointOfSaleActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModulePaymentPointOfSaleActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModulePaymentPointOfSaleActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_payment_point_of_sale_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_payment_point_of_sale_active_module_list.additional_properties = d + return paginated_module_payment_point_of_sale_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_access_management_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_access_management_active_module_list.py new file mode 100644 index 0000000..0583626 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_access_management_active_module_list.py @@ -0,0 +1,127 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_registration_access_management_active_module import ( + ModuleRegistrationAccessManagementActiveModule, + ) + + +T = TypeVar("T", bound="PaginatedModuleRegistrationAccessManagementActiveModuleList") + + +@_attrs_define +class PaginatedModuleRegistrationAccessManagementActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleRegistrationAccessManagementActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleRegistrationAccessManagementActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_registration_access_management_active_module import ( + ModuleRegistrationAccessManagementActiveModule, + ) + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleRegistrationAccessManagementActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_registration_access_management_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_registration_access_management_active_module_list.additional_properties = d + return paginated_module_registration_access_management_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_options_active_module_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_options_active_module_list.py new file mode 100644 index 0000000..2e4e840 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_module_registration_options_active_module_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_registration_options_active_module import ModuleRegistrationOptionsActiveModule + + +T = TypeVar("T", bound="PaginatedModuleRegistrationOptionsActiveModuleList") + + +@_attrs_define +class PaginatedModuleRegistrationOptionsActiveModuleList: + """ + Attributes: + count (int): Example: 123. + results (list['ModuleRegistrationOptionsActiveModule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["ModuleRegistrationOptionsActiveModule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_registration_options_active_module import ModuleRegistrationOptionsActiveModule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ModuleRegistrationOptionsActiveModule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_module_registration_options_active_module_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_module_registration_options_active_module_list.additional_properties = d + return paginated_module_registration_options_active_module_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_list.py new file mode 100644 index 0000000..a76af13 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_access import NodeAccess + + +T = TypeVar("T", bound="PaginatedNodeAccessList") + + +@_attrs_define +class PaginatedNodeAccessList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeAccess']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeAccess"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_access import NodeAccess + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeAccess.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_access_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_access_list.additional_properties = d + return paginated_node_access_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_m2m_list.py new file mode 100644 index 0000000..cc40265 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_access_m2m_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_access_m2m import NodeAccessM2M + + +T = TypeVar("T", bound="PaginatedNodeAccessM2MList") + + +@_attrs_define +class PaginatedNodeAccessM2MList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeAccessM2M']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeAccessM2M"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_access_m2m import NodeAccessM2M + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeAccessM2M.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_access_m2m_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_access_m2m_list.additional_properties = d + return paginated_node_access_m2m_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_list.py new file mode 100644 index 0000000..7245562 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_availability import NodeAvailability + + +T = TypeVar("T", bound="PaginatedNodeAvailabilityList") + + +@_attrs_define +class PaginatedNodeAvailabilityList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeAvailability']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeAvailability"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_availability import NodeAvailability + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeAvailability.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_availability_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_availability_list.additional_properties = d + return paginated_node_availability_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_m2m_list.py new file mode 100644 index 0000000..98060b0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_availability_m2m_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_availability_m2m import NodeAvailabilityM2M + + +T = TypeVar("T", bound="PaginatedNodeAvailabilityM2MList") + + +@_attrs_define +class PaginatedNodeAvailabilityM2MList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeAvailabilityM2M']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeAvailabilityM2M"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_availability_m2m import NodeAvailabilityM2M + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeAvailabilityM2M.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_availability_m2m_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_availability_m2m_list.additional_properties = d + return paginated_node_availability_m2m_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_cart_configuration_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_cart_configuration_list.py new file mode 100644 index 0000000..0102044 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_cart_configuration_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_cart_configuration import NodeCartConfiguration + + +T = TypeVar("T", bound="PaginatedNodeCartConfigurationList") + + +@_attrs_define +class PaginatedNodeCartConfigurationList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeCartConfiguration']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeCartConfiguration"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_cart_configuration import NodeCartConfiguration + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeCartConfiguration.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_cart_configuration_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_cart_configuration_list.additional_properties = d + return paginated_node_cart_configuration_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_configuration_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_configuration_list.py new file mode 100644 index 0000000..69b2fad --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_configuration_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_configuration import NodeConfiguration + + +T = TypeVar("T", bound="PaginatedNodeConfigurationList") + + +@_attrs_define +class PaginatedNodeConfigurationList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeConfiguration']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeConfiguration"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_configuration import NodeConfiguration + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeConfiguration.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_configuration_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_configuration_list.additional_properties = d + return paginated_node_configuration_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_list.py new file mode 100644 index 0000000..f0d3050 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_extra_info_group import NodeExtraInfoGroup + + +T = TypeVar("T", bound="PaginatedNodeExtraInfoGroupList") + + +@_attrs_define +class PaginatedNodeExtraInfoGroupList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeExtraInfoGroup']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeExtraInfoGroup"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_extra_info_group import NodeExtraInfoGroup + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeExtraInfoGroup.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_extra_info_group_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_extra_info_group_list.additional_properties = d + return paginated_node_extra_info_group_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_m2m_list.py new file mode 100644 index 0000000..e21549c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_group_m2m_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_extra_info_group_m2m import NodeExtraInfoGroupM2M + + +T = TypeVar("T", bound="PaginatedNodeExtraInfoGroupM2MList") + + +@_attrs_define +class PaginatedNodeExtraInfoGroupM2MList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeExtraInfoGroupM2M']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeExtraInfoGroupM2M"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_extra_info_group_m2m import NodeExtraInfoGroupM2M + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeExtraInfoGroupM2M.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_extra_info_group_m2m_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_extra_info_group_m2m_list.additional_properties = d + return paginated_node_extra_info_group_m2m_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_list.py new file mode 100644 index 0000000..2d7146a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_extra_info_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_extra_info import NodeExtraInfo + + +T = TypeVar("T", bound="PaginatedNodeExtraInfoList") + + +@_attrs_define +class PaginatedNodeExtraInfoList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeExtraInfo']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeExtraInfo"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_extra_info import NodeExtraInfo + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeExtraInfo.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_extra_info_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_extra_info_list.additional_properties = d + return paginated_node_extra_info_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_list.py new file mode 100644 index 0000000..cfbbc8d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_limit import NodeLimit + + +T = TypeVar("T", bound="PaginatedNodeLimitList") + + +@_attrs_define +class PaginatedNodeLimitList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeLimit']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeLimit"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_limit import NodeLimit + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeLimit.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_limit_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_limit_list.additional_properties = d + return paginated_node_limit_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_m2m_list.py new file mode 100644 index 0000000..766d4e2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_limit_m2m_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_limit_m2m import NodeLimitM2M + + +T = TypeVar("T", bound="PaginatedNodeLimitM2MList") + + +@_attrs_define +class PaginatedNodeLimitM2MList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeLimitM2M']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeLimitM2M"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_limit_m2m import NodeLimitM2M + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeLimitM2M.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_limit_m2m_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_limit_m2m_list.additional_properties = d + return paginated_node_limit_m2m_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_list.py new file mode 100644 index 0000000..b830d88 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node import Node + + +T = TypeVar("T", bound="PaginatedNodeList") + + +@_attrs_define +class PaginatedNodeList: + """ + Attributes: + count (int): Example: 123. + results (list['Node']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Node"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node import Node + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Node.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_list.additional_properties = d + return paginated_node_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_list.py new file mode 100644 index 0000000..c15b48e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_price_rule import NodePriceRule + + +T = TypeVar("T", bound="PaginatedNodePriceRuleList") + + +@_attrs_define +class PaginatedNodePriceRuleList: + """ + Attributes: + count (int): Example: 123. + results (list['NodePriceRule']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodePriceRule"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_price_rule import NodePriceRule + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodePriceRule.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_price_rule_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_price_rule_list.additional_properties = d + return paginated_node_price_rule_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_m2m_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_m2m_list.py new file mode 100644 index 0000000..a4c4eff --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_price_rule_m2m_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_price_rule_m2m import NodePriceRuleM2M + + +T = TypeVar("T", bound="PaginatedNodePriceRuleM2MList") + + +@_attrs_define +class PaginatedNodePriceRuleM2MList: + """ + Attributes: + count (int): Example: 123. + results (list['NodePriceRuleM2M']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodePriceRuleM2M"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_price_rule_m2m import NodePriceRuleM2M + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodePriceRuleM2M.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_price_rule_m2m_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_price_rule_m2m_list.additional_properties = d + return paginated_node_price_rule_m2m_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_tag_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_tag_list.py new file mode 100644 index 0000000..ac25534 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_node_tag_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_tag import NodeTag + + +T = TypeVar("T", bound="PaginatedNodeTagList") + + +@_attrs_define +class PaginatedNodeTagList: + """ + Attributes: + count (int): Example: 123. + results (list['NodeTag']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["NodeTag"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_tag import NodeTag + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = NodeTag.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_node_tag_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_node_tag_list.additional_properties = d + return paginated_node_tag_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_intent_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_intent_list.py new file mode 100644 index 0000000..fda4bb6 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_intent_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.payment_intent import PaymentIntent + + +T = TypeVar("T", bound="PaginatedPaymentIntentList") + + +@_attrs_define +class PaginatedPaymentIntentList: + """ + Attributes: + count (int): Example: 123. + results (list['PaymentIntent']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["PaymentIntent"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.payment_intent import PaymentIntent + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = PaymentIntent.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_payment_intent_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_payment_intent_list.additional_properties = d + return paginated_payment_intent_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_method_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_method_list.py new file mode 100644 index 0000000..b6e8766 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_payment_method_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.payment_method import PaymentMethod + + +T = TypeVar("T", bound="PaginatedPaymentMethodList") + + +@_attrs_define +class PaginatedPaymentMethodList: + """ + Attributes: + count (int): Example: 123. + results (list['PaymentMethod']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["PaymentMethod"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.payment_method import PaymentMethod + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = PaymentMethod.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_payment_method_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_payment_method_list.additional_properties = d + return paginated_payment_method_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_point_of_sale_place_read_only_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_point_of_sale_place_read_only_list.py new file mode 100644 index 0000000..b0609a1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_point_of_sale_place_read_only_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly + + +T = TypeVar("T", bound="PaginatedPointOfSalePlaceReadOnlyList") + + +@_attrs_define +class PaginatedPointOfSalePlaceReadOnlyList: + """ + Attributes: + count (int): Example: 123. + results (list['PointOfSalePlaceReadOnly']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["PointOfSalePlaceReadOnly"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = PointOfSalePlaceReadOnly.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_point_of_sale_place_read_only_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_point_of_sale_place_read_only_list.additional_properties = d + return paginated_point_of_sale_place_read_only_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_poly_ticket_user_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_poly_ticket_user_list.py new file mode 100644 index 0000000..fd324df --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_poly_ticket_user_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.poly_ticket_user import PolyTicketUser + + +T = TypeVar("T", bound="PaginatedPolyTicketUserList") + + +@_attrs_define +class PaginatedPolyTicketUserList: + """ + Attributes: + count (int): Example: 123. + results (list['PolyTicketUser']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["PolyTicketUser"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.poly_ticket_user import PolyTicketUser + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = PolyTicketUser.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_poly_ticket_user_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_poly_ticket_user_list.additional_properties = d + return paginated_poly_ticket_user_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_promotion_code_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_promotion_code_list.py new file mode 100644 index 0000000..5cddcc2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_promotion_code_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.promotion_code import PromotionCode + + +T = TypeVar("T", bound="PaginatedPromotionCodeList") + + +@_attrs_define +class PaginatedPromotionCodeList: + """ + Attributes: + count (int): Example: 123. + results (list['PromotionCode']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["PromotionCode"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.promotion_code import PromotionCode + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = PromotionCode.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_promotion_code_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_promotion_code_list.additional_properties = d + return paginated_promotion_code_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_group_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_group_list.py new file mode 100644 index 0000000..54a9a4f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_group_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.selected_node_extra_info_group import SelectedNodeExtraInfoGroup + + +T = TypeVar("T", bound="PaginatedSelectedNodeExtraInfoGroupList") + + +@_attrs_define +class PaginatedSelectedNodeExtraInfoGroupList: + """ + Attributes: + count (int): Example: 123. + results (list['SelectedNodeExtraInfoGroup']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["SelectedNodeExtraInfoGroup"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.selected_node_extra_info_group import SelectedNodeExtraInfoGroup + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = SelectedNodeExtraInfoGroup.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_selected_node_extra_info_group_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_selected_node_extra_info_group_list.additional_properties = d + return paginated_selected_node_extra_info_group_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_list.py new file mode 100644 index 0000000..ad75426 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_extra_info_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.selected_node_extra_info import SelectedNodeExtraInfo + + +T = TypeVar("T", bound="PaginatedSelectedNodeExtraInfoList") + + +@_attrs_define +class PaginatedSelectedNodeExtraInfoList: + """ + Attributes: + count (int): Example: 123. + results (list['SelectedNodeExtraInfo']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["SelectedNodeExtraInfo"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.selected_node_extra_info import SelectedNodeExtraInfo + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = SelectedNodeExtraInfo.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_selected_node_extra_info_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_selected_node_extra_info_list.additional_properties = d + return paginated_selected_node_extra_info_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_list.py new file mode 100644 index 0000000..71e0d9d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_node_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.selected_node import SelectedNode + + +T = TypeVar("T", bound="PaginatedSelectedNodeList") + + +@_attrs_define +class PaginatedSelectedNodeList: + """ + Attributes: + count (int): Example: 123. + results (list['SelectedNode']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["SelectedNode"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.selected_node import SelectedNode + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = SelectedNode.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_selected_node_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_selected_node_list.additional_properties = d + return paginated_selected_node_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_promotion_code_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_promotion_code_list.py new file mode 100644 index 0000000..0e0e316 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_selected_promotion_code_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.selected_promotion_code import SelectedPromotionCode + + +T = TypeVar("T", bound="PaginatedSelectedPromotionCodeList") + + +@_attrs_define +class PaginatedSelectedPromotionCodeList: + """ + Attributes: + count (int): Example: 123. + results (list['SelectedPromotionCode']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["SelectedPromotionCode"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.selected_promotion_code import SelectedPromotionCode + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = SelectedPromotionCode.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_selected_promotion_code_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_selected_promotion_code_list.additional_properties = d + return paginated_selected_promotion_code_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_statement_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_statement_list.py new file mode 100644 index 0000000..d7e3992 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_statement_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.statement import Statement + + +T = TypeVar("T", bound="PaginatedStatementList") + + +@_attrs_define +class PaginatedStatementList: + """ + Attributes: + count (int): Example: 123. + results (list['Statement']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Statement"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.statement import Statement + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Statement.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_statement_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_statement_list.additional_properties = d + return paginated_statement_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_list.py new file mode 100644 index 0000000..bab1f8b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.unit import Unit + + +T = TypeVar("T", bound="PaginatedUnitList") + + +@_attrs_define +class PaginatedUnitList: + """ + Attributes: + count (int): Example: 123. + results (list['Unit']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["Unit"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.unit import Unit + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = Unit.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_unit_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_unit_list.additional_properties = d + return paginated_unit_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_membership_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_membership_list.py new file mode 100644 index 0000000..39c6369 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_unit_membership_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.unit_membership import UnitMembership + + +T = TypeVar("T", bound="PaginatedUnitMembershipList") + + +@_attrs_define +class PaginatedUnitMembershipList: + """ + Attributes: + count (int): Example: 123. + results (list['UnitMembership']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["UnitMembership"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.unit_membership import UnitMembership + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = UnitMembership.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_unit_membership_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_unit_membership_list.additional_properties = d + return paginated_unit_membership_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/paginated_uploaded_image_list.py b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_uploaded_image_list.py new file mode 100644 index 0000000..1aa8668 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/paginated_uploaded_image_list.py @@ -0,0 +1,123 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.uploaded_image import UploadedImage + + +T = TypeVar("T", bound="PaginatedUploadedImageList") + + +@_attrs_define +class PaginatedUploadedImageList: + """ + Attributes: + count (int): Example: 123. + results (list['UploadedImage']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&page_limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&page_limit=100. + """ + + count: int + results: list["UploadedImage"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "results": results, + } + ) + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.uploaded_image import UploadedImage + + d = dict(src_dict) + count = d.pop("count") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = UploadedImage.from_dict(results_item_data) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) + + paginated_uploaded_image_list = cls( + count=count, + results=results, + next_=next_, + previous=previous, + ) + + paginated_uploaded_image_list.additional_properties = d + return paginated_uploaded_image_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/password_change_success.py b/poly-ticket-api-client/poly_ticket_api_client/models/password_change_success.py new file mode 100644 index 0000000..95390a0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/password_change_success.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PasswordChangeSuccess") + + +@_attrs_define +class PasswordChangeSuccess: + """ + Attributes: + message (str): Your password has been changed. Please login again. + """ + + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message") + + password_change_success = cls( + message=message, + ) + + password_change_success.additional_properties = d + return password_change_success + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/password_reset_success.py b/poly-ticket-api-client/poly_ticket_api_client/models/password_reset_success.py new file mode 100644 index 0000000..18b76bf --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/password_reset_success.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PasswordResetSuccess") + + +@_attrs_define +class PasswordResetSuccess: + """ + Attributes: + message (str): Your password has been reset. Please login again. + """ + + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message") + + password_reset_success = cls( + message=message, + ) + + password_reset_success.additional_properties = d + return password_reset_success + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_access_management_place.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_access_management_place.py new file mode 100644 index 0000000..2c078a4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_access_management_place.py @@ -0,0 +1,158 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedAccessManagementPlace") + + +@_attrs_define +class PatchedAccessManagementPlace: + """Serializer for AccessManagementPlace model + + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + configuration (Union[Unset, int]): + expires_at (Union[None, Unset, datetime.datetime]): + monomode_testing_url (Union[Unset, str]): URL of the access management scanner for this place, in testing mode. + monomode_url (Union[Unset, str]): URL of the access management scanner for this place. + """ + + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + configuration: Union[Unset, int] = UNSET + expires_at: Union[None, Unset, datetime.datetime] = UNSET + monomode_testing_url: Union[Unset, str] = UNSET + monomode_url: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + configuration = self.configuration + + expires_at: Union[None, Unset, str] + if isinstance(self.expires_at, Unset): + expires_at = UNSET + elif isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + monomode_testing_url = self.monomode_testing_url + + monomode_url = self.monomode_url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if configuration is not UNSET: + field_dict["configuration"] = configuration + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if monomode_testing_url is not UNSET: + field_dict["monomode_testing_url"] = monomode_testing_url + if monomode_url is not UNSET: + field_dict["monomode_url"] = monomode_url + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.configuration, Unset): + files.append(("configuration", (None, str(self.configuration).encode(), "text/plain"))) + + if not isinstance(self.expires_at, Unset): + if isinstance(self.expires_at, datetime.datetime): + files.append(("expires_at", (None, self.expires_at.isoformat().encode(), "text/plain"))) + else: + files.append(("expires_at", (None, str(self.expires_at).encode(), "text/plain"))) + + if not isinstance(self.monomode_testing_url, Unset): + files.append(("monomode_testing_url", (None, str(self.monomode_testing_url).encode(), "text/plain"))) + + if not isinstance(self.monomode_url, Unset): + files.append(("monomode_url", (None, str(self.monomode_url).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + configuration = d.pop("configuration", UNSET) + + def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = isoparse(data) + + return expires_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) + + monomode_testing_url = d.pop("monomode_testing_url", UNSET) + + monomode_url = d.pop("monomode_url", UNSET) + + patched_access_management_place = cls( + id=id, + name=name, + configuration=configuration, + expires_at=expires_at, + monomode_testing_url=monomode_testing_url, + monomode_url=monomode_url, + ) + + patched_access_management_place.additional_properties = d + return patched_access_management_place + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_condition.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_condition.py new file mode 100644 index 0000000..e1bce14 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_condition.py @@ -0,0 +1,141 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.logical_operator_enum import LogicalOperatorEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedCondition") + + +@_attrs_define +class PatchedCondition: + """Serializer (read/write) for `Condition` model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + name (Union[Unset, str]): + logical_operator (Union[Unset, LogicalOperatorEnum]): * `or` - OR + * `and` - AND + is_implicit (Union[Unset, bool]): can store a combination of conditions as a single condition + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + logical_operator: Union[Unset, LogicalOperatorEnum] = UNSET + is_implicit: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + name = self.name + + logical_operator: Union[Unset, str] = UNSET + if not isinstance(self.logical_operator, Unset): + logical_operator = self.logical_operator.value + + is_implicit = self.is_implicit + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if logical_operator is not UNSET: + field_dict["logical_operator"] = logical_operator + if is_implicit is not UNSET: + field_dict["is_implicit"] = is_implicit + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.logical_operator, Unset): + files.append(("logical_operator", (None, str(self.logical_operator.value).encode(), "text/plain"))) + + if not isinstance(self.is_implicit, Unset): + files.append(("is_implicit", (None, str(self.is_implicit).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + _logical_operator = d.pop("logical_operator", UNSET) + logical_operator: Union[Unset, LogicalOperatorEnum] + if isinstance(_logical_operator, Unset): + logical_operator = UNSET + else: + logical_operator = LogicalOperatorEnum(_logical_operator) + + is_implicit = d.pop("is_implicit", UNSET) + + patched_condition = cls( + event=event, + event_id=event_id, + id=id, + name=name, + logical_operator=logical_operator, + is_implicit=is_implicit, + ) + + patched_condition.additional_properties = d + return patched_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_confirmation_page_extra_text_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_confirmation_page_extra_text_active_module.py new file mode 100644 index 0000000..e87ce8b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_confirmation_page_extra_text_active_module.py @@ -0,0 +1,124 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.confirmation_page_extra_text_configuration import ConfirmationPageExtraTextConfiguration + + +T = TypeVar("T", bound="PatchedConfirmationPageExtraTextActiveModule") + + +@_attrs_define +class PatchedConfirmationPageExtraTextActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionConfirmationPageExtraText` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ConfirmationPageExtraTextConfiguration]): Serializer for + `ModuleCompletionConfirmationPageExtraTextConfiguration` nested in + `ConfirmationPageExtraTextActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ConfirmationPageExtraTextConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.confirmation_page_extra_text_configuration import ConfirmationPageExtraTextConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ConfirmationPageExtraTextConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ConfirmationPageExtraTextConfiguration.from_dict(_config) + + patched_confirmation_page_extra_text_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_confirmation_page_extra_text_active_module.additional_properties = d + return patched_confirmation_page_extra_text_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_event.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_event.py new file mode 100644 index 0000000..866a927 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_event.py @@ -0,0 +1,741 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..models.event_status_enum import EventStatusEnum +from ..models.moderation_status_enum import ModerationStatusEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedEvent") + + +@_attrs_define +class PatchedEvent: + """Serializer for Node model + + Attributes: + id (Union[Unset, int]): + unit_id (Union[Unset, int]): + name (Union[Unset, str]): + status (Union[Unset, EventStatusEnum]): * `draft` - Draft + * `public` - Public + * `closed` - Closed (force) + * `archived` - Archived + moderation_status (Union[Unset, ModerationStatusEnum]): * `not_requested` - Not requested + * `requested` - Requested + * `change_requested` - Change requested + * `validated` - Validated + are_registrations_allowed (Union[Unset, bool]): + are_payments_allowed (Union[Unset, bool]): + registrations_start_date (Union[None, Unset, datetime.datetime]): + payments_start_date (Union[None, Unset, datetime.datetime]): + payments_end_date (Union[None, Unset, datetime.datetime]): + closed_start_date (Union[None, Unset, datetime.date]): + registrations_end_date (Union[None, Unset, datetime.datetime]): + start_date (Union[None, Unset, datetime.datetime]): + end_date (Union[None, Unset, datetime.datetime]): + custom_key (Union[Unset, str]): + welcome_text (Union[Unset, str]): Welcome text displayed on the Ticket Office event page. Some restricted HTML + markup is allowed, everything else is filtered out automatically. + frontend_url (Union[Unset, str]): External url provided by the organizer. I.e. their website or social media + page + frontend_title (Union[Unset, str]): Main name of the event shown to end users. I.e. shown on the Ticket Office + webpage + frontend_organizers (Union[Unset, str]): Name of the organizer, displayed on the Ticket Office event page + frontend_path (Union[Unset, str]): Root of public path of the event url + multiple_registration_per_login (Union[Unset, bool]): + user_nickname_enabled (Union[Unset, bool]): + user_registration_link_unique (Union[Unset, bool]): + description_header_image (Union[None, Unset, int]): + terms_of_service (Union[Unset, str]): + location_text (Union[Unset, str]): + location (Union[None, Unset, str]): + location_address (Union[Unset, str]): + is_public_visible (Union[Unset, bool]): + is_unit_visible (Union[Unset, bool]): + ticket_office_url (Union[Unset, str]): + ticket_office_testing_url (Union[Unset, str]): + is_basket_item_modification_allowed (Union[Unset, bool]): This field informs the front end on what actions + should be allowed or prevented, in the front end only. + is_in_lausanne (Union[Unset, bool]): if the event physically takes place in the city of Lausanne, set this + boolean so that taxes are calculated properly + is_status_public (Union[Unset, bool]): + """ + + id: Union[Unset, int] = UNSET + unit_id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + status: Union[Unset, EventStatusEnum] = UNSET + moderation_status: Union[Unset, ModerationStatusEnum] = UNSET + are_registrations_allowed: Union[Unset, bool] = UNSET + are_payments_allowed: Union[Unset, bool] = UNSET + registrations_start_date: Union[None, Unset, datetime.datetime] = UNSET + payments_start_date: Union[None, Unset, datetime.datetime] = UNSET + payments_end_date: Union[None, Unset, datetime.datetime] = UNSET + closed_start_date: Union[None, Unset, datetime.date] = UNSET + registrations_end_date: Union[None, Unset, datetime.datetime] = UNSET + start_date: Union[None, Unset, datetime.datetime] = UNSET + end_date: Union[None, Unset, datetime.datetime] = UNSET + custom_key: Union[Unset, str] = UNSET + welcome_text: Union[Unset, str] = UNSET + frontend_url: Union[Unset, str] = UNSET + frontend_title: Union[Unset, str] = UNSET + frontend_organizers: Union[Unset, str] = UNSET + frontend_path: Union[Unset, str] = UNSET + multiple_registration_per_login: Union[Unset, bool] = UNSET + user_nickname_enabled: Union[Unset, bool] = UNSET + user_registration_link_unique: Union[Unset, bool] = UNSET + description_header_image: Union[None, Unset, int] = UNSET + terms_of_service: Union[Unset, str] = UNSET + location_text: Union[Unset, str] = UNSET + location: Union[None, Unset, str] = UNSET + location_address: Union[Unset, str] = UNSET + is_public_visible: Union[Unset, bool] = UNSET + is_unit_visible: Union[Unset, bool] = UNSET + ticket_office_url: Union[Unset, str] = UNSET + ticket_office_testing_url: Union[Unset, str] = UNSET + is_basket_item_modification_allowed: Union[Unset, bool] = UNSET + is_in_lausanne: Union[Unset, bool] = UNSET + is_status_public: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + unit_id = self.unit_id + + name = self.name + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + moderation_status: Union[Unset, str] = UNSET + if not isinstance(self.moderation_status, Unset): + moderation_status = self.moderation_status.value + + are_registrations_allowed = self.are_registrations_allowed + + are_payments_allowed = self.are_payments_allowed + + registrations_start_date: Union[None, Unset, str] + if isinstance(self.registrations_start_date, Unset): + registrations_start_date = UNSET + elif isinstance(self.registrations_start_date, datetime.datetime): + registrations_start_date = self.registrations_start_date.isoformat() + else: + registrations_start_date = self.registrations_start_date + + payments_start_date: Union[None, Unset, str] + if isinstance(self.payments_start_date, Unset): + payments_start_date = UNSET + elif isinstance(self.payments_start_date, datetime.datetime): + payments_start_date = self.payments_start_date.isoformat() + else: + payments_start_date = self.payments_start_date + + payments_end_date: Union[None, Unset, str] + if isinstance(self.payments_end_date, Unset): + payments_end_date = UNSET + elif isinstance(self.payments_end_date, datetime.datetime): + payments_end_date = self.payments_end_date.isoformat() + else: + payments_end_date = self.payments_end_date + + closed_start_date: Union[None, Unset, str] + if isinstance(self.closed_start_date, Unset): + closed_start_date = UNSET + elif isinstance(self.closed_start_date, datetime.date): + closed_start_date = self.closed_start_date.isoformat() + else: + closed_start_date = self.closed_start_date + + registrations_end_date: Union[None, Unset, str] + if isinstance(self.registrations_end_date, Unset): + registrations_end_date = UNSET + elif isinstance(self.registrations_end_date, datetime.datetime): + registrations_end_date = self.registrations_end_date.isoformat() + else: + registrations_end_date = self.registrations_end_date + + start_date: Union[None, Unset, str] + if isinstance(self.start_date, Unset): + start_date = UNSET + elif isinstance(self.start_date, datetime.datetime): + start_date = self.start_date.isoformat() + else: + start_date = self.start_date + + end_date: Union[None, Unset, str] + if isinstance(self.end_date, Unset): + end_date = UNSET + elif isinstance(self.end_date, datetime.datetime): + end_date = self.end_date.isoformat() + else: + end_date = self.end_date + + custom_key = self.custom_key + + welcome_text = self.welcome_text + + frontend_url = self.frontend_url + + frontend_title = self.frontend_title + + frontend_organizers = self.frontend_organizers + + frontend_path = self.frontend_path + + multiple_registration_per_login = self.multiple_registration_per_login + + user_nickname_enabled = self.user_nickname_enabled + + user_registration_link_unique = self.user_registration_link_unique + + description_header_image: Union[None, Unset, int] + if isinstance(self.description_header_image, Unset): + description_header_image = UNSET + else: + description_header_image = self.description_header_image + + terms_of_service = self.terms_of_service + + location_text = self.location_text + + location: Union[None, Unset, str] + if isinstance(self.location, Unset): + location = UNSET + else: + location = self.location + + location_address = self.location_address + + is_public_visible = self.is_public_visible + + is_unit_visible = self.is_unit_visible + + ticket_office_url = self.ticket_office_url + + ticket_office_testing_url = self.ticket_office_testing_url + + is_basket_item_modification_allowed = self.is_basket_item_modification_allowed + + is_in_lausanne = self.is_in_lausanne + + is_status_public = self.is_status_public + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if unit_id is not UNSET: + field_dict["unit_id"] = unit_id + if name is not UNSET: + field_dict["name"] = name + if status is not UNSET: + field_dict["status"] = status + if moderation_status is not UNSET: + field_dict["moderation_status"] = moderation_status + if are_registrations_allowed is not UNSET: + field_dict["are_registrations_allowed"] = are_registrations_allowed + if are_payments_allowed is not UNSET: + field_dict["are_payments_allowed"] = are_payments_allowed + if registrations_start_date is not UNSET: + field_dict["registrations_start_date"] = registrations_start_date + if payments_start_date is not UNSET: + field_dict["payments_start_date"] = payments_start_date + if payments_end_date is not UNSET: + field_dict["payments_end_date"] = payments_end_date + if closed_start_date is not UNSET: + field_dict["closed_start_date"] = closed_start_date + if registrations_end_date is not UNSET: + field_dict["registrations_end_date"] = registrations_end_date + if start_date is not UNSET: + field_dict["start_date"] = start_date + if end_date is not UNSET: + field_dict["end_date"] = end_date + if custom_key is not UNSET: + field_dict["custom_key"] = custom_key + if welcome_text is not UNSET: + field_dict["welcome_text"] = welcome_text + if frontend_url is not UNSET: + field_dict["frontend_url"] = frontend_url + if frontend_title is not UNSET: + field_dict["frontend_title"] = frontend_title + if frontend_organizers is not UNSET: + field_dict["frontend_organizers"] = frontend_organizers + if frontend_path is not UNSET: + field_dict["frontend_path"] = frontend_path + if multiple_registration_per_login is not UNSET: + field_dict["multiple_registration_per_login"] = multiple_registration_per_login + if user_nickname_enabled is not UNSET: + field_dict["user_nickname_enabled"] = user_nickname_enabled + if user_registration_link_unique is not UNSET: + field_dict["user_registration_link_unique"] = user_registration_link_unique + if description_header_image is not UNSET: + field_dict["description_header_image"] = description_header_image + if terms_of_service is not UNSET: + field_dict["terms_of_service"] = terms_of_service + if location_text is not UNSET: + field_dict["location_text"] = location_text + if location is not UNSET: + field_dict["location"] = location + if location_address is not UNSET: + field_dict["location_address"] = location_address + if is_public_visible is not UNSET: + field_dict["is_public_visible"] = is_public_visible + if is_unit_visible is not UNSET: + field_dict["is_unit_visible"] = is_unit_visible + if ticket_office_url is not UNSET: + field_dict["ticket_office_url"] = ticket_office_url + if ticket_office_testing_url is not UNSET: + field_dict["ticket_office_testing_url"] = ticket_office_testing_url + if is_basket_item_modification_allowed is not UNSET: + field_dict["is_basket_item_modification_allowed"] = is_basket_item_modification_allowed + if is_in_lausanne is not UNSET: + field_dict["is_in_lausanne"] = is_in_lausanne + if is_status_public is not UNSET: + field_dict["is_status_public"] = is_status_public + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.unit_id, Unset): + files.append(("unit_id", (None, str(self.unit_id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.status, Unset): + files.append(("status", (None, str(self.status.value).encode(), "text/plain"))) + + if not isinstance(self.moderation_status, Unset): + files.append(("moderation_status", (None, str(self.moderation_status.value).encode(), "text/plain"))) + + if not isinstance(self.are_registrations_allowed, Unset): + files.append( + ("are_registrations_allowed", (None, str(self.are_registrations_allowed).encode(), "text/plain")) + ) + + if not isinstance(self.are_payments_allowed, Unset): + files.append(("are_payments_allowed", (None, str(self.are_payments_allowed).encode(), "text/plain"))) + + if not isinstance(self.registrations_start_date, Unset): + if isinstance(self.registrations_start_date, datetime.datetime): + files.append( + ( + "registrations_start_date", + (None, self.registrations_start_date.isoformat().encode(), "text/plain"), + ) + ) + else: + files.append( + ("registrations_start_date", (None, str(self.registrations_start_date).encode(), "text/plain")) + ) + + if not isinstance(self.payments_start_date, Unset): + if isinstance(self.payments_start_date, datetime.datetime): + files.append( + ("payments_start_date", (None, self.payments_start_date.isoformat().encode(), "text/plain")) + ) + else: + files.append(("payments_start_date", (None, str(self.payments_start_date).encode(), "text/plain"))) + + if not isinstance(self.payments_end_date, Unset): + if isinstance(self.payments_end_date, datetime.datetime): + files.append(("payments_end_date", (None, self.payments_end_date.isoformat().encode(), "text/plain"))) + else: + files.append(("payments_end_date", (None, str(self.payments_end_date).encode(), "text/plain"))) + + if not isinstance(self.closed_start_date, Unset): + if isinstance(self.closed_start_date, datetime.date): + files.append(("closed_start_date", (None, self.closed_start_date.isoformat().encode(), "text/plain"))) + else: + files.append(("closed_start_date", (None, str(self.closed_start_date).encode(), "text/plain"))) + + if not isinstance(self.registrations_end_date, Unset): + if isinstance(self.registrations_end_date, datetime.datetime): + files.append( + ("registrations_end_date", (None, self.registrations_end_date.isoformat().encode(), "text/plain")) + ) + else: + files.append( + ("registrations_end_date", (None, str(self.registrations_end_date).encode(), "text/plain")) + ) + + if not isinstance(self.start_date, Unset): + if isinstance(self.start_date, datetime.datetime): + files.append(("start_date", (None, self.start_date.isoformat().encode(), "text/plain"))) + else: + files.append(("start_date", (None, str(self.start_date).encode(), "text/plain"))) + + if not isinstance(self.end_date, Unset): + if isinstance(self.end_date, datetime.datetime): + files.append(("end_date", (None, self.end_date.isoformat().encode(), "text/plain"))) + else: + files.append(("end_date", (None, str(self.end_date).encode(), "text/plain"))) + + if not isinstance(self.custom_key, Unset): + files.append(("custom_key", (None, str(self.custom_key).encode(), "text/plain"))) + + if not isinstance(self.welcome_text, Unset): + files.append(("welcome_text", (None, str(self.welcome_text).encode(), "text/plain"))) + + if not isinstance(self.frontend_url, Unset): + files.append(("frontend_url", (None, str(self.frontend_url).encode(), "text/plain"))) + + if not isinstance(self.frontend_title, Unset): + files.append(("frontend_title", (None, str(self.frontend_title).encode(), "text/plain"))) + + if not isinstance(self.frontend_organizers, Unset): + files.append(("frontend_organizers", (None, str(self.frontend_organizers).encode(), "text/plain"))) + + if not isinstance(self.frontend_path, Unset): + files.append(("frontend_path", (None, str(self.frontend_path).encode(), "text/plain"))) + + if not isinstance(self.multiple_registration_per_login, Unset): + files.append( + ( + "multiple_registration_per_login", + (None, str(self.multiple_registration_per_login).encode(), "text/plain"), + ) + ) + + if not isinstance(self.user_nickname_enabled, Unset): + files.append(("user_nickname_enabled", (None, str(self.user_nickname_enabled).encode(), "text/plain"))) + + if not isinstance(self.user_registration_link_unique, Unset): + files.append( + ( + "user_registration_link_unique", + (None, str(self.user_registration_link_unique).encode(), "text/plain"), + ) + ) + + if not isinstance(self.description_header_image, Unset): + if isinstance(self.description_header_image, int): + files.append( + ("description_header_image", (None, str(self.description_header_image).encode(), "text/plain")) + ) + else: + files.append( + ("description_header_image", (None, str(self.description_header_image).encode(), "text/plain")) + ) + + if not isinstance(self.terms_of_service, Unset): + files.append(("terms_of_service", (None, str(self.terms_of_service).encode(), "text/plain"))) + + if not isinstance(self.location_text, Unset): + files.append(("location_text", (None, str(self.location_text).encode(), "text/plain"))) + + if not isinstance(self.location, Unset): + if isinstance(self.location, str): + files.append(("location", (None, str(self.location).encode(), "text/plain"))) + else: + files.append(("location", (None, str(self.location).encode(), "text/plain"))) + + if not isinstance(self.location_address, Unset): + files.append(("location_address", (None, str(self.location_address).encode(), "text/plain"))) + + if not isinstance(self.is_public_visible, Unset): + files.append(("is_public_visible", (None, str(self.is_public_visible).encode(), "text/plain"))) + + if not isinstance(self.is_unit_visible, Unset): + files.append(("is_unit_visible", (None, str(self.is_unit_visible).encode(), "text/plain"))) + + if not isinstance(self.ticket_office_url, Unset): + files.append(("ticket_office_url", (None, str(self.ticket_office_url).encode(), "text/plain"))) + + if not isinstance(self.ticket_office_testing_url, Unset): + files.append( + ("ticket_office_testing_url", (None, str(self.ticket_office_testing_url).encode(), "text/plain")) + ) + + if not isinstance(self.is_basket_item_modification_allowed, Unset): + files.append( + ( + "is_basket_item_modification_allowed", + (None, str(self.is_basket_item_modification_allowed).encode(), "text/plain"), + ) + ) + + if not isinstance(self.is_in_lausanne, Unset): + files.append(("is_in_lausanne", (None, str(self.is_in_lausanne).encode(), "text/plain"))) + + if not isinstance(self.is_status_public, Unset): + files.append(("is_status_public", (None, str(self.is_status_public).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + unit_id = d.pop("unit_id", UNSET) + + name = d.pop("name", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusEnum] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusEnum(_status) + + _moderation_status = d.pop("moderation_status", UNSET) + moderation_status: Union[Unset, ModerationStatusEnum] + if isinstance(_moderation_status, Unset): + moderation_status = UNSET + else: + moderation_status = ModerationStatusEnum(_moderation_status) + + are_registrations_allowed = d.pop("are_registrations_allowed", UNSET) + + are_payments_allowed = d.pop("are_payments_allowed", UNSET) + + def _parse_registrations_start_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + registrations_start_date_type_0 = isoparse(data) + + return registrations_start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + registrations_start_date = _parse_registrations_start_date(d.pop("registrations_start_date", UNSET)) + + def _parse_payments_start_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + payments_start_date_type_0 = isoparse(data) + + return payments_start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + payments_start_date = _parse_payments_start_date(d.pop("payments_start_date", UNSET)) + + def _parse_payments_end_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + payments_end_date_type_0 = isoparse(data) + + return payments_end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + payments_end_date = _parse_payments_end_date(d.pop("payments_end_date", UNSET)) + + def _parse_closed_start_date(data: object) -> Union[None, Unset, datetime.date]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + closed_start_date_type_0 = isoparse(data).date() + + return closed_start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.date], data) + + closed_start_date = _parse_closed_start_date(d.pop("closed_start_date", UNSET)) + + def _parse_registrations_end_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + registrations_end_date_type_0 = isoparse(data) + + return registrations_end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + registrations_end_date = _parse_registrations_end_date(d.pop("registrations_end_date", UNSET)) + + def _parse_start_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + start_date_type_0 = isoparse(data) + + return start_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + start_date = _parse_start_date(d.pop("start_date", UNSET)) + + def _parse_end_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + end_date_type_0 = isoparse(data) + + return end_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + end_date = _parse_end_date(d.pop("end_date", UNSET)) + + custom_key = d.pop("custom_key", UNSET) + + welcome_text = d.pop("welcome_text", UNSET) + + frontend_url = d.pop("frontend_url", UNSET) + + frontend_title = d.pop("frontend_title", UNSET) + + frontend_organizers = d.pop("frontend_organizers", UNSET) + + frontend_path = d.pop("frontend_path", UNSET) + + multiple_registration_per_login = d.pop("multiple_registration_per_login", UNSET) + + user_nickname_enabled = d.pop("user_nickname_enabled", UNSET) + + user_registration_link_unique = d.pop("user_registration_link_unique", UNSET) + + def _parse_description_header_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + description_header_image = _parse_description_header_image(d.pop("description_header_image", UNSET)) + + terms_of_service = d.pop("terms_of_service", UNSET) + + location_text = d.pop("location_text", UNSET) + + def _parse_location(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + location = _parse_location(d.pop("location", UNSET)) + + location_address = d.pop("location_address", UNSET) + + is_public_visible = d.pop("is_public_visible", UNSET) + + is_unit_visible = d.pop("is_unit_visible", UNSET) + + ticket_office_url = d.pop("ticket_office_url", UNSET) + + ticket_office_testing_url = d.pop("ticket_office_testing_url", UNSET) + + is_basket_item_modification_allowed = d.pop("is_basket_item_modification_allowed", UNSET) + + is_in_lausanne = d.pop("is_in_lausanne", UNSET) + + is_status_public = d.pop("is_status_public", UNSET) + + patched_event = cls( + id=id, + unit_id=unit_id, + name=name, + status=status, + moderation_status=moderation_status, + are_registrations_allowed=are_registrations_allowed, + are_payments_allowed=are_payments_allowed, + registrations_start_date=registrations_start_date, + payments_start_date=payments_start_date, + payments_end_date=payments_end_date, + closed_start_date=closed_start_date, + registrations_end_date=registrations_end_date, + start_date=start_date, + end_date=end_date, + custom_key=custom_key, + welcome_text=welcome_text, + frontend_url=frontend_url, + frontend_title=frontend_title, + frontend_organizers=frontend_organizers, + frontend_path=frontend_path, + multiple_registration_per_login=multiple_registration_per_login, + user_nickname_enabled=user_nickname_enabled, + user_registration_link_unique=user_registration_link_unique, + description_header_image=description_header_image, + terms_of_service=terms_of_service, + location_text=location_text, + location=location, + location_address=location_address, + is_public_visible=is_public_visible, + is_unit_visible=is_unit_visible, + ticket_office_url=ticket_office_url, + ticket_office_testing_url=ticket_office_testing_url, + is_basket_item_modification_allowed=is_basket_item_modification_allowed, + is_in_lausanne=is_in_lausanne, + is_status_public=is_status_public, + ) + + patched_event.additional_properties = d + return patched_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_frontend_basket.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_frontend_basket.py new file mode 100644 index 0000000..9fcdb08 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_frontend_basket.py @@ -0,0 +1,224 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedFrontendBasket") + + +@_attrs_define +class PatchedFrontendBasket: + """ + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + testing (Union[Unset, bool]): + created_by_id (Union[Unset, int]): The id of the frontendlogin that created the basket. + billing_information_id (Union[Unset, int]): The id of the billing information linked to the basket. + total (Union[Unset, str]): + total_display (Union[Unset, str]): + invoices (Union[Unset, list[int]]): + unikey (Union[Unset, str]): Return a unique and checksummed-ish key + status (Union[Unset, str]): + registrations_count (Union[Unset, int]): The number of root Selected Nodes linked to this basket. + invoices_total (Union[Unset, float]): Invoices total amount. + invoices_total_exceeds_basket_total (Union[Unset, bool]): Whether the invoices total amount exceeds the basket + total. + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + testing: Union[Unset, bool] = UNSET + created_by_id: Union[Unset, int] = UNSET + billing_information_id: Union[Unset, int] = UNSET + total: Union[Unset, str] = UNSET + total_display: Union[Unset, str] = UNSET + invoices: Union[Unset, list[int]] = UNSET + unikey: Union[Unset, str] = UNSET + status: Union[Unset, str] = UNSET + registrations_count: Union[Unset, int] = UNSET + invoices_total: Union[Unset, float] = UNSET + invoices_total_exceeds_basket_total: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + testing = self.testing + + created_by_id = self.created_by_id + + billing_information_id = self.billing_information_id + + total = self.total + + total_display = self.total_display + + invoices: Union[Unset, list[int]] = UNSET + if not isinstance(self.invoices, Unset): + invoices = self.invoices + + unikey = self.unikey + + status = self.status + + registrations_count = self.registrations_count + + invoices_total = self.invoices_total + + invoices_total_exceeds_basket_total = self.invoices_total_exceeds_basket_total + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if testing is not UNSET: + field_dict["testing"] = testing + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if billing_information_id is not UNSET: + field_dict["billing_information_id"] = billing_information_id + if total is not UNSET: + field_dict["total"] = total + if total_display is not UNSET: + field_dict["total_display"] = total_display + if invoices is not UNSET: + field_dict["invoices"] = invoices + if unikey is not UNSET: + field_dict["unikey"] = unikey + if status is not UNSET: + field_dict["status"] = status + if registrations_count is not UNSET: + field_dict["registrations_count"] = registrations_count + if invoices_total is not UNSET: + field_dict["invoices_total"] = invoices_total + if invoices_total_exceeds_basket_total is not UNSET: + field_dict["invoices_total_exceeds_basket_total"] = invoices_total_exceeds_basket_total + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.testing, Unset): + files.append(("testing", (None, str(self.testing).encode(), "text/plain"))) + + if not isinstance(self.created_by_id, Unset): + files.append(("created_by_id", (None, str(self.created_by_id).encode(), "text/plain"))) + + if not isinstance(self.billing_information_id, Unset): + files.append(("billing_information_id", (None, str(self.billing_information_id).encode(), "text/plain"))) + + if not isinstance(self.total, Unset): + files.append(("total", (None, str(self.total).encode(), "text/plain"))) + + if not isinstance(self.total_display, Unset): + files.append(("total_display", (None, str(self.total_display).encode(), "text/plain"))) + + if not isinstance(self.invoices, Unset): + for invoices_item_element in self.invoices: + files.append(("invoices", (None, str(invoices_item_element).encode(), "text/plain"))) + + if not isinstance(self.unikey, Unset): + files.append(("unikey", (None, str(self.unikey).encode(), "text/plain"))) + + if not isinstance(self.status, Unset): + files.append(("status", (None, str(self.status).encode(), "text/plain"))) + + if not isinstance(self.registrations_count, Unset): + files.append(("registrations_count", (None, str(self.registrations_count).encode(), "text/plain"))) + + if not isinstance(self.invoices_total, Unset): + files.append(("invoices_total", (None, str(self.invoices_total).encode(), "text/plain"))) + + if not isinstance(self.invoices_total_exceeds_basket_total, Unset): + files.append( + ( + "invoices_total_exceeds_basket_total", + (None, str(self.invoices_total_exceeds_basket_total).encode(), "text/plain"), + ) + ) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + testing = d.pop("testing", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + billing_information_id = d.pop("billing_information_id", UNSET) + + total = d.pop("total", UNSET) + + total_display = d.pop("total_display", UNSET) + + invoices = cast(list[int], d.pop("invoices", UNSET)) + + unikey = d.pop("unikey", UNSET) + + status = d.pop("status", UNSET) + + registrations_count = d.pop("registrations_count", UNSET) + + invoices_total = d.pop("invoices_total", UNSET) + + invoices_total_exceeds_basket_total = d.pop("invoices_total_exceeds_basket_total", UNSET) + + patched_frontend_basket = cls( + id=id, + event=event, + testing=testing, + created_by_id=created_by_id, + billing_information_id=billing_information_id, + total=total, + total_display=total_display, + invoices=invoices, + unikey=unikey, + status=status, + registrations_count=registrations_count, + invoices_total=invoices_total, + invoices_total_exceeds_basket_total=invoices_total_exceeds_basket_total, + ) + + patched_frontend_basket.additional_properties = d + return patched_frontend_basket + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_anonymous_login_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_anonymous_login_active_module.py new file mode 100644 index 0000000..1df8168 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_anonymous_login_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_anonymous_login_configuration import ModuleAuthAnonymousLoginConfiguration + + +T = TypeVar("T", bound="PatchedModuleAuthAnonymousLoginActiveModule") + + +@_attrs_define +class PatchedModuleAuthAnonymousLoginActiveModule: + """Serializer for `ActiveModule` linked to `ModuleAuthAnonymousLogin` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleAuthAnonymousLoginConfiguration]): Serializer for + `ModuleAuthAnonymousLoginConfiguration` nested in `ModuleAuthAnonymousLoginActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleAuthAnonymousLoginConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_anonymous_login_configuration import ModuleAuthAnonymousLoginConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleAuthAnonymousLoginConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleAuthAnonymousLoginConfiguration.from_dict(_config) + + patched_module_auth_anonymous_login_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_auth_anonymous_login_active_module.additional_properties = d + return patched_module_auth_anonymous_login_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_third_party_token_login_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_third_party_token_login_active_module.py new file mode 100644 index 0000000..598129e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_third_party_token_login_active_module.py @@ -0,0 +1,125 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_third_party_token_login_configuration import ModuleAuthThirdPartyTokenLoginConfiguration + + +T = TypeVar("T", bound="PatchedModuleAuthThirdPartyTokenLoginActiveModule") + + +@_attrs_define +class PatchedModuleAuthThirdPartyTokenLoginActiveModule: + """Serializer for `ActiveModule` linked to `ModuleAuthThirdPartyTokenLogin` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleAuthThirdPartyTokenLoginConfiguration]): Serializer for + `ModuleAuthThirdPartyTokenLoginConfiguration` nested in `ModuleAuthThirdPartyTokenLoginActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleAuthThirdPartyTokenLoginConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_third_party_token_login_configuration import ( + ModuleAuthThirdPartyTokenLoginConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleAuthThirdPartyTokenLoginConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleAuthThirdPartyTokenLoginConfiguration.from_dict(_config) + + patched_module_auth_third_party_token_login_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_auth_third_party_token_login_active_module.additional_properties = d + return patched_module_auth_third_party_token_login_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_trusted_email_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_trusted_email_active_module.py new file mode 100644 index 0000000..91e0d69 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_auth_trusted_email_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_auth_trusted_email_configuration import ModuleAuthTrustedEmailConfiguration + + +T = TypeVar("T", bound="PatchedModuleAuthTrustedEmailActiveModule") + + +@_attrs_define +class PatchedModuleAuthTrustedEmailActiveModule: + """Serializer for `ActiveModule` linked to `ModuleAuthTrustedEmail` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleAuthTrustedEmailConfiguration]): Serializer for `ModuleAuthTrustedEmailConfiguration` + nested in `ModuleAuthTrustedEmailActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleAuthTrustedEmailConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_auth_trusted_email_configuration import ModuleAuthTrustedEmailConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleAuthTrustedEmailConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleAuthTrustedEmailConfiguration.from_dict(_config) + + patched_module_auth_trusted_email_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_auth_trusted_email_active_module.additional_properties = d + return patched_module_auth_trusted_email_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_completed_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_completed_active_module.py new file mode 100644 index 0000000..f2d861f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_completed_active_module.py @@ -0,0 +1,128 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_email_registration_completed_configuration import ( + ModuleCompletionEmailRegistrationCompletedConfiguration, + ) + + +T = TypeVar("T", bound="PatchedModuleCompletionEmailRegistrationCompletedActiveModule") + + +@_attrs_define +class PatchedModuleCompletionEmailRegistrationCompletedActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionEmailRegistrationCompleted` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleCompletionEmailRegistrationCompletedConfiguration]): Serializer for + `ModuleCompletionEmailRegistrationCompletedConfiguration` nested in + `ModuleCompletionEmailRegistrationCompletedActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleCompletionEmailRegistrationCompletedConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_email_registration_completed_configuration import ( + ModuleCompletionEmailRegistrationCompletedConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleCompletionEmailRegistrationCompletedConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleCompletionEmailRegistrationCompletedConfiguration.from_dict(_config) + + patched_module_completion_email_registration_completed_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_completion_email_registration_completed_active_module.additional_properties = d + return patched_module_completion_email_registration_completed_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_creation_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_creation_active_module.py new file mode 100644 index 0000000..c3bd5b4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_email_registration_creation_active_module.py @@ -0,0 +1,128 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_email_registration_creation_configuration import ( + ModuleCompletionEmailRegistrationCreationConfiguration, + ) + + +T = TypeVar("T", bound="PatchedModuleCompletionEmailRegistrationCreationActiveModule") + + +@_attrs_define +class PatchedModuleCompletionEmailRegistrationCreationActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionEmailRegistrationCreation` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleCompletionEmailRegistrationCreationConfiguration]): Serializer for + `ModuleCompletionEmailRegistrationCreationConfiguration` nested in + `ModuleCompletionEmailRegistrationCreationActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleCompletionEmailRegistrationCreationConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_email_registration_creation_configuration import ( + ModuleCompletionEmailRegistrationCreationConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleCompletionEmailRegistrationCreationConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleCompletionEmailRegistrationCreationConfiguration.from_dict(_config) + + patched_module_completion_email_registration_creation_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_completion_email_registration_creation_active_module.additional_properties = d + return patched_module_completion_email_registration_creation_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_pdf_ticket_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_pdf_ticket_active_module.py new file mode 100644 index 0000000..4b1c278 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_pdf_ticket_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_pdf_ticket_configuration import ModuleCompletionPDFTicketConfiguration + + +T = TypeVar("T", bound="PatchedModuleCompletionPDFTicketActiveModule") + + +@_attrs_define +class PatchedModuleCompletionPDFTicketActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionPDFTicket` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleCompletionPDFTicketConfiguration]): Serializer for + `ModuleCompletionPDFTicketConfiguration` nested in `ModuleCompletionPDFTicketActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleCompletionPDFTicketConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_pdf_ticket_configuration import ModuleCompletionPDFTicketConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleCompletionPDFTicketConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleCompletionPDFTicketConfiguration.from_dict(_config) + + patched_module_completion_pdf_ticket_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_completion_pdf_ticket_active_module.additional_properties = d + return patched_module_completion_pdf_ticket_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_redirect_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_redirect_active_module.py new file mode 100644 index 0000000..a280a15 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_completion_redirect_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_completion_redirect_configuration import ModuleCompletionRedirectConfiguration + + +T = TypeVar("T", bound="PatchedModuleCompletionRedirectActiveModule") + + +@_attrs_define +class PatchedModuleCompletionRedirectActiveModule: + """Serializer for `ActiveModule` linked to `ModuleCompletionRedirect` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleCompletionRedirectConfiguration]): Serializer for + `ModuleCompletionRedirectConfiguration` nested in `ModuleCompletionRedirectActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleCompletionRedirectConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_completion_redirect_configuration import ModuleCompletionRedirectConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleCompletionRedirectConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleCompletionRedirectConfiguration.from_dict(_config) + + patched_module_completion_redirect_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_completion_redirect_active_module.additional_properties = d + return patched_module_completion_redirect_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_payrexx_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_payrexx_active_module.py new file mode 100644 index 0000000..7a7e51a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_payrexx_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_payrexx_configuration import ModulePaymentPayrexxConfiguration + + +T = TypeVar("T", bound="PatchedModulePaymentPayrexxActiveModule") + + +@_attrs_define +class PatchedModulePaymentPayrexxActiveModule: + """Serializer for `ActiveModule` linked to `ModulePaymentPayrexx` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModulePaymentPayrexxConfiguration]): Serializer for `ModulePaymentPayrexxConfiguration` + nested in `ModulePaymentPayrexxActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModulePaymentPayrexxConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_payrexx_configuration import ModulePaymentPayrexxConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModulePaymentPayrexxConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModulePaymentPayrexxConfiguration.from_dict(_config) + + patched_module_payment_payrexx_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_payment_payrexx_active_module.additional_properties = d + return patched_module_payment_payrexx_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_point_of_sale_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_point_of_sale_active_module.py new file mode 100644 index 0000000..394c773 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_payment_point_of_sale_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_payment_point_of_sale_configuration import ModulePaymentPointOfSaleConfiguration + + +T = TypeVar("T", bound="PatchedModulePaymentPointOfSaleActiveModule") + + +@_attrs_define +class PatchedModulePaymentPointOfSaleActiveModule: + """Serializer for `ActiveModule` linked to `ModulePaymentPointOfSale` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModulePaymentPointOfSaleConfiguration]): Serializer for + `ModulePaymentPointOfSaleConfiguration` nested in `ModulePaymentPointOfSaleActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModulePaymentPointOfSaleConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_payment_point_of_sale_configuration import ModulePaymentPointOfSaleConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModulePaymentPointOfSaleConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModulePaymentPointOfSaleConfiguration.from_dict(_config) + + patched_module_payment_point_of_sale_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_payment_point_of_sale_active_module.additional_properties = d + return patched_module_payment_point_of_sale_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_access_management_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_access_management_active_module.py new file mode 100644 index 0000000..e96dd5d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_access_management_active_module.py @@ -0,0 +1,127 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_registrations_access_management_configuration import ( + ModuleRegistrationsAccessManagementConfiguration, + ) + + +T = TypeVar("T", bound="PatchedModuleRegistrationAccessManagementActiveModule") + + +@_attrs_define +class PatchedModuleRegistrationAccessManagementActiveModule: + """Serializer for `ActiveModule` linked to `ModuleRegistrationOptions` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleRegistrationsAccessManagementConfiguration]): Serializer for + `ModuleRegistrationOptionsConfiguration` nested in `ModuleRegistrationOptionsActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleRegistrationsAccessManagementConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_registrations_access_management_configuration import ( + ModuleRegistrationsAccessManagementConfiguration, + ) + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleRegistrationsAccessManagementConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleRegistrationsAccessManagementConfiguration.from_dict(_config) + + patched_module_registration_access_management_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_registration_access_management_active_module.additional_properties = d + return patched_module_registration_access_management_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_options_active_module.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_options_active_module.py new file mode 100644 index 0000000..f5a90a9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_module_registration_options_active_module.py @@ -0,0 +1,123 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.module_registration_options_configuration import ModuleRegistrationOptionsConfiguration + + +T = TypeVar("T", bound="PatchedModuleRegistrationOptionsActiveModule") + + +@_attrs_define +class PatchedModuleRegistrationOptionsActiveModule: + """Serializer for `ActiveModule` linked to `ModuleRegistrationOptions` + + Attributes: + id (Union[Unset, int]): + event (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + config (Union[Unset, ModuleRegistrationOptionsConfiguration]): Serializer for + `ModuleRegistrationOptionsConfiguration` nested in `ModuleRegistrationOptionsActiveModuleSerializer` + """ + + id: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + config: Union[Unset, "ModuleRegistrationOptionsConfiguration"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event = self.event + + is_deleted = self.is_deleted + + config: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event is not UNSET: + field_dict["event"] = event + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if config is not UNSET: + field_dict["config"] = config + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.config, Unset): + files.append(("config", (None, json.dumps(self.config.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.module_registration_options_configuration import ModuleRegistrationOptionsConfiguration + + d = dict(src_dict) + id = d.pop("id", UNSET) + + event = d.pop("event", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + _config = d.pop("config", UNSET) + config: Union[Unset, ModuleRegistrationOptionsConfiguration] + if isinstance(_config, Unset): + config = UNSET + else: + config = ModuleRegistrationOptionsConfiguration.from_dict(_config) + + patched_module_registration_options_active_module = cls( + id=id, + event=event, + is_deleted=is_deleted, + config=config, + ) + + patched_module_registration_options_active_module.additional_properties = d + return patched_module_registration_options_active_module + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node.py new file mode 100644 index 0000000..41af2cf --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node.py @@ -0,0 +1,171 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNode") + + +@_attrs_define +class PatchedNode: + """Serializer for Node model + + Attributes: + id (Union[Unset, int]): + order (Union[Unset, int]): Local order between nodes that share the same parent + parent_id (Union[Unset, int]): + internal_key (Union[Unset, str]): + configuration_id (Union[Unset, int]): + cart_configuration_id (Union[Unset, int]): + children_ids (Union[Unset, list[int]]): + event (Union[Unset, int]): + event_id (Union[Unset, int]): + """ + + id: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + parent_id: Union[Unset, int] = UNSET + internal_key: Union[Unset, str] = UNSET + configuration_id: Union[Unset, int] = UNSET + cart_configuration_id: Union[Unset, int] = UNSET + children_ids: Union[Unset, list[int]] = UNSET + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + parent_id = self.parent_id + + internal_key = self.internal_key + + configuration_id = self.configuration_id + + cart_configuration_id = self.cart_configuration_id + + children_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.children_ids, Unset): + children_ids = self.children_ids + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if order is not UNSET: + field_dict["order"] = order + if parent_id is not UNSET: + field_dict["parent_id"] = parent_id + if internal_key is not UNSET: + field_dict["internal_key"] = internal_key + if configuration_id is not UNSET: + field_dict["configuration_id"] = configuration_id + if cart_configuration_id is not UNSET: + field_dict["cart_configuration_id"] = cart_configuration_id + if children_ids is not UNSET: + field_dict["children_ids"] = children_ids + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.parent_id, Unset): + files.append(("parent_id", (None, str(self.parent_id).encode(), "text/plain"))) + + if not isinstance(self.internal_key, Unset): + files.append(("internal_key", (None, str(self.internal_key).encode(), "text/plain"))) + + if not isinstance(self.configuration_id, Unset): + files.append(("configuration_id", (None, str(self.configuration_id).encode(), "text/plain"))) + + if not isinstance(self.cart_configuration_id, Unset): + files.append(("cart_configuration_id", (None, str(self.cart_configuration_id).encode(), "text/plain"))) + + if not isinstance(self.children_ids, Unset): + for children_ids_item_element in self.children_ids: + files.append(("children_ids", (None, str(children_ids_item_element).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + order = d.pop("order", UNSET) + + parent_id = d.pop("parent_id", UNSET) + + internal_key = d.pop("internal_key", UNSET) + + configuration_id = d.pop("configuration_id", UNSET) + + cart_configuration_id = d.pop("cart_configuration_id", UNSET) + + children_ids = cast(list[int], d.pop("children_ids", UNSET)) + + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + patched_node = cls( + id=id, + order=order, + parent_id=parent_id, + internal_key=internal_key, + configuration_id=configuration_id, + cart_configuration_id=cart_configuration_id, + children_ids=children_ids, + event=event, + event_id=event_id, + ) + + patched_node.additional_properties = d + return patched_node + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_access.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_access.py new file mode 100644 index 0000000..b0b1942 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_access.py @@ -0,0 +1,150 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeAccess") + + +@_attrs_define +class PatchedNodeAccess: + """Serializer (read/write) for `NodeAccess` model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + label (Union[Unset, str]): + node_configuration_ids (Union[Unset, list[int]]): + condition_id (Union[Unset, int]): + is_accessible (Union[Unset, bool]): if True and user matches the conditions they should have access to the node, + if False and user matches the conditions they should not have access to the node + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + label: Union[Unset, str] = UNSET + node_configuration_ids: Union[Unset, list[int]] = UNSET + condition_id: Union[Unset, int] = UNSET + is_accessible: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + label = self.label + + node_configuration_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.node_configuration_ids, Unset): + node_configuration_ids = self.node_configuration_ids + + condition_id = self.condition_id + + is_accessible = self.is_accessible + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if label is not UNSET: + field_dict["label"] = label + if node_configuration_ids is not UNSET: + field_dict["node_configuration_ids"] = node_configuration_ids + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + if is_accessible is not UNSET: + field_dict["is_accessible"] = is_accessible + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.label, Unset): + files.append(("label", (None, str(self.label).encode(), "text/plain"))) + + if not isinstance(self.node_configuration_ids, Unset): + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + if not isinstance(self.is_accessible, Unset): + files.append(("is_accessible", (None, str(self.is_accessible).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + label = d.pop("label", UNSET) + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids", UNSET)) + + condition_id = d.pop("condition_id", UNSET) + + is_accessible = d.pop("is_accessible", UNSET) + + patched_node_access = cls( + event=event, + event_id=event_id, + id=id, + label=label, + node_configuration_ids=node_configuration_ids, + condition_id=condition_id, + is_accessible=is_accessible, + ) + + patched_node_access.additional_properties = d + return patched_node_access + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_availability.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_availability.py new file mode 100644 index 0000000..5ac45b9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_availability.py @@ -0,0 +1,211 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeAvailability") + + +@_attrs_define +class PatchedNodeAvailability: + """Serializer (read/write) for NodeAvailability model + + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + node_configuration_ids (Union[Unset, list[int]]): + condition_id (Union[Unset, int]): + starts_at (Union[None, Unset, datetime.datetime]): + ends_at (Union[None, Unset, datetime.datetime]): + event (Union[Unset, int]): + event_id (Union[Unset, int]): + """ + + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + node_configuration_ids: Union[Unset, list[int]] = UNSET + condition_id: Union[Unset, int] = UNSET + starts_at: Union[None, Unset, datetime.datetime] = UNSET + ends_at: Union[None, Unset, datetime.datetime] = UNSET + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + node_configuration_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.node_configuration_ids, Unset): + node_configuration_ids = self.node_configuration_ids + + condition_id = self.condition_id + + starts_at: Union[None, Unset, str] + if isinstance(self.starts_at, Unset): + starts_at = UNSET + elif isinstance(self.starts_at, datetime.datetime): + starts_at = self.starts_at.isoformat() + else: + starts_at = self.starts_at + + ends_at: Union[None, Unset, str] + if isinstance(self.ends_at, Unset): + ends_at = UNSET + elif isinstance(self.ends_at, datetime.datetime): + ends_at = self.ends_at.isoformat() + else: + ends_at = self.ends_at + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if node_configuration_ids is not UNSET: + field_dict["node_configuration_ids"] = node_configuration_ids + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + if starts_at is not UNSET: + field_dict["starts_at"] = starts_at + if ends_at is not UNSET: + field_dict["ends_at"] = ends_at + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.node_configuration_ids, Unset): + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + if not isinstance(self.starts_at, Unset): + if isinstance(self.starts_at, datetime.datetime): + files.append(("starts_at", (None, self.starts_at.isoformat().encode(), "text/plain"))) + else: + files.append(("starts_at", (None, str(self.starts_at).encode(), "text/plain"))) + + if not isinstance(self.ends_at, Unset): + if isinstance(self.ends_at, datetime.datetime): + files.append(("ends_at", (None, self.ends_at.isoformat().encode(), "text/plain"))) + else: + files.append(("ends_at", (None, str(self.ends_at).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids", UNSET)) + + condition_id = d.pop("condition_id", UNSET) + + def _parse_starts_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + starts_at_type_0 = isoparse(data) + + return starts_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + starts_at = _parse_starts_at(d.pop("starts_at", UNSET)) + + def _parse_ends_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + ends_at_type_0 = isoparse(data) + + return ends_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + ends_at = _parse_ends_at(d.pop("ends_at", UNSET)) + + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + patched_node_availability = cls( + id=id, + name=name, + node_configuration_ids=node_configuration_ids, + condition_id=condition_id, + starts_at=starts_at, + ends_at=ends_at, + event=event, + event_id=event_id, + ) + + patched_node_availability.additional_properties = d + return patched_node_availability + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_cart_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_cart_configuration.py new file mode 100644 index 0000000..ed9c955 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_cart_configuration.py @@ -0,0 +1,132 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeCartConfiguration") + + +@_attrs_define +class PatchedNodeCartConfiguration: + """Serializer (read/write) for NodeCartConfiguration model + + Attributes: + id (Union[Unset, int]): + weight (Union[Unset, int]): + range_min (Union[Unset, int]): + range_max (Union[Unset, int]): + event (Union[Unset, int]): + event_id (Union[Unset, int]): + """ + + id: Union[Unset, int] = UNSET + weight: Union[Unset, int] = UNSET + range_min: Union[Unset, int] = UNSET + range_max: Union[Unset, int] = UNSET + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + weight = self.weight + + range_min = self.range_min + + range_max = self.range_max + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if weight is not UNSET: + field_dict["weight"] = weight + if range_min is not UNSET: + field_dict["range_min"] = range_min + if range_max is not UNSET: + field_dict["range_max"] = range_max + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.weight, Unset): + files.append(("weight", (None, str(self.weight).encode(), "text/plain"))) + + if not isinstance(self.range_min, Unset): + files.append(("range_min", (None, str(self.range_min).encode(), "text/plain"))) + + if not isinstance(self.range_max, Unset): + files.append(("range_max", (None, str(self.range_max).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + weight = d.pop("weight", UNSET) + + range_min = d.pop("range_min", UNSET) + + range_max = d.pop("range_max", UNSET) + + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + patched_node_cart_configuration = cls( + id=id, + weight=weight, + range_min=range_min, + range_max=range_max, + event=event, + event_id=event_id, + ) + + patched_node_cart_configuration.additional_properties = d + return patched_node_cart_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_configuration.py new file mode 100644 index 0000000..0cb407f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_configuration.py @@ -0,0 +1,362 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..models.category_enum import CategoryEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeConfiguration") + + +@_attrs_define +class PatchedNodeConfiguration: + """Serializer (read/write) for NodeConfiguration model + + Attributes: + id (Union[Unset, int]): + description (Union[Unset, str]): description for the node. Some restricted HTML markup is allowed, everything + else is filtered out automatically. + title (Union[Unset, str]): + category (Union[Unset, CategoryEnum]): * `ticket` - Ticket + * `item` - Item + * `activity` - Activity + * `accomodation` - Accomodation + * `type` - Type + * `group` - Group + image (Union[None, Unset, int]): + image_style (Union[Unset, Any]): + item_style (Union[Unset, Any]): + display_price_difference (Union[Unset, bool]): + display_limits_difference (Union[Unset, bool]): + is_title_displayable (Union[Unset, bool]): + is_image_displayable (Union[Unset, bool]): + is_description_displayable (Union[Unset, bool]): + is_tags_displayable (Union[Unset, bool]): + starts_at (Union[None, Unset, datetime.datetime]): Optional start datetime for this node. For display only. + ends_at (Union[None, Unset, datetime.datetime]): Optional end datetime for this node. For display only. + is_subject_to_lausanne_tax (Union[Unset, bool]): + event (Union[Unset, int]): + event_id (Union[Unset, int]): + """ + + id: Union[Unset, int] = UNSET + description: Union[Unset, str] = UNSET + title: Union[Unset, str] = UNSET + category: Union[Unset, CategoryEnum] = UNSET + image: Union[None, Unset, int] = UNSET + image_style: Union[Unset, Any] = UNSET + item_style: Union[Unset, Any] = UNSET + display_price_difference: Union[Unset, bool] = UNSET + display_limits_difference: Union[Unset, bool] = UNSET + is_title_displayable: Union[Unset, bool] = UNSET + is_image_displayable: Union[Unset, bool] = UNSET + is_description_displayable: Union[Unset, bool] = UNSET + is_tags_displayable: Union[Unset, bool] = UNSET + starts_at: Union[None, Unset, datetime.datetime] = UNSET + ends_at: Union[None, Unset, datetime.datetime] = UNSET + is_subject_to_lausanne_tax: Union[Unset, bool] = UNSET + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + description = self.description + + title = self.title + + category: Union[Unset, str] = UNSET + if not isinstance(self.category, Unset): + category = self.category.value + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + image_style = self.image_style + + item_style = self.item_style + + display_price_difference = self.display_price_difference + + display_limits_difference = self.display_limits_difference + + is_title_displayable = self.is_title_displayable + + is_image_displayable = self.is_image_displayable + + is_description_displayable = self.is_description_displayable + + is_tags_displayable = self.is_tags_displayable + + starts_at: Union[None, Unset, str] + if isinstance(self.starts_at, Unset): + starts_at = UNSET + elif isinstance(self.starts_at, datetime.datetime): + starts_at = self.starts_at.isoformat() + else: + starts_at = self.starts_at + + ends_at: Union[None, Unset, str] + if isinstance(self.ends_at, Unset): + ends_at = UNSET + elif isinstance(self.ends_at, datetime.datetime): + ends_at = self.ends_at.isoformat() + else: + ends_at = self.ends_at + + is_subject_to_lausanne_tax = self.is_subject_to_lausanne_tax + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if description is not UNSET: + field_dict["description"] = description + if title is not UNSET: + field_dict["title"] = title + if category is not UNSET: + field_dict["category"] = category + if image is not UNSET: + field_dict["image"] = image + if image_style is not UNSET: + field_dict["image_style"] = image_style + if item_style is not UNSET: + field_dict["item_style"] = item_style + if display_price_difference is not UNSET: + field_dict["display_price_difference"] = display_price_difference + if display_limits_difference is not UNSET: + field_dict["display_limits_difference"] = display_limits_difference + if is_title_displayable is not UNSET: + field_dict["is_title_displayable"] = is_title_displayable + if is_image_displayable is not UNSET: + field_dict["is_image_displayable"] = is_image_displayable + if is_description_displayable is not UNSET: + field_dict["is_description_displayable"] = is_description_displayable + if is_tags_displayable is not UNSET: + field_dict["is_tags_displayable"] = is_tags_displayable + if starts_at is not UNSET: + field_dict["starts_at"] = starts_at + if ends_at is not UNSET: + field_dict["ends_at"] = ends_at + if is_subject_to_lausanne_tax is not UNSET: + field_dict["is_subject_to_lausanne_tax"] = is_subject_to_lausanne_tax + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.description, Unset): + files.append(("description", (None, str(self.description).encode(), "text/plain"))) + + if not isinstance(self.title, Unset): + files.append(("title", (None, str(self.title).encode(), "text/plain"))) + + if not isinstance(self.category, Unset): + files.append(("category", (None, str(self.category.value).encode(), "text/plain"))) + + if not isinstance(self.image, Unset): + if isinstance(self.image, int): + files.append(("image", (None, str(self.image).encode(), "text/plain"))) + else: + files.append(("image", (None, str(self.image).encode(), "text/plain"))) + + if not isinstance(self.image_style, Unset): + files.append(("image_style", (None, str(self.image_style).encode(), "text/plain"))) + + if not isinstance(self.item_style, Unset): + files.append(("item_style", (None, str(self.item_style).encode(), "text/plain"))) + + if not isinstance(self.display_price_difference, Unset): + files.append( + ("display_price_difference", (None, str(self.display_price_difference).encode(), "text/plain")) + ) + + if not isinstance(self.display_limits_difference, Unset): + files.append( + ("display_limits_difference", (None, str(self.display_limits_difference).encode(), "text/plain")) + ) + + if not isinstance(self.is_title_displayable, Unset): + files.append(("is_title_displayable", (None, str(self.is_title_displayable).encode(), "text/plain"))) + + if not isinstance(self.is_image_displayable, Unset): + files.append(("is_image_displayable", (None, str(self.is_image_displayable).encode(), "text/plain"))) + + if not isinstance(self.is_description_displayable, Unset): + files.append( + ("is_description_displayable", (None, str(self.is_description_displayable).encode(), "text/plain")) + ) + + if not isinstance(self.is_tags_displayable, Unset): + files.append(("is_tags_displayable", (None, str(self.is_tags_displayable).encode(), "text/plain"))) + + if not isinstance(self.starts_at, Unset): + if isinstance(self.starts_at, datetime.datetime): + files.append(("starts_at", (None, self.starts_at.isoformat().encode(), "text/plain"))) + else: + files.append(("starts_at", (None, str(self.starts_at).encode(), "text/plain"))) + + if not isinstance(self.ends_at, Unset): + if isinstance(self.ends_at, datetime.datetime): + files.append(("ends_at", (None, self.ends_at.isoformat().encode(), "text/plain"))) + else: + files.append(("ends_at", (None, str(self.ends_at).encode(), "text/plain"))) + + if not isinstance(self.is_subject_to_lausanne_tax, Unset): + files.append( + ("is_subject_to_lausanne_tax", (None, str(self.is_subject_to_lausanne_tax).encode(), "text/plain")) + ) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + description = d.pop("description", UNSET) + + title = d.pop("title", UNSET) + + _category = d.pop("category", UNSET) + category: Union[Unset, CategoryEnum] + if isinstance(_category, Unset): + category = UNSET + else: + category = CategoryEnum(_category) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + image_style = d.pop("image_style", UNSET) + + item_style = d.pop("item_style", UNSET) + + display_price_difference = d.pop("display_price_difference", UNSET) + + display_limits_difference = d.pop("display_limits_difference", UNSET) + + is_title_displayable = d.pop("is_title_displayable", UNSET) + + is_image_displayable = d.pop("is_image_displayable", UNSET) + + is_description_displayable = d.pop("is_description_displayable", UNSET) + + is_tags_displayable = d.pop("is_tags_displayable", UNSET) + + def _parse_starts_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + starts_at_type_0 = isoparse(data) + + return starts_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + starts_at = _parse_starts_at(d.pop("starts_at", UNSET)) + + def _parse_ends_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + ends_at_type_0 = isoparse(data) + + return ends_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + ends_at = _parse_ends_at(d.pop("ends_at", UNSET)) + + is_subject_to_lausanne_tax = d.pop("is_subject_to_lausanne_tax", UNSET) + + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + patched_node_configuration = cls( + id=id, + description=description, + title=title, + category=category, + image=image, + image_style=image_style, + item_style=item_style, + display_price_difference=display_price_difference, + display_limits_difference=display_limits_difference, + is_title_displayable=is_title_displayable, + is_image_displayable=is_image_displayable, + is_description_displayable=is_description_displayable, + is_tags_displayable=is_tags_displayable, + starts_at=starts_at, + ends_at=ends_at, + is_subject_to_lausanne_tax=is_subject_to_lausanne_tax, + event=event, + event_id=event_id, + ) + + patched_node_configuration.additional_properties = d + return patched_node_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info.py new file mode 100644 index 0000000..8f59afa --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info.py @@ -0,0 +1,277 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.model_form_line_type import ModelFormLineType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeExtraInfo") + + +@_attrs_define +class PatchedNodeExtraInfo: + """Serializer (read/write) for `NodeExtraInfo` model + + Attributes: + id (Union[Unset, int]): + group_id (Union[Unset, int]): + order (Union[Unset, int]): + type_ (Union[Unset, ModelFormLineType]): * `text` - Simple text + * `email` - Email + * `phone` - Phone + * `country` - Country + * `numerical` - Numerical + * `textarea` - Multi-line text input + * `boolean` - Boolean + * `datetime` - Datetime + * `date` - Date + * `date_major` - Birthdate with majority required + * `choice` - Choice + * `file` - File + name (Union[Unset, str]): + text (Union[Unset, str]): + help_text (Union[Unset, str]): + is_required (Union[Unset, bool]): + choices_json (Union[None, Unset, str]): + major_json (Union[None, Unset, str]): + range_json (Union[None, Unset, str]): + event (Union[Unset, int]): + event_id (Union[Unset, int]): + """ + + id: Union[Unset, int] = UNSET + group_id: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + type_: Union[Unset, ModelFormLineType] = UNSET + name: Union[Unset, str] = UNSET + text: Union[Unset, str] = UNSET + help_text: Union[Unset, str] = UNSET + is_required: Union[Unset, bool] = UNSET + choices_json: Union[None, Unset, str] = UNSET + major_json: Union[None, Unset, str] = UNSET + range_json: Union[None, Unset, str] = UNSET + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + group_id = self.group_id + + order = self.order + + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + name = self.name + + text = self.text + + help_text = self.help_text + + is_required = self.is_required + + choices_json: Union[None, Unset, str] + if isinstance(self.choices_json, Unset): + choices_json = UNSET + else: + choices_json = self.choices_json + + major_json: Union[None, Unset, str] + if isinstance(self.major_json, Unset): + major_json = UNSET + else: + major_json = self.major_json + + range_json: Union[None, Unset, str] + if isinstance(self.range_json, Unset): + range_json = UNSET + else: + range_json = self.range_json + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if group_id is not UNSET: + field_dict["group_id"] = group_id + if order is not UNSET: + field_dict["order"] = order + if type_ is not UNSET: + field_dict["type"] = type_ + if name is not UNSET: + field_dict["name"] = name + if text is not UNSET: + field_dict["text"] = text + if help_text is not UNSET: + field_dict["help_text"] = help_text + if is_required is not UNSET: + field_dict["is_required"] = is_required + if choices_json is not UNSET: + field_dict["choices_json"] = choices_json + if major_json is not UNSET: + field_dict["major_json"] = major_json + if range_json is not UNSET: + field_dict["range_json"] = range_json + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.group_id, Unset): + files.append(("group_id", (None, str(self.group_id).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.type_, Unset): + files.append(("type", (None, str(self.type_.value).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.text, Unset): + files.append(("text", (None, str(self.text).encode(), "text/plain"))) + + if not isinstance(self.help_text, Unset): + files.append(("help_text", (None, str(self.help_text).encode(), "text/plain"))) + + if not isinstance(self.is_required, Unset): + files.append(("is_required", (None, str(self.is_required).encode(), "text/plain"))) + + if not isinstance(self.choices_json, Unset): + if isinstance(self.choices_json, str): + files.append(("choices_json", (None, str(self.choices_json).encode(), "text/plain"))) + else: + files.append(("choices_json", (None, str(self.choices_json).encode(), "text/plain"))) + + if not isinstance(self.major_json, Unset): + if isinstance(self.major_json, str): + files.append(("major_json", (None, str(self.major_json).encode(), "text/plain"))) + else: + files.append(("major_json", (None, str(self.major_json).encode(), "text/plain"))) + + if not isinstance(self.range_json, Unset): + if isinstance(self.range_json, str): + files.append(("range_json", (None, str(self.range_json).encode(), "text/plain"))) + else: + files.append(("range_json", (None, str(self.range_json).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + group_id = d.pop("group_id", UNSET) + + order = d.pop("order", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Union[Unset, ModelFormLineType] + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = ModelFormLineType(_type_) + + name = d.pop("name", UNSET) + + text = d.pop("text", UNSET) + + help_text = d.pop("help_text", UNSET) + + is_required = d.pop("is_required", UNSET) + + def _parse_choices_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + choices_json = _parse_choices_json(d.pop("choices_json", UNSET)) + + def _parse_major_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + major_json = _parse_major_json(d.pop("major_json", UNSET)) + + def _parse_range_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + range_json = _parse_range_json(d.pop("range_json", UNSET)) + + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + patched_node_extra_info = cls( + id=id, + group_id=group_id, + order=order, + type_=type_, + name=name, + text=text, + help_text=help_text, + is_required=is_required, + choices_json=choices_json, + major_json=major_json, + range_json=range_json, + event=event, + event_id=event_id, + ) + + patched_node_extra_info.additional_properties = d + return patched_node_extra_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info_group.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info_group.py new file mode 100644 index 0000000..f6ff334 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_extra_info_group.py @@ -0,0 +1,176 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeExtraInfoGroup") + + +@_attrs_define +class PatchedNodeExtraInfoGroup: + """Serializer (read/write) for `NodeExtraInfoGroup` model + + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + order (Union[Unset, int]): + is_inline (Union[Unset, bool]): + node_configuration_ids (Union[Unset, list[int]]): + extra_info_ids (Union[Unset, list[int]]): + is_required (Union[Unset, bool]): + event (Union[Unset, int]): + event_id (Union[Unset, int]): + """ + + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + order: Union[Unset, int] = UNSET + is_inline: Union[Unset, bool] = UNSET + node_configuration_ids: Union[Unset, list[int]] = UNSET + extra_info_ids: Union[Unset, list[int]] = UNSET + is_required: Union[Unset, bool] = UNSET + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + order = self.order + + is_inline = self.is_inline + + node_configuration_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.node_configuration_ids, Unset): + node_configuration_ids = self.node_configuration_ids + + extra_info_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.extra_info_ids, Unset): + extra_info_ids = self.extra_info_ids + + is_required = self.is_required + + event = self.event + + event_id = self.event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if order is not UNSET: + field_dict["order"] = order + if is_inline is not UNSET: + field_dict["is_inline"] = is_inline + if node_configuration_ids is not UNSET: + field_dict["node_configuration_ids"] = node_configuration_ids + if extra_info_ids is not UNSET: + field_dict["extra_info_ids"] = extra_info_ids + if is_required is not UNSET: + field_dict["is_required"] = is_required + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.is_inline, Unset): + files.append(("is_inline", (None, str(self.is_inline).encode(), "text/plain"))) + + if not isinstance(self.node_configuration_ids, Unset): + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.extra_info_ids, Unset): + for extra_info_ids_item_element in self.extra_info_ids: + files.append(("extra_info_ids", (None, str(extra_info_ids_item_element).encode(), "text/plain"))) + + if not isinstance(self.is_required, Unset): + files.append(("is_required", (None, str(self.is_required).encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + order = d.pop("order", UNSET) + + is_inline = d.pop("is_inline", UNSET) + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids", UNSET)) + + extra_info_ids = cast(list[int], d.pop("extra_info_ids", UNSET)) + + is_required = d.pop("is_required", UNSET) + + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + patched_node_extra_info_group = cls( + id=id, + name=name, + order=order, + is_inline=is_inline, + node_configuration_ids=node_configuration_ids, + extra_info_ids=extra_info_ids, + is_required=is_required, + event=event, + event_id=event_id, + ) + + patched_node_extra_info_group.additional_properties = d + return patched_node_extra_info_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_limit.py new file mode 100644 index 0000000..c42825d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_limit.py @@ -0,0 +1,197 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeLimit") + + +@_attrs_define +class PatchedNodeLimit: + """Serializer (read/write) for `NodeLimit` model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + is_deleted (Union[Unset, bool]): + key (Union[Unset, str]): + label (Union[Unset, str]): + maximum (Union[Unset, int]): + order (Union[Unset, int]): + global_order (Union[Unset, int]): + node_configuration_ids (Union[Unset, list[int]]): + condition_id (Union[Unset, int]): + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + is_deleted: Union[Unset, bool] = UNSET + key: Union[Unset, str] = UNSET + label: Union[Unset, str] = UNSET + maximum: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + global_order: Union[Unset, int] = UNSET + node_configuration_ids: Union[Unset, list[int]] = UNSET + condition_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + is_deleted = self.is_deleted + + key = self.key + + label = self.label + + maximum = self.maximum + + order = self.order + + global_order = self.global_order + + node_configuration_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.node_configuration_ids, Unset): + node_configuration_ids = self.node_configuration_ids + + condition_id = self.condition_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + if key is not UNSET: + field_dict["key"] = key + if label is not UNSET: + field_dict["label"] = label + if maximum is not UNSET: + field_dict["maximum"] = maximum + if order is not UNSET: + field_dict["order"] = order + if global_order is not UNSET: + field_dict["global_order"] = global_order + if node_configuration_ids is not UNSET: + field_dict["node_configuration_ids"] = node_configuration_ids + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + if not isinstance(self.key, Unset): + files.append(("key", (None, str(self.key).encode(), "text/plain"))) + + if not isinstance(self.label, Unset): + files.append(("label", (None, str(self.label).encode(), "text/plain"))) + + if not isinstance(self.maximum, Unset): + files.append(("maximum", (None, str(self.maximum).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.global_order, Unset): + files.append(("global_order", (None, str(self.global_order).encode(), "text/plain"))) + + if not isinstance(self.node_configuration_ids, Unset): + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + key = d.pop("key", UNSET) + + label = d.pop("label", UNSET) + + maximum = d.pop("maximum", UNSET) + + order = d.pop("order", UNSET) + + global_order = d.pop("global_order", UNSET) + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids", UNSET)) + + condition_id = d.pop("condition_id", UNSET) + + patched_node_limit = cls( + event=event, + event_id=event_id, + id=id, + is_deleted=is_deleted, + key=key, + label=label, + maximum=maximum, + order=order, + global_order=global_order, + node_configuration_ids=node_configuration_ids, + condition_id=condition_id, + ) + + patched_node_limit.additional_properties = d + return patched_node_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_price_rule.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_price_rule.py new file mode 100644 index 0000000..700219c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_price_rule.py @@ -0,0 +1,209 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.mode_enum import ModeEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodePriceRule") + + +@_attrs_define +class PatchedNodePriceRule: + """Serializer (read/write) for `NodePriceRule` model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + global_order (Union[Unset, int]): + order (Union[Unset, int]): + mode (Union[Unset, ModeEnum]): * `plus` - + [Current price + value] + * `set` - = [Set price to] + * `plus_percent` - +% [Current price + current price * value / 100] + * `multiply` - * [Current price * value] + * `divide` - / [Current price / value] + value (Union[Unset, str]): + label (Union[Unset, str]): + node_configuration_ids (Union[Unset, list[int]]): + condition_id (Union[Unset, int]): + should_propagate (Union[Unset, bool]): does this rule apply on children of the node + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + global_order: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + mode: Union[Unset, ModeEnum] = UNSET + value: Union[Unset, str] = UNSET + label: Union[Unset, str] = UNSET + node_configuration_ids: Union[Unset, list[int]] = UNSET + condition_id: Union[Unset, int] = UNSET + should_propagate: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + global_order = self.global_order + + order = self.order + + mode: Union[Unset, str] = UNSET + if not isinstance(self.mode, Unset): + mode = self.mode.value + + value = self.value + + label = self.label + + node_configuration_ids: Union[Unset, list[int]] = UNSET + if not isinstance(self.node_configuration_ids, Unset): + node_configuration_ids = self.node_configuration_ids + + condition_id = self.condition_id + + should_propagate = self.should_propagate + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if global_order is not UNSET: + field_dict["global_order"] = global_order + if order is not UNSET: + field_dict["order"] = order + if mode is not UNSET: + field_dict["mode"] = mode + if value is not UNSET: + field_dict["value"] = value + if label is not UNSET: + field_dict["label"] = label + if node_configuration_ids is not UNSET: + field_dict["node_configuration_ids"] = node_configuration_ids + if condition_id is not UNSET: + field_dict["condition_id"] = condition_id + if should_propagate is not UNSET: + field_dict["should_propagate"] = should_propagate + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.global_order, Unset): + files.append(("global_order", (None, str(self.global_order).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.mode, Unset): + files.append(("mode", (None, str(self.mode.value).encode(), "text/plain"))) + + if not isinstance(self.value, Unset): + files.append(("value", (None, str(self.value).encode(), "text/plain"))) + + if not isinstance(self.label, Unset): + files.append(("label", (None, str(self.label).encode(), "text/plain"))) + + if not isinstance(self.node_configuration_ids, Unset): + for node_configuration_ids_item_element in self.node_configuration_ids: + files.append( + ("node_configuration_ids", (None, str(node_configuration_ids_item_element).encode(), "text/plain")) + ) + + if not isinstance(self.condition_id, Unset): + files.append(("condition_id", (None, str(self.condition_id).encode(), "text/plain"))) + + if not isinstance(self.should_propagate, Unset): + files.append(("should_propagate", (None, str(self.should_propagate).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + global_order = d.pop("global_order", UNSET) + + order = d.pop("order", UNSET) + + _mode = d.pop("mode", UNSET) + mode: Union[Unset, ModeEnum] + if isinstance(_mode, Unset): + mode = UNSET + else: + mode = ModeEnum(_mode) + + value = d.pop("value", UNSET) + + label = d.pop("label", UNSET) + + node_configuration_ids = cast(list[int], d.pop("node_configuration_ids", UNSET)) + + condition_id = d.pop("condition_id", UNSET) + + should_propagate = d.pop("should_propagate", UNSET) + + patched_node_price_rule = cls( + event=event, + event_id=event_id, + id=id, + global_order=global_order, + order=order, + mode=mode, + value=value, + label=label, + node_configuration_ids=node_configuration_ids, + condition_id=condition_id, + should_propagate=should_propagate, + ) + + patched_node_price_rule.additional_properties = d + return patched_node_price_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_tag.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_tag.py new file mode 100644 index 0000000..041d962 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_node_tag.py @@ -0,0 +1,120 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedNodeTag") + + +@_attrs_define +class PatchedNodeTag: + """Serializer (read/write) for `NodeTag` model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + name (Union[Unset, str]): + node_configuration_id (Union[Unset, int]): + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + node_configuration_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + name = self.name + + node_configuration_id = self.node_configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if node_configuration_id is not UNSET: + field_dict["node_configuration_id"] = node_configuration_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.node_configuration_id, Unset): + files.append(("node_configuration_id", (None, str(self.node_configuration_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + node_configuration_id = d.pop("node_configuration_id", UNSET) + + patched_node_tag = cls( + event=event, + event_id=event_id, + id=id, + name=name, + node_configuration_id=node_configuration_id, + ) + + patched_node_tag.additional_properties = d + return patched_node_tag + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_point_of_sale_place_read_only.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_point_of_sale_place_read_only.py new file mode 100644 index 0000000..979154c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_point_of_sale_place_read_only.py @@ -0,0 +1,109 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedPointOfSalePlaceReadOnly") + + +@_attrs_define +class PatchedPointOfSalePlaceReadOnly: + """A serializer returning info for a point of sale place. You can access only read methods as a frontend login and will + only see some fields. + + Attributes: + id (Union[Unset, int]): + order (Union[Unset, int]): + title (Union[Unset, str]): + description (Union[Unset, str]): + """ + + id: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + title: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + title = self.title + + description = self.description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if order is not UNSET: + field_dict["order"] = order + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.title, Unset): + files.append(("title", (None, str(self.title).encode(), "text/plain"))) + + if not isinstance(self.description, Unset): + files.append(("description", (None, str(self.description).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + order = d.pop("order", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + patched_point_of_sale_place_read_only = cls( + id=id, + order=order, + title=title, + description=description, + ) + + patched_point_of_sale_place_read_only.additional_properties = d + return patched_point_of_sale_place_read_only + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_poly_ticket_user.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_poly_ticket_user.py new file mode 100644 index 0000000..527f2a0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_poly_ticket_user.py @@ -0,0 +1,169 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedPolyTicketUser") + + +@_attrs_define +class PatchedPolyTicketUser: + """ + Attributes: + id (Union[Unset, int]): + username (Union[Unset, str]): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + email (Union[Unset, str]): + personal_unit (Union[None, Unset, int]): + is_active (Union[Unset, bool]): + is_deleted (Union[Unset, bool]): + """ + + id: Union[Unset, int] = UNSET + username: Union[Unset, str] = UNSET + first_name: Union[Unset, str] = UNSET + last_name: Union[Unset, str] = UNSET + email: Union[Unset, str] = UNSET + personal_unit: Union[None, Unset, int] = UNSET + is_active: Union[Unset, bool] = UNSET + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + username = self.username + + first_name = self.first_name + + last_name = self.last_name + + email = self.email + + personal_unit: Union[None, Unset, int] + if isinstance(self.personal_unit, Unset): + personal_unit = UNSET + else: + personal_unit = self.personal_unit + + is_active = self.is_active + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if username is not UNSET: + field_dict["username"] = username + if first_name is not UNSET: + field_dict["first_name"] = first_name + if last_name is not UNSET: + field_dict["last_name"] = last_name + if email is not UNSET: + field_dict["email"] = email + if personal_unit is not UNSET: + field_dict["personal_unit"] = personal_unit + if is_active is not UNSET: + field_dict["is_active"] = is_active + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.username, Unset): + files.append(("username", (None, str(self.username).encode(), "text/plain"))) + + if not isinstance(self.first_name, Unset): + files.append(("first_name", (None, str(self.first_name).encode(), "text/plain"))) + + if not isinstance(self.last_name, Unset): + files.append(("last_name", (None, str(self.last_name).encode(), "text/plain"))) + + if not isinstance(self.email, Unset): + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + if not isinstance(self.personal_unit, Unset): + if isinstance(self.personal_unit, int): + files.append(("personal_unit", (None, str(self.personal_unit).encode(), "text/plain"))) + else: + files.append(("personal_unit", (None, str(self.personal_unit).encode(), "text/plain"))) + + if not isinstance(self.is_active, Unset): + files.append(("is_active", (None, str(self.is_active).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + username = d.pop("username", UNSET) + + first_name = d.pop("first_name", UNSET) + + last_name = d.pop("last_name", UNSET) + + email = d.pop("email", UNSET) + + def _parse_personal_unit(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + personal_unit = _parse_personal_unit(d.pop("personal_unit", UNSET)) + + is_active = d.pop("is_active", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + patched_poly_ticket_user = cls( + id=id, + username=username, + first_name=first_name, + last_name=last_name, + email=email, + personal_unit=personal_unit, + is_active=is_active, + is_deleted=is_deleted, + ) + + patched_poly_ticket_user.additional_properties = d + return patched_poly_ticket_user + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_promotion_code.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_promotion_code.py new file mode 100644 index 0000000..9ded215 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_promotion_code.py @@ -0,0 +1,120 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedPromotionCode") + + +@_attrs_define +class PatchedPromotionCode: + """Serializer for PromotionCode model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + name (Union[Unset, str]): name of the promotion that will be shown + value (Union[Unset, str]): value of the code that users will have to enter to get the promotion + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + value: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + name = self.name + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.value, Unset): + files.append(("value", (None, str(self.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + value = d.pop("value", UNSET) + + patched_promotion_code = cls( + event=event, + event_id=event_id, + id=id, + name=name, + value=value, + ) + + patched_promotion_code.additional_properties = d + return patched_promotion_code + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_selected_node_extra_info.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_selected_node_extra_info.py new file mode 100644 index 0000000..f22e923 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_selected_node_extra_info.py @@ -0,0 +1,265 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.model_form_line_type import ModelFormLineType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedSelectedNodeExtraInfo") + + +@_attrs_define +class PatchedSelectedNodeExtraInfo: + """Serializer for `SelectedNodeExtraInfo` model + + Attributes: + id (Union[Unset, int]): + group_id (Union[Unset, int]): + order (Union[Unset, int]): + type_ (Union[Unset, ModelFormLineType]): * `text` - Simple text + * `email` - Email + * `phone` - Phone + * `country` - Country + * `numerical` - Numerical + * `textarea` - Multi-line text input + * `boolean` - Boolean + * `datetime` - Datetime + * `date` - Date + * `date_major` - Birthdate with majority required + * `choice` - Choice + * `file` - File + name (Union[Unset, str]): + text (Union[Unset, str]): + help_text (Union[Unset, str]): + is_required (Union[Unset, bool]): + choices_json (Union[None, Unset, str]): + major_json (Union[None, Unset, str]): + range_json (Union[None, Unset, str]): + value (Union[Unset, str]): value entered in the form + """ + + id: Union[Unset, int] = UNSET + group_id: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + type_: Union[Unset, ModelFormLineType] = UNSET + name: Union[Unset, str] = UNSET + text: Union[Unset, str] = UNSET + help_text: Union[Unset, str] = UNSET + is_required: Union[Unset, bool] = UNSET + choices_json: Union[None, Unset, str] = UNSET + major_json: Union[None, Unset, str] = UNSET + range_json: Union[None, Unset, str] = UNSET + value: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + group_id = self.group_id + + order = self.order + + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + name = self.name + + text = self.text + + help_text = self.help_text + + is_required = self.is_required + + choices_json: Union[None, Unset, str] + if isinstance(self.choices_json, Unset): + choices_json = UNSET + else: + choices_json = self.choices_json + + major_json: Union[None, Unset, str] + if isinstance(self.major_json, Unset): + major_json = UNSET + else: + major_json = self.major_json + + range_json: Union[None, Unset, str] + if isinstance(self.range_json, Unset): + range_json = UNSET + else: + range_json = self.range_json + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if group_id is not UNSET: + field_dict["group_id"] = group_id + if order is not UNSET: + field_dict["order"] = order + if type_ is not UNSET: + field_dict["type"] = type_ + if name is not UNSET: + field_dict["name"] = name + if text is not UNSET: + field_dict["text"] = text + if help_text is not UNSET: + field_dict["help_text"] = help_text + if is_required is not UNSET: + field_dict["is_required"] = is_required + if choices_json is not UNSET: + field_dict["choices_json"] = choices_json + if major_json is not UNSET: + field_dict["major_json"] = major_json + if range_json is not UNSET: + field_dict["range_json"] = range_json + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.group_id, Unset): + files.append(("group_id", (None, str(self.group_id).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.type_, Unset): + files.append(("type", (None, str(self.type_.value).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.text, Unset): + files.append(("text", (None, str(self.text).encode(), "text/plain"))) + + if not isinstance(self.help_text, Unset): + files.append(("help_text", (None, str(self.help_text).encode(), "text/plain"))) + + if not isinstance(self.is_required, Unset): + files.append(("is_required", (None, str(self.is_required).encode(), "text/plain"))) + + if not isinstance(self.choices_json, Unset): + if isinstance(self.choices_json, str): + files.append(("choices_json", (None, str(self.choices_json).encode(), "text/plain"))) + else: + files.append(("choices_json", (None, str(self.choices_json).encode(), "text/plain"))) + + if not isinstance(self.major_json, Unset): + if isinstance(self.major_json, str): + files.append(("major_json", (None, str(self.major_json).encode(), "text/plain"))) + else: + files.append(("major_json", (None, str(self.major_json).encode(), "text/plain"))) + + if not isinstance(self.range_json, Unset): + if isinstance(self.range_json, str): + files.append(("range_json", (None, str(self.range_json).encode(), "text/plain"))) + else: + files.append(("range_json", (None, str(self.range_json).encode(), "text/plain"))) + + if not isinstance(self.value, Unset): + files.append(("value", (None, str(self.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + group_id = d.pop("group_id", UNSET) + + order = d.pop("order", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Union[Unset, ModelFormLineType] + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = ModelFormLineType(_type_) + + name = d.pop("name", UNSET) + + text = d.pop("text", UNSET) + + help_text = d.pop("help_text", UNSET) + + is_required = d.pop("is_required", UNSET) + + def _parse_choices_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + choices_json = _parse_choices_json(d.pop("choices_json", UNSET)) + + def _parse_major_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + major_json = _parse_major_json(d.pop("major_json", UNSET)) + + def _parse_range_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + range_json = _parse_range_json(d.pop("range_json", UNSET)) + + value = d.pop("value", UNSET) + + patched_selected_node_extra_info = cls( + id=id, + group_id=group_id, + order=order, + type_=type_, + name=name, + text=text, + help_text=help_text, + is_required=is_required, + choices_json=choices_json, + major_json=major_json, + range_json=range_json, + value=value, + ) + + patched_selected_node_extra_info.additional_properties = d + return patched_selected_node_extra_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_statement.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_statement.py new file mode 100644 index 0000000..b34fd66 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_statement.py @@ -0,0 +1,265 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.blank_enum import BlankEnum +from ..models.left_hand_operand_enum import LeftHandOperandEnum +from ..models.operator_enum import OperatorEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedStatement") + + +@_attrs_define +class PatchedStatement: + """Serializer for the Statement model + + Attributes: + event (Union[Unset, int]): + event_id (Union[Unset, int]): + id (Union[Unset, int]): + order (Union[Unset, int]): order between statements of the same condition + condition (Union[Unset, int]): a statement is linked to a condition, to 're-use' statement, use a condition + instead of a statement + left_hand_operand (Union[BlankEnum, LeftHandOperandEnum, Unset]): + left_hand_value (Union[Unset, str]): user defined value + operator (Union[BlankEnum, OperatorEnum, Unset]): with some left hand operands, the operator is unnecessary + + * `>` - Greater + * `>=` - Greater Or Equal + * `=` - Equal + * `!=` - Not Equal + * `<` - Less + * `<=` - Less Or Equal + * `exists` - Exists + * `contains` - Contains + * `is in` - Is In + right_hand_value (Union[Unset, str]): right hand operand: User defined value (this can be an empty string with + Operator.EXISTS) + condition_as_statement (Union[None, Unset, int]): use a condition as a statement (nested condition) + """ + + event: Union[Unset, int] = UNSET + event_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + condition: Union[Unset, int] = UNSET + left_hand_operand: Union[BlankEnum, LeftHandOperandEnum, Unset] = UNSET + left_hand_value: Union[Unset, str] = UNSET + operator: Union[BlankEnum, OperatorEnum, Unset] = UNSET + right_hand_value: Union[Unset, str] = UNSET + condition_as_statement: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + order = self.order + + condition = self.condition + + left_hand_operand: Union[Unset, str] + if isinstance(self.left_hand_operand, Unset): + left_hand_operand = UNSET + elif isinstance(self.left_hand_operand, LeftHandOperandEnum): + left_hand_operand = self.left_hand_operand.value + else: + left_hand_operand = self.left_hand_operand.value + + left_hand_value = self.left_hand_value + + operator: Union[Unset, str] + if isinstance(self.operator, Unset): + operator = UNSET + elif isinstance(self.operator, OperatorEnum): + operator = self.operator.value + else: + operator = self.operator.value + + right_hand_value = self.right_hand_value + + condition_as_statement: Union[None, Unset, int] + if isinstance(self.condition_as_statement, Unset): + condition_as_statement = UNSET + else: + condition_as_statement = self.condition_as_statement + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event is not UNSET: + field_dict["event"] = event + if event_id is not UNSET: + field_dict["event_id"] = event_id + if id is not UNSET: + field_dict["id"] = id + if order is not UNSET: + field_dict["order"] = order + if condition is not UNSET: + field_dict["condition"] = condition + if left_hand_operand is not UNSET: + field_dict["left_hand_operand"] = left_hand_operand + if left_hand_value is not UNSET: + field_dict["left_hand_value"] = left_hand_value + if operator is not UNSET: + field_dict["operator"] = operator + if right_hand_value is not UNSET: + field_dict["right_hand_value"] = right_hand_value + if condition_as_statement is not UNSET: + field_dict["condition_as_statement"] = condition_as_statement + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.event, Unset): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.event_id, Unset): + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.order, Unset): + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + if not isinstance(self.condition, Unset): + files.append(("condition", (None, str(self.condition).encode(), "text/plain"))) + + if not isinstance(self.left_hand_operand, Unset): + if isinstance(self.left_hand_operand, LeftHandOperandEnum): + files.append(("left_hand_operand", (None, str(self.left_hand_operand.value).encode(), "text/plain"))) + else: + files.append(("left_hand_operand", (None, str(self.left_hand_operand.value).encode(), "text/plain"))) + + if not isinstance(self.left_hand_value, Unset): + files.append(("left_hand_value", (None, str(self.left_hand_value).encode(), "text/plain"))) + + if not isinstance(self.operator, Unset): + if isinstance(self.operator, OperatorEnum): + files.append(("operator", (None, str(self.operator.value).encode(), "text/plain"))) + else: + files.append(("operator", (None, str(self.operator.value).encode(), "text/plain"))) + + if not isinstance(self.right_hand_value, Unset): + files.append(("right_hand_value", (None, str(self.right_hand_value).encode(), "text/plain"))) + + if not isinstance(self.condition_as_statement, Unset): + if isinstance(self.condition_as_statement, int): + files.append( + ("condition_as_statement", (None, str(self.condition_as_statement).encode(), "text/plain")) + ) + else: + files.append( + ("condition_as_statement", (None, str(self.condition_as_statement).encode(), "text/plain")) + ) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event", UNSET) + + event_id = d.pop("event_id", UNSET) + + id = d.pop("id", UNSET) + + order = d.pop("order", UNSET) + + condition = d.pop("condition", UNSET) + + def _parse_left_hand_operand(data: object) -> Union[BlankEnum, LeftHandOperandEnum, Unset]: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + left_hand_operand_type_0 = LeftHandOperandEnum(data) + + return left_hand_operand_type_0 + except: # noqa: E722 + pass + if not isinstance(data, str): + raise TypeError() + left_hand_operand_type_1 = BlankEnum(data) + + return left_hand_operand_type_1 + + left_hand_operand = _parse_left_hand_operand(d.pop("left_hand_operand", UNSET)) + + left_hand_value = d.pop("left_hand_value", UNSET) + + def _parse_operator(data: object) -> Union[BlankEnum, OperatorEnum, Unset]: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + operator_type_0 = OperatorEnum(data) + + return operator_type_0 + except: # noqa: E722 + pass + if not isinstance(data, str): + raise TypeError() + operator_type_1 = BlankEnum(data) + + return operator_type_1 + + operator = _parse_operator(d.pop("operator", UNSET)) + + right_hand_value = d.pop("right_hand_value", UNSET) + + def _parse_condition_as_statement(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + condition_as_statement = _parse_condition_as_statement(d.pop("condition_as_statement", UNSET)) + + patched_statement = cls( + event=event, + event_id=event_id, + id=id, + order=order, + condition=condition, + left_hand_operand=left_hand_operand, + left_hand_value=left_hand_value, + operator=operator, + right_hand_value=right_hand_value, + condition_as_statement=condition_as_statement, + ) + + patched_statement.additional_properties = d + return patched_statement + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_unit.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_unit.py new file mode 100644 index 0000000..a539461 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_unit.py @@ -0,0 +1,146 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedUnit") + + +@_attrs_define +class PatchedUnit: + """Serializer for Unit model + + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + description (Union[Unset, str]): Description of the Unit. Some restricted HTML markup is allowed, everything + else is filtered out automatically. + iban (Union[Unset, str]): + address (Union[Unset, str]): + payout_account_holder (Union[Unset, str]): + email (Union[Unset, str]): This field will be used as a main contact point for the unit, e.g. for sending them + statements, or to show to ticket buyers on how they can contact the organizer. + """ + + id: Union[Unset, int] = UNSET + name: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + iban: Union[Unset, str] = UNSET + address: Union[Unset, str] = UNSET + payout_account_holder: Union[Unset, str] = UNSET + email: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + description = self.description + + iban = self.iban + + address = self.address + + payout_account_holder = self.payout_account_holder + + email = self.email + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if iban is not UNSET: + field_dict["iban"] = iban + if address is not UNSET: + field_dict["address"] = address + if payout_account_holder is not UNSET: + field_dict["payout_account_holder"] = payout_account_holder + if email is not UNSET: + field_dict["email"] = email + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.name, Unset): + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + if not isinstance(self.description, Unset): + files.append(("description", (None, str(self.description).encode(), "text/plain"))) + + if not isinstance(self.iban, Unset): + files.append(("iban", (None, str(self.iban).encode(), "text/plain"))) + + if not isinstance(self.address, Unset): + files.append(("address", (None, str(self.address).encode(), "text/plain"))) + + if not isinstance(self.payout_account_holder, Unset): + files.append(("payout_account_holder", (None, str(self.payout_account_holder).encode(), "text/plain"))) + + if not isinstance(self.email, Unset): + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + iban = d.pop("iban", UNSET) + + address = d.pop("address", UNSET) + + payout_account_holder = d.pop("payout_account_holder", UNSET) + + email = d.pop("email", UNSET) + + patched_unit = cls( + id=id, + name=name, + description=description, + iban=iban, + address=address, + payout_account_holder=payout_account_holder, + email=email, + ) + + patched_unit.additional_properties = d + return patched_unit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_unit_membership.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_unit_membership.py new file mode 100644 index 0000000..81f1500 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_unit_membership.py @@ -0,0 +1,129 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.unit_membership_role_enum import UnitMembershipRoleEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedUnitMembership") + + +@_attrs_define +class PatchedUnitMembership: + """Serializer for UnitMembership model + + Attributes: + id (Union[Unset, int]): + user (Union[Unset, int]): + unit (Union[Unset, int]): + role (Union[Unset, UnitMembershipRoleEnum]): * `owner` - Owner + * `member` - Member + user_email (Union[Unset, str]): + """ + + id: Union[Unset, int] = UNSET + user: Union[Unset, int] = UNSET + unit: Union[Unset, int] = UNSET + role: Union[Unset, UnitMembershipRoleEnum] = UNSET + user_email: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + user = self.user + + unit = self.unit + + role: Union[Unset, str] = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + user_email = self.user_email + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if user is not UNSET: + field_dict["user"] = user + if unit is not UNSET: + field_dict["unit"] = unit + if role is not UNSET: + field_dict["role"] = role + if user_email is not UNSET: + field_dict["user_email"] = user_email + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.user, Unset): + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + + if not isinstance(self.unit, Unset): + files.append(("unit", (None, str(self.unit).encode(), "text/plain"))) + + if not isinstance(self.role, Unset): + files.append(("role", (None, str(self.role.value).encode(), "text/plain"))) + + if not isinstance(self.user_email, Unset): + files.append(("user_email", (None, str(self.user_email).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + user = d.pop("user", UNSET) + + unit = d.pop("unit", UNSET) + + _role = d.pop("role", UNSET) + role: Union[Unset, UnitMembershipRoleEnum] + if isinstance(_role, Unset): + role = UNSET + else: + role = UnitMembershipRoleEnum(_role) + + user_email = d.pop("user_email", UNSET) + + patched_unit_membership = cls( + id=id, + user=user, + unit=unit, + role=role, + user_email=user_email, + ) + + patched_unit_membership.additional_properties = d + return patched_unit_membership + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/patched_uploaded_image.py b/poly-ticket-api-client/poly_ticket_api_client/models/patched_uploaded_image.py new file mode 100644 index 0000000..a20c82d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/patched_uploaded_image.py @@ -0,0 +1,204 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..models.privacy_level_enum import PrivacyLevelEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PatchedUploadedImage") + + +@_attrs_define +class PatchedUploadedImage: + """ + Attributes: + id (Union[Unset, int]): + file (Union[Unset, str]): + uploaded_at (Union[Unset, datetime.datetime]): the datetime the image was uploaded at + event (Union[None, Unset, int]): the event associated to the image + frontend_login (Union[None, Unset, int]): the frontendlogin who uploaded the image + user (Union[None, Unset, int]): the user who uploaded the image + privacy_level (Union[Unset, PrivacyLevelEnum]): * `public` - Public + * `event` - Event + * `personal` - Personal + """ + + id: Union[Unset, int] = UNSET + file: Union[Unset, str] = UNSET + uploaded_at: Union[Unset, datetime.datetime] = UNSET + event: Union[None, Unset, int] = UNSET + frontend_login: Union[None, Unset, int] = UNSET + user: Union[None, Unset, int] = UNSET + privacy_level: Union[Unset, PrivacyLevelEnum] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + file = self.file + + uploaded_at: Union[Unset, str] = UNSET + if not isinstance(self.uploaded_at, Unset): + uploaded_at = self.uploaded_at.isoformat() + + event: Union[None, Unset, int] + if isinstance(self.event, Unset): + event = UNSET + else: + event = self.event + + frontend_login: Union[None, Unset, int] + if isinstance(self.frontend_login, Unset): + frontend_login = UNSET + else: + frontend_login = self.frontend_login + + user: Union[None, Unset, int] + if isinstance(self.user, Unset): + user = UNSET + else: + user = self.user + + privacy_level: Union[Unset, str] = UNSET + if not isinstance(self.privacy_level, Unset): + privacy_level = self.privacy_level.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if file is not UNSET: + field_dict["file"] = file + if uploaded_at is not UNSET: + field_dict["uploaded_at"] = uploaded_at + if event is not UNSET: + field_dict["event"] = event + if frontend_login is not UNSET: + field_dict["frontend_login"] = frontend_login + if user is not UNSET: + field_dict["user"] = user + if privacy_level is not UNSET: + field_dict["privacy_level"] = privacy_level + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + if not isinstance(self.id, Unset): + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + if not isinstance(self.file, Unset): + files.append(("file", (None, str(self.file).encode(), "text/plain"))) + + if not isinstance(self.uploaded_at, Unset): + files.append(("uploaded_at", (None, self.uploaded_at.isoformat().encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + if isinstance(self.event, int): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + else: + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.frontend_login, Unset): + if isinstance(self.frontend_login, int): + files.append(("frontend_login", (None, str(self.frontend_login).encode(), "text/plain"))) + else: + files.append(("frontend_login", (None, str(self.frontend_login).encode(), "text/plain"))) + + if not isinstance(self.user, Unset): + if isinstance(self.user, int): + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + else: + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + + if not isinstance(self.privacy_level, Unset): + files.append(("privacy_level", (None, str(self.privacy_level.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + file = d.pop("file", UNSET) + + _uploaded_at = d.pop("uploaded_at", UNSET) + uploaded_at: Union[Unset, datetime.datetime] + if isinstance(_uploaded_at, Unset): + uploaded_at = UNSET + else: + uploaded_at = isoparse(_uploaded_at) + + def _parse_event(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + event = _parse_event(d.pop("event", UNSET)) + + def _parse_frontend_login(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + frontend_login = _parse_frontend_login(d.pop("frontend_login", UNSET)) + + def _parse_user(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + user = _parse_user(d.pop("user", UNSET)) + + _privacy_level = d.pop("privacy_level", UNSET) + privacy_level: Union[Unset, PrivacyLevelEnum] + if isinstance(_privacy_level, Unset): + privacy_level = UNSET + else: + privacy_level = PrivacyLevelEnum(_privacy_level) + + patched_uploaded_image = cls( + id=id, + file=file, + uploaded_at=uploaded_at, + event=event, + frontend_login=frontend_login, + user=user, + privacy_level=privacy_level, + ) + + patched_uploaded_image.additional_properties = d + return patched_uploaded_image + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent.py b/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent.py new file mode 100644 index 0000000..f9afae9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent.py @@ -0,0 +1,178 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PaymentIntent") + + +@_attrs_define +class PaymentIntent: + """A serializer for Payment Intent. This serializer may contain invoice or invoice_id depending on what the expand + parameter is. + + Attributes: + id (int): + created_at (datetime.datetime): + module_key (str): + invoice_id (int): Id of the related invoice + error_message (str): Payment provider's error message if payment is refused + created_by (Union[None, Unset, int]): + psp_id (Union[Unset, str]): + is_error (Union[Unset, bool]): + is_cancelled (Union[Unset, bool]): + """ + + id: int + created_at: datetime.datetime + module_key: str + invoice_id: int + error_message: str + created_by: Union[None, Unset, int] = UNSET + psp_id: Union[Unset, str] = UNSET + is_error: Union[Unset, bool] = UNSET + is_cancelled: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + created_at = self.created_at.isoformat() + + module_key = self.module_key + + invoice_id = self.invoice_id + + error_message = self.error_message + + created_by: Union[None, Unset, int] + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + psp_id = self.psp_id + + is_error = self.is_error + + is_cancelled = self.is_cancelled + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "created_at": created_at, + "module_key": module_key, + "invoice_id": invoice_id, + "error_message": error_message, + } + ) + if created_by is not UNSET: + field_dict["created_by"] = created_by + if psp_id is not UNSET: + field_dict["psp_id"] = psp_id + if is_error is not UNSET: + field_dict["is_error"] = is_error + if is_cancelled is not UNSET: + field_dict["is_cancelled"] = is_cancelled + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("created_at", (None, self.created_at.isoformat().encode(), "text/plain"))) + + files.append(("module_key", (None, str(self.module_key).encode(), "text/plain"))) + + files.append(("invoice_id", (None, str(self.invoice_id).encode(), "text/plain"))) + + files.append(("error_message", (None, str(self.error_message).encode(), "text/plain"))) + + if not isinstance(self.created_by, Unset): + if isinstance(self.created_by, int): + files.append(("created_by", (None, str(self.created_by).encode(), "text/plain"))) + else: + files.append(("created_by", (None, str(self.created_by).encode(), "text/plain"))) + + if not isinstance(self.psp_id, Unset): + files.append(("psp_id", (None, str(self.psp_id).encode(), "text/plain"))) + + if not isinstance(self.is_error, Unset): + files.append(("is_error", (None, str(self.is_error).encode(), "text/plain"))) + + if not isinstance(self.is_cancelled, Unset): + files.append(("is_cancelled", (None, str(self.is_cancelled).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + created_at = isoparse(d.pop("created_at")) + + module_key = d.pop("module_key") + + invoice_id = d.pop("invoice_id") + + error_message = d.pop("error_message") + + def _parse_created_by(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + created_by = _parse_created_by(d.pop("created_by", UNSET)) + + psp_id = d.pop("psp_id", UNSET) + + is_error = d.pop("is_error", UNSET) + + is_cancelled = d.pop("is_cancelled", UNSET) + + payment_intent = cls( + id=id, + created_at=created_at, + module_key=module_key, + invoice_id=invoice_id, + error_message=error_message, + created_by=created_by, + psp_id=psp_id, + is_error=is_error, + is_cancelled=is_cancelled, + ) + + payment_intent.additional_properties = d + return payment_intent + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update.py b/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update.py new file mode 100644 index 0000000..f92aa7b --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.payment_intent_request_update_status_enum import PaymentIntentRequestUpdateStatusEnum + +T = TypeVar("T", bound="PaymentIntentRequestUpdate") + + +@_attrs_define +class PaymentIntentRequestUpdate: + """A serializer for Payment Intent Request Update containing the status of the PSP + + Attributes: + status (PaymentIntentRequestUpdateStatusEnum): * `cancel` - Cancel + * `error` - Error + * `success` - Success + """ + + status: PaymentIntentRequestUpdateStatusEnum + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status = self.status.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status": status, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("status", (None, str(self.status.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status = PaymentIntentRequestUpdateStatusEnum(d.pop("status")) + + payment_intent_request_update = cls( + status=status, + ) + + payment_intent_request_update.additional_properties = d + return payment_intent_request_update + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update_status_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update_status_enum.py new file mode 100644 index 0000000..cd1272e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payment_intent_request_update_status_enum.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PaymentIntentRequestUpdateStatusEnum(str, Enum): + CANCEL = "cancel" + ERROR = "error" + SUCCESS = "success" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payment_method.py b/poly-ticket-api-client/poly_ticket_api_client/models/payment_method.py new file mode 100644 index 0000000..afad4c2 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payment_method.py @@ -0,0 +1,101 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PaymentMethod") + + +@_attrs_define +class PaymentMethod: + """A serializer returning info for a payment method + + Attributes: + active_module_id (int): The id of the payment method's active module + key (str): + title (str): Title of the payment method + description (str): Description of the payment method + basket_total_amount (float): The total amount of the basket when using this payment method (e.g. surcharges) + payment_module_price_extra (float): The difference between the total of the basket with the amount added from + the payment module and the total of the basket without + """ + + active_module_id: int + key: str + title: str + description: str + basket_total_amount: float + payment_module_price_extra: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_module_id = self.active_module_id + + key = self.key + + title = self.title + + description = self.description + + basket_total_amount = self.basket_total_amount + + payment_module_price_extra = self.payment_module_price_extra + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_module_id": active_module_id, + "key": key, + "title": title, + "description": description, + "basket_total_amount": basket_total_amount, + "payment_module_price_extra": payment_module_price_extra, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_module_id = d.pop("active_module_id") + + key = d.pop("key") + + title = d.pop("title") + + description = d.pop("description") + + basket_total_amount = d.pop("basket_total_amount") + + payment_module_price_extra = d.pop("payment_module_price_extra") + + payment_method = cls( + active_module_id=active_module_id, + key=key, + title=title, + description=description, + basket_total_amount=basket_total_amount, + payment_module_price_extra=payment_module_price_extra, + ) + + payment_method.additional_properties = d + return payment_method + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payment_start.py b/poly-ticket-api-client/poly_ticket_api_client/models/payment_start.py new file mode 100644 index 0000000..69d61af --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payment_start.py @@ -0,0 +1,138 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.payment_intent import PaymentIntent + + +T = TypeVar("T", bound="PaymentStart") + + +@_attrs_define +class PaymentStart: + """A serializer with a basket as an input to start the payment and with a payment link for the response + + Attributes: + basket (int): The basket you want to start the payment for + link (str): If the chosen payment method requires an external redirect, this attribute will contain the fully + qualified URL to redirect the user to + is_external_redirect (bool): If true, the user must be redirected to the link. Otherwise, the payment process + requires more actions in the front end. + is_terms_of_service_accepted (bool): Must be true to validate a payment start. + payment_intent (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice or + invoice_id depending on what the expand parameter is. + active_module_id (Union[Unset, int]): The ID of the payment method's active module you want to start a payment + with. If this is a free payment, the attribute is not required. + """ + + basket: int + link: str + is_external_redirect: bool + is_terms_of_service_accepted: bool + payment_intent: "PaymentIntent" + active_module_id: Union[Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + basket = self.basket + + link = self.link + + is_external_redirect = self.is_external_redirect + + is_terms_of_service_accepted = self.is_terms_of_service_accepted + + payment_intent = self.payment_intent.to_dict() + + active_module_id = self.active_module_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "basket": basket, + "link": link, + "is_external_redirect": is_external_redirect, + "is_terms_of_service_accepted": is_terms_of_service_accepted, + "payment_intent": payment_intent, + } + ) + if active_module_id is not UNSET: + field_dict["active_module_id"] = active_module_id + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("basket", (None, str(self.basket).encode(), "text/plain"))) + + files.append(("link", (None, str(self.link).encode(), "text/plain"))) + + files.append(("is_external_redirect", (None, str(self.is_external_redirect).encode(), "text/plain"))) + + files.append( + ("is_terms_of_service_accepted", (None, str(self.is_terms_of_service_accepted).encode(), "text/plain")) + ) + + files.append(("payment_intent", (None, json.dumps(self.payment_intent.to_dict()).encode(), "application/json"))) + + if not isinstance(self.active_module_id, Unset): + files.append(("active_module_id", (None, str(self.active_module_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.payment_intent import PaymentIntent + + d = dict(src_dict) + basket = d.pop("basket") + + link = d.pop("link") + + is_external_redirect = d.pop("is_external_redirect") + + is_terms_of_service_accepted = d.pop("is_terms_of_service_accepted") + + payment_intent = PaymentIntent.from_dict(d.pop("payment_intent")) + + active_module_id = d.pop("active_module_id", UNSET) + + payment_start = cls( + basket=basket, + link=link, + is_external_redirect=is_external_redirect, + is_terms_of_service_accepted=is_terms_of_service_accepted, + payment_intent=payment_intent, + active_module_id=active_module_id, + ) + + payment_start.additional_properties = d + return payment_start + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payrexx_payment.py b/poly-ticket-api-client/poly_ticket_api_client/models/payrexx_payment.py new file mode 100644 index 0000000..cbf5bc5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payrexx_payment.py @@ -0,0 +1,60 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PayrexxPayment") + + +@_attrs_define +class PayrexxPayment: + """Payment info related to the transaction + + Attributes: + brand (str): Brand used to make the payment. + """ + + brand: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + brand = self.brand + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "brand": brand, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + brand = d.pop("brand") + + payrexx_payment = cls( + brand=brand, + ) + + payrexx_payment.additional_properties = d + return payrexx_payment + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/payrexx_transaction.py b/poly-ticket-api-client/poly_ticket_api_client/models/payrexx_transaction.py new file mode 100644 index 0000000..2b71dcf --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/payrexx_transaction.py @@ -0,0 +1,118 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.payrexx_payment import PayrexxPayment + + +T = TypeVar("T", bound="PayrexxTransaction") + + +@_attrs_define +class PayrexxTransaction: + """Transaction containing info for the webhook. + + referenceId can't be snake_case because the data is provided from Payrexx. + + Attributes: + id (int): The ID of the transaction. + uuid (str): The UUID of the transaction. + status (str): The status of the transaction. + reference_id (str): The reference containing PolyTicket env and Payment intent id. + amount (int): The amount of the transaction in cents. + payment (Union[Unset, PayrexxPayment]): Payment info related to the transaction + """ + + id: int + uuid: str + status: str + reference_id: str + amount: int + payment: Union[Unset, "PayrexxPayment"] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + uuid = self.uuid + + status = self.status + + reference_id = self.reference_id + + amount = self.amount + + payment: Union[Unset, dict[str, Any]] = UNSET + if not isinstance(self.payment, Unset): + payment = self.payment.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "uuid": uuid, + "status": status, + "referenceId": reference_id, + "amount": amount, + } + ) + if payment is not UNSET: + field_dict["payment"] = payment + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.payrexx_payment import PayrexxPayment + + d = dict(src_dict) + id = d.pop("id") + + uuid = d.pop("uuid") + + status = d.pop("status") + + reference_id = d.pop("referenceId") + + amount = d.pop("amount") + + _payment = d.pop("payment", UNSET) + payment: Union[Unset, PayrexxPayment] + if isinstance(_payment, Unset): + payment = UNSET + else: + payment = PayrexxPayment.from_dict(_payment) + + payrexx_transaction = cls( + id=id, + uuid=uuid, + status=status, + reference_id=reference_id, + amount=amount, + payment=payment, + ) + + payrexx_transaction.additional_properties = d + return payrexx_transaction + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place.py b/poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place.py new file mode 100644 index 0000000..6d08a0a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place.py @@ -0,0 +1,139 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PointOfSalePlace") + + +@_attrs_define +class PointOfSalePlace: + """A serializer read/write used only by authenticated users. It deals with the point of sale places resource. + This serializer is also used to display places as part of the module configuration view. + + Attributes: + id (int): + configuration (int): + order (int): + title (str): + description (str): Description of a point of sale. Some restricted HTML markup is allowed, everything else is + filtered out automatically. + monomode_url (str): + monomode_testing_url (str): + can_edit_registrations (Union[Unset, bool]): + can_edit_users (Union[Unset, bool]): + can_ignore_limits (Union[Unset, bool]): + """ + + id: int + configuration: int + order: int + title: str + description: str + monomode_url: str + monomode_testing_url: str + can_edit_registrations: Union[Unset, bool] = UNSET + can_edit_users: Union[Unset, bool] = UNSET + can_ignore_limits: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + configuration = self.configuration + + order = self.order + + title = self.title + + description = self.description + + monomode_url = self.monomode_url + + monomode_testing_url = self.monomode_testing_url + + can_edit_registrations = self.can_edit_registrations + + can_edit_users = self.can_edit_users + + can_ignore_limits = self.can_ignore_limits + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "configuration": configuration, + "order": order, + "title": title, + "description": description, + "monomode_url": monomode_url, + "monomode_testing_url": monomode_testing_url, + } + ) + if can_edit_registrations is not UNSET: + field_dict["can_edit_registrations"] = can_edit_registrations + if can_edit_users is not UNSET: + field_dict["can_edit_users"] = can_edit_users + if can_ignore_limits is not UNSET: + field_dict["can_ignore_limits"] = can_ignore_limits + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + configuration = d.pop("configuration") + + order = d.pop("order") + + title = d.pop("title") + + description = d.pop("description") + + monomode_url = d.pop("monomode_url") + + monomode_testing_url = d.pop("monomode_testing_url") + + can_edit_registrations = d.pop("can_edit_registrations", UNSET) + + can_edit_users = d.pop("can_edit_users", UNSET) + + can_ignore_limits = d.pop("can_ignore_limits", UNSET) + + point_of_sale_place = cls( + id=id, + configuration=configuration, + order=order, + title=title, + description=description, + monomode_url=monomode_url, + monomode_testing_url=monomode_testing_url, + can_edit_registrations=can_edit_registrations, + can_edit_users=can_edit_users, + can_ignore_limits=can_ignore_limits, + ) + + point_of_sale_place.additional_properties = d + return point_of_sale_place + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place_read_only.py b/poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place_read_only.py new file mode 100644 index 0000000..2dd5f96 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/point_of_sale_place_read_only.py @@ -0,0 +1,103 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="PointOfSalePlaceReadOnly") + + +@_attrs_define +class PointOfSalePlaceReadOnly: + """A serializer returning info for a point of sale place. You can access only read methods as a frontend login and will + only see some fields. + + Attributes: + id (int): + order (int): + title (str): + description (str): + """ + + id: int + order: int + title: str + description: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + title = self.title + + description = self.description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "title": title, + "description": description, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + files.append(("title", (None, str(self.title).encode(), "text/plain"))) + + files.append(("description", (None, str(self.description).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + title = d.pop("title") + + description = d.pop("description") + + point_of_sale_place_read_only = cls( + id=id, + order=order, + title=title, + description=description, + ) + + point_of_sale_place_read_only.additional_properties = d + return point_of_sale_place_read_only + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/poly_ticket_user.py b/poly-ticket-api-client/poly_ticket_api_client/models/poly_ticket_user.py new file mode 100644 index 0000000..9765927 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/poly_ticket_user.py @@ -0,0 +1,166 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PolyTicketUser") + + +@_attrs_define +class PolyTicketUser: + """ + Attributes: + id (int): + username (str): + email (str): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + personal_unit (Union[None, Unset, int]): + is_active (Union[Unset, bool]): + is_deleted (Union[Unset, bool]): + """ + + id: int + username: str + email: str + first_name: Union[Unset, str] = UNSET + last_name: Union[Unset, str] = UNSET + personal_unit: Union[None, Unset, int] = UNSET + is_active: Union[Unset, bool] = UNSET + is_deleted: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + username = self.username + + email = self.email + + first_name = self.first_name + + last_name = self.last_name + + personal_unit: Union[None, Unset, int] + if isinstance(self.personal_unit, Unset): + personal_unit = UNSET + else: + personal_unit = self.personal_unit + + is_active = self.is_active + + is_deleted = self.is_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "username": username, + "email": email, + } + ) + if first_name is not UNSET: + field_dict["first_name"] = first_name + if last_name is not UNSET: + field_dict["last_name"] = last_name + if personal_unit is not UNSET: + field_dict["personal_unit"] = personal_unit + if is_active is not UNSET: + field_dict["is_active"] = is_active + if is_deleted is not UNSET: + field_dict["is_deleted"] = is_deleted + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("username", (None, str(self.username).encode(), "text/plain"))) + + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + if not isinstance(self.first_name, Unset): + files.append(("first_name", (None, str(self.first_name).encode(), "text/plain"))) + + if not isinstance(self.last_name, Unset): + files.append(("last_name", (None, str(self.last_name).encode(), "text/plain"))) + + if not isinstance(self.personal_unit, Unset): + if isinstance(self.personal_unit, int): + files.append(("personal_unit", (None, str(self.personal_unit).encode(), "text/plain"))) + else: + files.append(("personal_unit", (None, str(self.personal_unit).encode(), "text/plain"))) + + if not isinstance(self.is_active, Unset): + files.append(("is_active", (None, str(self.is_active).encode(), "text/plain"))) + + if not isinstance(self.is_deleted, Unset): + files.append(("is_deleted", (None, str(self.is_deleted).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + username = d.pop("username") + + email = d.pop("email") + + first_name = d.pop("first_name", UNSET) + + last_name = d.pop("last_name", UNSET) + + def _parse_personal_unit(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + personal_unit = _parse_personal_unit(d.pop("personal_unit", UNSET)) + + is_active = d.pop("is_active", UNSET) + + is_deleted = d.pop("is_deleted", UNSET) + + poly_ticket_user = cls( + id=id, + username=username, + email=email, + first_name=first_name, + last_name=last_name, + personal_unit=personal_unit, + is_active=is_active, + is_deleted=is_deleted, + ) + + poly_ticket_user.additional_properties = d + return poly_ticket_user + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/privacy_level_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/privacy_level_enum.py new file mode 100644 index 0000000..a63ef9e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/privacy_level_enum.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PrivacyLevelEnum(str, Enum): + EVENT = "event" + PERSONAL = "personal" + PUBLIC = "public" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/promotion_code.py b/poly-ticket-api-client/poly_ticket_api_client/models/promotion_code.py new file mode 100644 index 0000000..3e13f2e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/promotion_code.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="PromotionCode") + + +@_attrs_define +class PromotionCode: + """Serializer for PromotionCode model + + Attributes: + event (int): + event_id (int): + id (int): + name (str): name of the promotion that will be shown + value (str): value of the code that users will have to enter to get the promotion + """ + + event: int + event_id: int + id: int + name: str + value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + name = self.name + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "name": name, + "value": value, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("value", (None, str(self.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + name = d.pop("name") + + value = d.pop("value") + + promotion_code = cls( + event=event, + event_id=event_id, + id=id, + name=name, + value=value, + ) + + promotion_code.additional_properties = d + return promotion_code + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/refund.py b/poly-ticket-api-client/poly_ticket_api_client/models/refund.py new file mode 100644 index 0000000..6f033b8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/refund.py @@ -0,0 +1,85 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="Refund") + + +@_attrs_define +class Refund: + """Write only serializer used to provide `refund_amount` and `payment_intent` to the action `refund` on + `InvoiceViewSet`. + A model serializer is used to give access to the targeted invoice, even though the fields are not part of the + invoice model. + + Attributes: + refund_amount (str): Amount to be refunded on the invoice. + payment_intent_id (int): The original payment intent linked to the invoice to be refunded. + """ + + refund_amount: str + payment_intent_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + refund_amount = self.refund_amount + + payment_intent_id = self.payment_intent_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "refund_amount": refund_amount, + "payment_intent_id": payment_intent_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("refund_amount", (None, str(self.refund_amount).encode(), "text/plain"))) + + files.append(("payment_intent_id", (None, str(self.payment_intent_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + refund_amount = d.pop("refund_amount") + + payment_intent_id = d.pop("payment_intent_id") + + refund = cls( + refund_amount=refund_amount, + payment_intent_id=payment_intent_id, + ) + + refund.additional_properties = d + return refund + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_format.py b/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_format.py new file mode 100644 index 0000000..a590295 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_format.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class SchemaRetrieveFormat(str, Enum): + JSON = "json" + YAML = "yaml" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_lang.py b/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_lang.py new file mode 100644 index 0000000..8a404a7 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_lang.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class SchemaRetrieveLang(str, Enum): + EN = "en" + FR = "fr" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_response_200.py b/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_response_200.py new file mode 100644 index 0000000..a1d5a07 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/schema_retrieve_response_200.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SchemaRetrieveResponse200") + + +@_attrs_define +class SchemaRetrieveResponse200: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema_retrieve_response_200 = cls() + + schema_retrieve_response_200.additional_properties = d + return schema_retrieve_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_node.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node.py new file mode 100644 index 0000000..f6b072e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node.py @@ -0,0 +1,140 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.selected_node_status_enum import SelectedNodeStatusEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SelectedNode") + + +@_attrs_define +class SelectedNode: + """Serializer for SelectedNode model + + Attributes: + id (int): + order (int): Local order between nodes that share the same parent + basket (int): + parent_id (int): + configuration_id (int): + price (float): + price_display (str): + is_article (Union[Unset, bool]): + status (Union[Unset, SelectedNodeStatusEnum]): * `new` - New + * `payment_in_progress` - Payment in progress + * `validated` - Validated + * `edition_in_progress` - Edition in progress + * `refunded` - Refunded + """ + + id: int + order: int + basket: int + parent_id: int + configuration_id: int + price: float + price_display: str + is_article: Union[Unset, bool] = UNSET + status: Union[Unset, SelectedNodeStatusEnum] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + basket = self.basket + + parent_id = self.parent_id + + configuration_id = self.configuration_id + + price = self.price + + price_display = self.price_display + + is_article = self.is_article + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "basket": basket, + "parent_id": parent_id, + "configuration_id": configuration_id, + "price": price, + "price_display": price_display, + } + ) + if is_article is not UNSET: + field_dict["is_article"] = is_article + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + basket = d.pop("basket") + + parent_id = d.pop("parent_id") + + configuration_id = d.pop("configuration_id") + + price = d.pop("price") + + price_display = d.pop("price_display") + + is_article = d.pop("is_article", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, SelectedNodeStatusEnum] + if isinstance(_status, Unset): + status = UNSET + else: + status = SelectedNodeStatusEnum(_status) + + selected_node = cls( + id=id, + order=order, + basket=basket, + parent_id=parent_id, + configuration_id=configuration_id, + price=price, + price_display=price_display, + is_article=is_article, + status=status, + ) + + selected_node.additional_properties = d + return selected_node + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_creation.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_creation.py new file mode 100644 index 0000000..3f88c61 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_creation.py @@ -0,0 +1,136 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.add_to_basket_node_extra_info_group import AddToBasketNodeExtraInfoGroup + + +T = TypeVar("T", bound="SelectedNodeCreation") + + +@_attrs_define +class SelectedNodeCreation: + """A serializer used specifically in the add-to-basket process. This serializer allows specifying all properties needed + to add one item to the basket, including any extra info (groups). + This serializer only needs the pks of Nodes, not of NodeConfigurations, as we can determine them directly in this + direction. + + Attributes: + node (int): + node_extra_info_groups (Union[Unset, list['AddToBasketNodeExtraInfoGroup']]): + children (Union[Unset, list['SelectedNodeCreation']]): + """ + + node: int + node_extra_info_groups: Union[Unset, list["AddToBasketNodeExtraInfoGroup"]] = UNSET + children: Union[Unset, list["SelectedNodeCreation"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + node = self.node + + node_extra_info_groups: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.node_extra_info_groups, Unset): + node_extra_info_groups = [] + for node_extra_info_groups_item_data in self.node_extra_info_groups: + node_extra_info_groups_item = node_extra_info_groups_item_data.to_dict() + node_extra_info_groups.append(node_extra_info_groups_item) + + children: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.children, Unset): + children = [] + for children_item_data in self.children: + children_item = children_item_data.to_dict() + children.append(children_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "node": node, + } + ) + if node_extra_info_groups is not UNSET: + field_dict["node_extra_info_groups"] = node_extra_info_groups + if children is not UNSET: + field_dict["children"] = children + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("node", (None, str(self.node).encode(), "text/plain"))) + + if not isinstance(self.node_extra_info_groups, Unset): + for node_extra_info_groups_item_element in self.node_extra_info_groups: + files.append( + ( + "node_extra_info_groups", + (None, json.dumps(node_extra_info_groups_item_element.to_dict()).encode(), "application/json"), + ) + ) + + if not isinstance(self.children, Unset): + for children_item_element in self.children: + files.append( + ("children", (None, json.dumps(children_item_element.to_dict()).encode(), "application/json")) + ) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.add_to_basket_node_extra_info_group import AddToBasketNodeExtraInfoGroup + + d = dict(src_dict) + node = d.pop("node") + + node_extra_info_groups = [] + _node_extra_info_groups = d.pop("node_extra_info_groups", UNSET) + for node_extra_info_groups_item_data in _node_extra_info_groups or []: + node_extra_info_groups_item = AddToBasketNodeExtraInfoGroup.from_dict(node_extra_info_groups_item_data) + + node_extra_info_groups.append(node_extra_info_groups_item) + + children = [] + _children = d.pop("children", UNSET) + for children_item_data in _children or []: + children_item = SelectedNodeCreation.from_dict(children_item_data) + + children.append(children_item) + + selected_node_creation = cls( + node=node, + node_extra_info_groups=node_extra_info_groups, + children=children, + ) + + selected_node_creation.additional_properties = d + return selected_node_creation + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_deletion.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_deletion.py new file mode 100644 index 0000000..b98a354 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_deletion.py @@ -0,0 +1,73 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="SelectedNodeDeletion") + + +@_attrs_define +class SelectedNodeDeletion: + """A serializer used specifically in the remove-from-basket process. This serializer takes only the id of the selected + node to delete. The selected node must currently be in the basket's registrations. + + Attributes: + selected_node_id (int): + """ + + selected_node_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + selected_node_id = self.selected_node_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "selected_node_id": selected_node_id, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("selected_node_id", (None, str(self.selected_node_id).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + selected_node_id = d.pop("selected_node_id") + + selected_node_deletion = cls( + selected_node_id=selected_node_id, + ) + + selected_node_deletion.additional_properties = d + return selected_node_deletion + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info.py new file mode 100644 index 0000000..5a2a4a1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info.py @@ -0,0 +1,181 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.model_form_line_type import ModelFormLineType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SelectedNodeExtraInfo") + + +@_attrs_define +class SelectedNodeExtraInfo: + """Serializer for `SelectedNodeExtraInfo` model + + Attributes: + id (int): + group_id (int): + order (int): + type_ (ModelFormLineType): * `text` - Simple text + * `email` - Email + * `phone` - Phone + * `country` - Country + * `numerical` - Numerical + * `textarea` - Multi-line text input + * `boolean` - Boolean + * `datetime` - Datetime + * `date` - Date + * `date_major` - Birthdate with majority required + * `choice` - Choice + * `file` - File + name (str): + text (str): + help_text (str): + is_required (bool): + choices_json (Union[None, str]): + major_json (Union[None, str]): + range_json (Union[None, str]): + value (Union[Unset, str]): value entered in the form + """ + + id: int + group_id: int + order: int + type_: ModelFormLineType + name: str + text: str + help_text: str + is_required: bool + choices_json: Union[None, str] + major_json: Union[None, str] + range_json: Union[None, str] + value: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + group_id = self.group_id + + order = self.order + + type_ = self.type_.value + + name = self.name + + text = self.text + + help_text = self.help_text + + is_required = self.is_required + + choices_json: Union[None, str] + choices_json = self.choices_json + + major_json: Union[None, str] + major_json = self.major_json + + range_json: Union[None, str] + range_json = self.range_json + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "group_id": group_id, + "order": order, + "type": type_, + "name": name, + "text": text, + "help_text": help_text, + "is_required": is_required, + "choices_json": choices_json, + "major_json": major_json, + "range_json": range_json, + } + ) + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + group_id = d.pop("group_id") + + order = d.pop("order") + + type_ = ModelFormLineType(d.pop("type")) + + name = d.pop("name") + + text = d.pop("text") + + help_text = d.pop("help_text") + + is_required = d.pop("is_required") + + def _parse_choices_json(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + choices_json = _parse_choices_json(d.pop("choices_json")) + + def _parse_major_json(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + major_json = _parse_major_json(d.pop("major_json")) + + def _parse_range_json(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + range_json = _parse_range_json(d.pop("range_json")) + + value = d.pop("value", UNSET) + + selected_node_extra_info = cls( + id=id, + group_id=group_id, + order=order, + type_=type_, + name=name, + text=text, + help_text=help_text, + is_required=is_required, + choices_json=choices_json, + major_json=major_json, + range_json=range_json, + value=value, + ) + + selected_node_extra_info.additional_properties = d + return selected_node_extra_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info_group.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info_group.py new file mode 100644 index 0000000..4ded2b0 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_extra_info_group.py @@ -0,0 +1,108 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SelectedNodeExtraInfoGroup") + + +@_attrs_define +class SelectedNodeExtraInfoGroup: + """Serializer for `SelectedNodeExtraInfoGroup` model + + Attributes: + id (int): + name (str): + order (int): + is_inline (bool): + is_required (bool): + selected_configuration_id (int): + extra_info_ids (list[int]): + """ + + id: int + name: str + order: int + is_inline: bool + is_required: bool + selected_configuration_id: int + extra_info_ids: list[int] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + order = self.order + + is_inline = self.is_inline + + is_required = self.is_required + + selected_configuration_id = self.selected_configuration_id + + extra_info_ids = self.extra_info_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "order": order, + "is_inline": is_inline, + "is_required": is_required, + "selected_configuration_id": selected_configuration_id, + "extra_info_ids": extra_info_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + order = d.pop("order") + + is_inline = d.pop("is_inline") + + is_required = d.pop("is_required") + + selected_configuration_id = d.pop("selected_configuration_id") + + extra_info_ids = cast(list[int], d.pop("extra_info_ids")) + + selected_node_extra_info_group = cls( + id=id, + name=name, + order=order, + is_inline=is_inline, + is_required=is_required, + selected_configuration_id=selected_configuration_id, + extra_info_ids=extra_info_ids, + ) + + selected_node_extra_info_group.additional_properties = d + return selected_node_extra_info_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_status_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_status_enum.py new file mode 100644 index 0000000..8100a22 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_node_status_enum.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class SelectedNodeStatusEnum(str, Enum): + EDITION_IN_PROGRESS = "edition_in_progress" + NEW = "new" + PAYMENT_IN_PROGRESS = "payment_in_progress" + REFUNDED = "refunded" + VALIDATED = "validated" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/selected_promotion_code.py b/poly-ticket-api-client/poly_ticket_api_client/models/selected_promotion_code.py new file mode 100644 index 0000000..b7291a5 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/selected_promotion_code.py @@ -0,0 +1,131 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="SelectedPromotionCode") + + +@_attrs_define +class SelectedPromotionCode: + """Serializer for SelectedPromotionCode model + + Attributes: + id (int): + basket (int): + promotion_code (str): value of the code that users will have to enter to get the promotion + promotion_code_id (Union[None, int]): + name (str): name of the promotion that will be shown + value (str): value of the code that users will have to enter to get the promotion + """ + + id: int + basket: int + promotion_code: str + promotion_code_id: Union[None, int] + name: str + value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + basket = self.basket + + promotion_code = self.promotion_code + + promotion_code_id: Union[None, int] + promotion_code_id = self.promotion_code_id + + name = self.name + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "basket": basket, + "promotion_code": promotion_code, + "promotion_code_id": promotion_code_id, + "name": name, + "value": value, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("basket", (None, str(self.basket).encode(), "text/plain"))) + + files.append(("promotion_code", (None, str(self.promotion_code).encode(), "text/plain"))) + + if isinstance(self.promotion_code_id, int): + files.append(("promotion_code_id", (None, str(self.promotion_code_id).encode(), "text/plain"))) + else: + files.append(("promotion_code_id", (None, str(self.promotion_code_id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("value", (None, str(self.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + basket = d.pop("basket") + + promotion_code = d.pop("promotion_code") + + def _parse_promotion_code_id(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + promotion_code_id = _parse_promotion_code_id(d.pop("promotion_code_id")) + + name = d.pop("name") + + value = d.pop("value") + + selected_promotion_code = cls( + id=id, + basket=basket, + promotion_code=promotion_code, + promotion_code_id=promotion_code_id, + name=name, + value=value, + ) + + selected_promotion_code.additional_properties = d + return selected_promotion_code + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/statement.py b/poly-ticket-api-client/poly_ticket_api_client/models/statement.py new file mode 100644 index 0000000..f630f43 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/statement.py @@ -0,0 +1,258 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.blank_enum import BlankEnum +from ..models.left_hand_operand_enum import LeftHandOperandEnum +from ..models.operator_enum import OperatorEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Statement") + + +@_attrs_define +class Statement: + """Serializer for the Statement model + + Attributes: + event (int): + event_id (int): + id (int): + order (int): order between statements of the same condition + condition (int): a statement is linked to a condition, to 're-use' statement, use a condition instead of a + statement + left_hand_operand (Union[BlankEnum, LeftHandOperandEnum, Unset]): + left_hand_value (Union[Unset, str]): user defined value + operator (Union[BlankEnum, OperatorEnum, Unset]): with some left hand operands, the operator is unnecessary + + * `>` - Greater + * `>=` - Greater Or Equal + * `=` - Equal + * `!=` - Not Equal + * `<` - Less + * `<=` - Less Or Equal + * `exists` - Exists + * `contains` - Contains + * `is in` - Is In + right_hand_value (Union[Unset, str]): right hand operand: User defined value (this can be an empty string with + Operator.EXISTS) + condition_as_statement (Union[None, Unset, int]): use a condition as a statement (nested condition) + """ + + event: int + event_id: int + id: int + order: int + condition: int + left_hand_operand: Union[BlankEnum, LeftHandOperandEnum, Unset] = UNSET + left_hand_value: Union[Unset, str] = UNSET + operator: Union[BlankEnum, OperatorEnum, Unset] = UNSET + right_hand_value: Union[Unset, str] = UNSET + condition_as_statement: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event = self.event + + event_id = self.event_id + + id = self.id + + order = self.order + + condition = self.condition + + left_hand_operand: Union[Unset, str] + if isinstance(self.left_hand_operand, Unset): + left_hand_operand = UNSET + elif isinstance(self.left_hand_operand, LeftHandOperandEnum): + left_hand_operand = self.left_hand_operand.value + else: + left_hand_operand = self.left_hand_operand.value + + left_hand_value = self.left_hand_value + + operator: Union[Unset, str] + if isinstance(self.operator, Unset): + operator = UNSET + elif isinstance(self.operator, OperatorEnum): + operator = self.operator.value + else: + operator = self.operator.value + + right_hand_value = self.right_hand_value + + condition_as_statement: Union[None, Unset, int] + if isinstance(self.condition_as_statement, Unset): + condition_as_statement = UNSET + else: + condition_as_statement = self.condition_as_statement + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event": event, + "event_id": event_id, + "id": id, + "order": order, + "condition": condition, + } + ) + if left_hand_operand is not UNSET: + field_dict["left_hand_operand"] = left_hand_operand + if left_hand_value is not UNSET: + field_dict["left_hand_value"] = left_hand_value + if operator is not UNSET: + field_dict["operator"] = operator + if right_hand_value is not UNSET: + field_dict["right_hand_value"] = right_hand_value + if condition_as_statement is not UNSET: + field_dict["condition_as_statement"] = condition_as_statement + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + files.append(("event_id", (None, str(self.event_id).encode(), "text/plain"))) + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("order", (None, str(self.order).encode(), "text/plain"))) + + files.append(("condition", (None, str(self.condition).encode(), "text/plain"))) + + if not isinstance(self.left_hand_operand, Unset): + if isinstance(self.left_hand_operand, LeftHandOperandEnum): + files.append(("left_hand_operand", (None, str(self.left_hand_operand.value).encode(), "text/plain"))) + else: + files.append(("left_hand_operand", (None, str(self.left_hand_operand.value).encode(), "text/plain"))) + + if not isinstance(self.left_hand_value, Unset): + files.append(("left_hand_value", (None, str(self.left_hand_value).encode(), "text/plain"))) + + if not isinstance(self.operator, Unset): + if isinstance(self.operator, OperatorEnum): + files.append(("operator", (None, str(self.operator.value).encode(), "text/plain"))) + else: + files.append(("operator", (None, str(self.operator.value).encode(), "text/plain"))) + + if not isinstance(self.right_hand_value, Unset): + files.append(("right_hand_value", (None, str(self.right_hand_value).encode(), "text/plain"))) + + if not isinstance(self.condition_as_statement, Unset): + if isinstance(self.condition_as_statement, int): + files.append( + ("condition_as_statement", (None, str(self.condition_as_statement).encode(), "text/plain")) + ) + else: + files.append( + ("condition_as_statement", (None, str(self.condition_as_statement).encode(), "text/plain")) + ) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event = d.pop("event") + + event_id = d.pop("event_id") + + id = d.pop("id") + + order = d.pop("order") + + condition = d.pop("condition") + + def _parse_left_hand_operand(data: object) -> Union[BlankEnum, LeftHandOperandEnum, Unset]: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + left_hand_operand_type_0 = LeftHandOperandEnum(data) + + return left_hand_operand_type_0 + except: # noqa: E722 + pass + if not isinstance(data, str): + raise TypeError() + left_hand_operand_type_1 = BlankEnum(data) + + return left_hand_operand_type_1 + + left_hand_operand = _parse_left_hand_operand(d.pop("left_hand_operand", UNSET)) + + left_hand_value = d.pop("left_hand_value", UNSET) + + def _parse_operator(data: object) -> Union[BlankEnum, OperatorEnum, Unset]: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + operator_type_0 = OperatorEnum(data) + + return operator_type_0 + except: # noqa: E722 + pass + if not isinstance(data, str): + raise TypeError() + operator_type_1 = BlankEnum(data) + + return operator_type_1 + + operator = _parse_operator(d.pop("operator", UNSET)) + + right_hand_value = d.pop("right_hand_value", UNSET) + + def _parse_condition_as_statement(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + condition_as_statement = _parse_condition_as_statement(d.pop("condition_as_statement", UNSET)) + + statement = cls( + event=event, + event_id=event_id, + id=id, + order=order, + condition=condition, + left_hand_operand=left_hand_operand, + left_hand_value=left_hand_value, + operator=operator, + right_hand_value=right_hand_value, + condition_as_statement=condition_as_statement, + ) + + statement.additional_properties = d + return statement + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_article_calculated_price.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_article_calculated_price.py new file mode 100644 index 0000000..8dd5019 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_article_calculated_price.py @@ -0,0 +1,80 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TicketOfficeArticleCalculatedPrice") + + +@_attrs_define +class TicketOfficeArticleCalculatedPrice: + """ + Attributes: + price (Union[None, str]): Retrieve the total article price from context. + label (Union[None, str]): Retrieve the total article label from context. + """ + + price: Union[None, str] + label: Union[None, str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + price: Union[None, str] + price = self.price + + label: Union[None, str] + label = self.label + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "price": price, + "label": label, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_price(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + price = _parse_price(d.pop("price")) + + def _parse_label(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + label = _parse_label(d.pop("label")) + + ticket_office_article_calculated_price = cls( + price=price, + label=label, + ) + + ticket_office_article_calculated_price.additional_properties = d + return ticket_office_article_calculated_price + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_infos.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_infos.py new file mode 100644 index 0000000..e9d517e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_infos.py @@ -0,0 +1,154 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.node_cart_configuration import NodeCartConfiguration + from ..models.ticket_office_article_calculated_price import TicketOfficeArticleCalculatedPrice + from ..models.ticket_office_node_configuration import TicketOfficeNodeConfiguration + + +T = TypeVar("T", bound="TicketOfficeInfos") + + +@_attrs_define +class TicketOfficeInfos: + """Serializer for TicketOffice infos, equivalent to NodeSerializer for the BackOffice + + Attributes: + id (int): + order (int): Local order between nodes that share the same parent + parent_id (int): + configuration (TicketOfficeNodeConfiguration): This is an extension of NodeConfigurationSerializer specific to + the ticket office infos endpoint. + It adds a field for extra info groups and a filter applied to this field. + cart_configuration (NodeCartConfiguration): Serializer (read/write) for NodeCartConfiguration model + article_calculated_price (TicketOfficeArticleCalculatedPrice): + option_calculated_price (Union[None, str]): Retrieve the option article price from context. Return None if node + is not in calculated_prices. + children (list['TicketOfficeInfos']): + internal_key (Union[Unset, str]): + """ + + id: int + order: int + parent_id: int + configuration: "TicketOfficeNodeConfiguration" + cart_configuration: "NodeCartConfiguration" + article_calculated_price: "TicketOfficeArticleCalculatedPrice" + option_calculated_price: Union[None, str] + children: list["TicketOfficeInfos"] + internal_key: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + order = self.order + + parent_id = self.parent_id + + configuration = self.configuration.to_dict() + + cart_configuration = self.cart_configuration.to_dict() + + article_calculated_price = self.article_calculated_price.to_dict() + + option_calculated_price: Union[None, str] + option_calculated_price = self.option_calculated_price + + children = [] + for children_item_data in self.children: + children_item = children_item_data.to_dict() + children.append(children_item) + + internal_key = self.internal_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "order": order, + "parent_id": parent_id, + "configuration": configuration, + "cart_configuration": cart_configuration, + "article_calculated_price": article_calculated_price, + "option_calculated_price": option_calculated_price, + "children": children, + } + ) + if internal_key is not UNSET: + field_dict["internal_key"] = internal_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.node_cart_configuration import NodeCartConfiguration + from ..models.ticket_office_article_calculated_price import TicketOfficeArticleCalculatedPrice + from ..models.ticket_office_node_configuration import TicketOfficeNodeConfiguration + + d = dict(src_dict) + id = d.pop("id") + + order = d.pop("order") + + parent_id = d.pop("parent_id") + + configuration = TicketOfficeNodeConfiguration.from_dict(d.pop("configuration")) + + cart_configuration = NodeCartConfiguration.from_dict(d.pop("cart_configuration")) + + article_calculated_price = TicketOfficeArticleCalculatedPrice.from_dict(d.pop("article_calculated_price")) + + def _parse_option_calculated_price(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + option_calculated_price = _parse_option_calculated_price(d.pop("option_calculated_price")) + + children = [] + _children = d.pop("children") + for children_item_data in _children: + children_item = TicketOfficeInfos.from_dict(children_item_data) + + children.append(children_item) + + internal_key = d.pop("internal_key", UNSET) + + ticket_office_infos = cls( + id=id, + order=order, + parent_id=parent_id, + configuration=configuration, + cart_configuration=cart_configuration, + article_calculated_price=article_calculated_price, + option_calculated_price=option_calculated_price, + children=children, + internal_key=internal_key, + ) + + ticket_office_infos.additional_properties = d + return ticket_office_infos + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_configuration.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_configuration.py new file mode 100644 index 0000000..bd32cad --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_configuration.py @@ -0,0 +1,352 @@ +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.category_enum import CategoryEnum +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.ticket_office_node_extra_info_group import TicketOfficeNodeExtraInfoGroup + from ..models.ticket_office_node_limit import TicketOfficeNodeLimit + from ..models.ticket_office_node_tag import TicketOfficeNodeTag + + +T = TypeVar("T", bound="TicketOfficeNodeConfiguration") + + +@_attrs_define +class TicketOfficeNodeConfiguration: + """This is an extension of NodeConfigurationSerializer specific to the ticket office infos endpoint. + It adds a field for extra info groups and a filter applied to this field. + + Attributes: + id (int): + event (int): + event_id (int): + extra_info_groups (list['TicketOfficeNodeExtraInfoGroup']): + limit (Union['TicketOfficeNodeLimit', None]): + tags (list['TicketOfficeNodeTag']): + description (Union[Unset, str]): description for the node. Some restricted HTML markup is allowed, everything + else is filtered out automatically. + title (Union[Unset, str]): + category (Union[Unset, CategoryEnum]): * `ticket` - Ticket + * `item` - Item + * `activity` - Activity + * `accomodation` - Accomodation + * `type` - Type + * `group` - Group + image (Union[None, Unset, int]): + image_style (Union[Unset, Any]): + item_style (Union[Unset, Any]): + display_price_difference (Union[Unset, bool]): + display_limits_difference (Union[Unset, bool]): + is_title_displayable (Union[Unset, bool]): + is_image_displayable (Union[Unset, bool]): + is_description_displayable (Union[Unset, bool]): + is_tags_displayable (Union[Unset, bool]): + starts_at (Union[None, Unset, datetime.datetime]): Optional start datetime for this node. For display only. + ends_at (Union[None, Unset, datetime.datetime]): Optional end datetime for this node. For display only. + is_subject_to_lausanne_tax (Union[Unset, bool]): + """ + + id: int + event: int + event_id: int + extra_info_groups: list["TicketOfficeNodeExtraInfoGroup"] + limit: Union["TicketOfficeNodeLimit", None] + tags: list["TicketOfficeNodeTag"] + description: Union[Unset, str] = UNSET + title: Union[Unset, str] = UNSET + category: Union[Unset, CategoryEnum] = UNSET + image: Union[None, Unset, int] = UNSET + image_style: Union[Unset, Any] = UNSET + item_style: Union[Unset, Any] = UNSET + display_price_difference: Union[Unset, bool] = UNSET + display_limits_difference: Union[Unset, bool] = UNSET + is_title_displayable: Union[Unset, bool] = UNSET + is_image_displayable: Union[Unset, bool] = UNSET + is_description_displayable: Union[Unset, bool] = UNSET + is_tags_displayable: Union[Unset, bool] = UNSET + starts_at: Union[None, Unset, datetime.datetime] = UNSET + ends_at: Union[None, Unset, datetime.datetime] = UNSET + is_subject_to_lausanne_tax: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.ticket_office_node_limit import TicketOfficeNodeLimit + + id = self.id + + event = self.event + + event_id = self.event_id + + extra_info_groups = [] + for extra_info_groups_item_data in self.extra_info_groups: + extra_info_groups_item = extra_info_groups_item_data.to_dict() + extra_info_groups.append(extra_info_groups_item) + + limit: Union[None, dict[str, Any]] + if isinstance(self.limit, TicketOfficeNodeLimit): + limit = self.limit.to_dict() + else: + limit = self.limit + + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + tags.append(tags_item) + + description = self.description + + title = self.title + + category: Union[Unset, str] = UNSET + if not isinstance(self.category, Unset): + category = self.category.value + + image: Union[None, Unset, int] + if isinstance(self.image, Unset): + image = UNSET + else: + image = self.image + + image_style = self.image_style + + item_style = self.item_style + + display_price_difference = self.display_price_difference + + display_limits_difference = self.display_limits_difference + + is_title_displayable = self.is_title_displayable + + is_image_displayable = self.is_image_displayable + + is_description_displayable = self.is_description_displayable + + is_tags_displayable = self.is_tags_displayable + + starts_at: Union[None, Unset, str] + if isinstance(self.starts_at, Unset): + starts_at = UNSET + elif isinstance(self.starts_at, datetime.datetime): + starts_at = self.starts_at.isoformat() + else: + starts_at = self.starts_at + + ends_at: Union[None, Unset, str] + if isinstance(self.ends_at, Unset): + ends_at = UNSET + elif isinstance(self.ends_at, datetime.datetime): + ends_at = self.ends_at.isoformat() + else: + ends_at = self.ends_at + + is_subject_to_lausanne_tax = self.is_subject_to_lausanne_tax + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event": event, + "event_id": event_id, + "extra_info_groups": extra_info_groups, + "limit": limit, + "tags": tags, + } + ) + if description is not UNSET: + field_dict["description"] = description + if title is not UNSET: + field_dict["title"] = title + if category is not UNSET: + field_dict["category"] = category + if image is not UNSET: + field_dict["image"] = image + if image_style is not UNSET: + field_dict["image_style"] = image_style + if item_style is not UNSET: + field_dict["item_style"] = item_style + if display_price_difference is not UNSET: + field_dict["display_price_difference"] = display_price_difference + if display_limits_difference is not UNSET: + field_dict["display_limits_difference"] = display_limits_difference + if is_title_displayable is not UNSET: + field_dict["is_title_displayable"] = is_title_displayable + if is_image_displayable is not UNSET: + field_dict["is_image_displayable"] = is_image_displayable + if is_description_displayable is not UNSET: + field_dict["is_description_displayable"] = is_description_displayable + if is_tags_displayable is not UNSET: + field_dict["is_tags_displayable"] = is_tags_displayable + if starts_at is not UNSET: + field_dict["starts_at"] = starts_at + if ends_at is not UNSET: + field_dict["ends_at"] = ends_at + if is_subject_to_lausanne_tax is not UNSET: + field_dict["is_subject_to_lausanne_tax"] = is_subject_to_lausanne_tax + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.ticket_office_node_extra_info_group import TicketOfficeNodeExtraInfoGroup + from ..models.ticket_office_node_limit import TicketOfficeNodeLimit + from ..models.ticket_office_node_tag import TicketOfficeNodeTag + + d = dict(src_dict) + id = d.pop("id") + + event = d.pop("event") + + event_id = d.pop("event_id") + + extra_info_groups = [] + _extra_info_groups = d.pop("extra_info_groups") + for extra_info_groups_item_data in _extra_info_groups: + extra_info_groups_item = TicketOfficeNodeExtraInfoGroup.from_dict(extra_info_groups_item_data) + + extra_info_groups.append(extra_info_groups_item) + + def _parse_limit(data: object) -> Union["TicketOfficeNodeLimit", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + limit_type_1 = TicketOfficeNodeLimit.from_dict(data) + + return limit_type_1 + except: # noqa: E722 + pass + return cast(Union["TicketOfficeNodeLimit", None], data) + + limit = _parse_limit(d.pop("limit")) + + tags = [] + _tags = d.pop("tags") + for tags_item_data in _tags: + tags_item = TicketOfficeNodeTag.from_dict(tags_item_data) + + tags.append(tags_item) + + description = d.pop("description", UNSET) + + title = d.pop("title", UNSET) + + _category = d.pop("category", UNSET) + category: Union[Unset, CategoryEnum] + if isinstance(_category, Unset): + category = UNSET + else: + category = CategoryEnum(_category) + + def _parse_image(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + image = _parse_image(d.pop("image", UNSET)) + + image_style = d.pop("image_style", UNSET) + + item_style = d.pop("item_style", UNSET) + + display_price_difference = d.pop("display_price_difference", UNSET) + + display_limits_difference = d.pop("display_limits_difference", UNSET) + + is_title_displayable = d.pop("is_title_displayable", UNSET) + + is_image_displayable = d.pop("is_image_displayable", UNSET) + + is_description_displayable = d.pop("is_description_displayable", UNSET) + + is_tags_displayable = d.pop("is_tags_displayable", UNSET) + + def _parse_starts_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + starts_at_type_0 = isoparse(data) + + return starts_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + starts_at = _parse_starts_at(d.pop("starts_at", UNSET)) + + def _parse_ends_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + ends_at_type_0 = isoparse(data) + + return ends_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + ends_at = _parse_ends_at(d.pop("ends_at", UNSET)) + + is_subject_to_lausanne_tax = d.pop("is_subject_to_lausanne_tax", UNSET) + + ticket_office_node_configuration = cls( + id=id, + event=event, + event_id=event_id, + extra_info_groups=extra_info_groups, + limit=limit, + tags=tags, + description=description, + title=title, + category=category, + image=image, + image_style=image_style, + item_style=item_style, + display_price_difference=display_price_difference, + display_limits_difference=display_limits_difference, + is_title_displayable=is_title_displayable, + is_image_displayable=is_image_displayable, + is_description_displayable=is_description_displayable, + is_tags_displayable=is_tags_displayable, + starts_at=starts_at, + ends_at=ends_at, + is_subject_to_lausanne_tax=is_subject_to_lausanne_tax, + ) + + ticket_office_node_configuration.additional_properties = d + return ticket_office_node_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info.py new file mode 100644 index 0000000..aa90802 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info.py @@ -0,0 +1,194 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.model_form_line_type import ModelFormLineType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TicketOfficeNodeExtraInfo") + + +@_attrs_define +class TicketOfficeNodeExtraInfo: + """Serializer (read/write) for `NodeExtraInfo` model + This is a copy of NodeExtraInfoSerializer to be used in the context of the ticket office infos endpoint. It will be + used only in a read mode + + Attributes: + id (int): + group_id (int): + order (int): + type_ (ModelFormLineType): * `text` - Simple text + * `email` - Email + * `phone` - Phone + * `country` - Country + * `numerical` - Numerical + * `textarea` - Multi-line text input + * `boolean` - Boolean + * `datetime` - Datetime + * `date` - Date + * `date_major` - Birthdate with majority required + * `choice` - Choice + * `file` - File + name (str): + text (str): + help_text (Union[Unset, str]): + is_required (Union[Unset, bool]): + choices_json (Union[None, Unset, str]): + major_json (Union[None, Unset, str]): + range_json (Union[None, Unset, str]): + """ + + id: int + group_id: int + order: int + type_: ModelFormLineType + name: str + text: str + help_text: Union[Unset, str] = UNSET + is_required: Union[Unset, bool] = UNSET + choices_json: Union[None, Unset, str] = UNSET + major_json: Union[None, Unset, str] = UNSET + range_json: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + group_id = self.group_id + + order = self.order + + type_ = self.type_.value + + name = self.name + + text = self.text + + help_text = self.help_text + + is_required = self.is_required + + choices_json: Union[None, Unset, str] + if isinstance(self.choices_json, Unset): + choices_json = UNSET + else: + choices_json = self.choices_json + + major_json: Union[None, Unset, str] + if isinstance(self.major_json, Unset): + major_json = UNSET + else: + major_json = self.major_json + + range_json: Union[None, Unset, str] + if isinstance(self.range_json, Unset): + range_json = UNSET + else: + range_json = self.range_json + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "group_id": group_id, + "order": order, + "type": type_, + "name": name, + "text": text, + } + ) + if help_text is not UNSET: + field_dict["help_text"] = help_text + if is_required is not UNSET: + field_dict["is_required"] = is_required + if choices_json is not UNSET: + field_dict["choices_json"] = choices_json + if major_json is not UNSET: + field_dict["major_json"] = major_json + if range_json is not UNSET: + field_dict["range_json"] = range_json + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + group_id = d.pop("group_id") + + order = d.pop("order") + + type_ = ModelFormLineType(d.pop("type")) + + name = d.pop("name") + + text = d.pop("text") + + help_text = d.pop("help_text", UNSET) + + is_required = d.pop("is_required", UNSET) + + def _parse_choices_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + choices_json = _parse_choices_json(d.pop("choices_json", UNSET)) + + def _parse_major_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + major_json = _parse_major_json(d.pop("major_json", UNSET)) + + def _parse_range_json(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + range_json = _parse_range_json(d.pop("range_json", UNSET)) + + ticket_office_node_extra_info = cls( + id=id, + group_id=group_id, + order=order, + type_=type_, + name=name, + text=text, + help_text=help_text, + is_required=is_required, + choices_json=choices_json, + major_json=major_json, + range_json=range_json, + ) + + ticket_office_node_extra_info.additional_properties = d + return ticket_office_node_extra_info + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info_group.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info_group.py new file mode 100644 index 0000000..589c8f1 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_extra_info_group.py @@ -0,0 +1,114 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.ticket_office_node_extra_info import TicketOfficeNodeExtraInfo + + +T = TypeVar("T", bound="TicketOfficeNodeExtraInfoGroup") + + +@_attrs_define +class TicketOfficeNodeExtraInfoGroup: + """Serializer (read/write) for `NodeExtraInfoGroup` model + This is a partial copy of NodeExtraInfoGroupSerializer (no reference to linked node configuration) to be used in the + context of the ticket office infos endpoint. It will be used only in a read mode. + The field `configuration_id` is added manually in the configuration (hierarchical parent) serializer. This is done + to avoid messing with nested serializer data since we are basically switching from an M2M in the backend to a + foreign key in the data sent to the frontend. + + Attributes: + id (int): + name (str): + order (int): + extra_infos (list['TicketOfficeNodeExtraInfo']): + is_required (Union[Unset, bool]): + """ + + id: int + name: str + order: int + extra_infos: list["TicketOfficeNodeExtraInfo"] + is_required: Union[Unset, bool] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + order = self.order + + extra_infos = [] + for extra_infos_item_data in self.extra_infos: + extra_infos_item = extra_infos_item_data.to_dict() + extra_infos.append(extra_infos_item) + + is_required = self.is_required + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "order": order, + "extra_infos": extra_infos, + } + ) + if is_required is not UNSET: + field_dict["is_required"] = is_required + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.ticket_office_node_extra_info import TicketOfficeNodeExtraInfo + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + order = d.pop("order") + + extra_infos = [] + _extra_infos = d.pop("extra_infos") + for extra_infos_item_data in _extra_infos: + extra_infos_item = TicketOfficeNodeExtraInfo.from_dict(extra_infos_item_data) + + extra_infos.append(extra_infos_item) + + is_required = d.pop("is_required", UNSET) + + ticket_office_node_extra_info_group = cls( + id=id, + name=name, + order=order, + extra_infos=extra_infos, + is_required=is_required, + ) + + ticket_office_node_extra_info_group.additional_properties = d + return ticket_office_node_extra_info_group + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_limit.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_limit.py new file mode 100644 index 0000000..160713e --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_limit.py @@ -0,0 +1,99 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TicketOfficeNodeLimit") + + +@_attrs_define +class TicketOfficeNodeLimit: + """ + Attributes: + id (int): + key (str): + label (str): + maximum (int): + available (int): + configuration_id (int): Usually a m2m field, this is specific to ticketoffice. + """ + + id: int + key: str + label: str + maximum: int + available: int + configuration_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + key = self.key + + label = self.label + + maximum = self.maximum + + available = self.available + + configuration_id = self.configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "key": key, + "label": label, + "maximum": maximum, + "available": available, + "configuration_id": configuration_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + key = d.pop("key") + + label = d.pop("label") + + maximum = d.pop("maximum") + + available = d.pop("available") + + configuration_id = d.pop("configuration_id") + + ticket_office_node_limit = cls( + id=id, + key=key, + label=label, + maximum=maximum, + available=available, + configuration_id=configuration_id, + ) + + ticket_office_node_limit.additional_properties = d + return ticket_office_node_limit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_tag.py b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_tag.py new file mode 100644 index 0000000..6f188ec --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/ticket_office_node_tag.py @@ -0,0 +1,78 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TicketOfficeNodeTag") + + +@_attrs_define +class TicketOfficeNodeTag: + """Serializer (read only) for `NodeTag` model + This is a read only version of the `NodeTagSerializer`, destined to be used in `TicketOfficeInfosSerializer` through + `TicketOfficeNodeConfigurationSerializer` + + Attributes: + id (int): + name (str): + configuration_id (int): + """ + + id: int + name: str + configuration_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + configuration_id = self.configuration_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "configuration_id": configuration_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + configuration_id = d.pop("configuration_id") + + ticket_office_node_tag = cls( + id=id, + name=name, + configuration_id=configuration_id, + ) + + ticket_office_node_tag.additional_properties = d + return ticket_office_node_tag + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/unit.py b/poly-ticket-api-client/poly_ticket_api_client/models/unit.py new file mode 100644 index 0000000..fa6e390 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/unit.py @@ -0,0 +1,143 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Unit") + + +@_attrs_define +class Unit: + """Serializer for Unit model + + Attributes: + id (int): + name (str): + description (str): Description of the Unit. Some restricted HTML markup is allowed, everything else is filtered + out automatically. + iban (Union[Unset, str]): + address (Union[Unset, str]): + payout_account_holder (Union[Unset, str]): + email (Union[Unset, str]): This field will be used as a main contact point for the unit, e.g. for sending them + statements, or to show to ticket buyers on how they can contact the organizer. + """ + + id: int + name: str + description: str + iban: Union[Unset, str] = UNSET + address: Union[Unset, str] = UNSET + payout_account_holder: Union[Unset, str] = UNSET + email: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + description = self.description + + iban = self.iban + + address = self.address + + payout_account_holder = self.payout_account_holder + + email = self.email + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "description": description, + } + ) + if iban is not UNSET: + field_dict["iban"] = iban + if address is not UNSET: + field_dict["address"] = address + if payout_account_holder is not UNSET: + field_dict["payout_account_holder"] = payout_account_holder + if email is not UNSET: + field_dict["email"] = email + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + files.append(("description", (None, str(self.description).encode(), "text/plain"))) + + if not isinstance(self.iban, Unset): + files.append(("iban", (None, str(self.iban).encode(), "text/plain"))) + + if not isinstance(self.address, Unset): + files.append(("address", (None, str(self.address).encode(), "text/plain"))) + + if not isinstance(self.payout_account_holder, Unset): + files.append(("payout_account_holder", (None, str(self.payout_account_holder).encode(), "text/plain"))) + + if not isinstance(self.email, Unset): + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + description = d.pop("description") + + iban = d.pop("iban", UNSET) + + address = d.pop("address", UNSET) + + payout_account_holder = d.pop("payout_account_holder", UNSET) + + email = d.pop("email", UNSET) + + unit = cls( + id=id, + name=name, + description=description, + iban=iban, + address=address, + payout_account_holder=payout_account_holder, + email=email, + ) + + unit.additional_properties = d + return unit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email.py b/poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email.py new file mode 100644 index 0000000..4c1961c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email.py @@ -0,0 +1,104 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.unit_member_ship_creation_by_email_role_enum import UnitMemberShipCreationByEmailRoleEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UnitMemberShipCreationByEmail") + + +@_attrs_define +class UnitMemberShipCreationByEmail: + """Serializer for the action create_by_email of UnitMemberShipViewSet + + Attributes: + unit (int): + user_email (str): Email address of the user you want to add to the unit. + role (Union[Unset, UnitMemberShipCreationByEmailRoleEnum]): * `owner` - owner + * `member` - member + """ + + unit: int + user_email: str + role: Union[Unset, UnitMemberShipCreationByEmailRoleEnum] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + unit = self.unit + + user_email = self.user_email + + role: Union[Unset, str] = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "unit": unit, + "user_email": user_email, + } + ) + if role is not UNSET: + field_dict["role"] = role + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("unit", (None, str(self.unit).encode(), "text/plain"))) + + files.append(("user_email", (None, str(self.user_email).encode(), "text/plain"))) + + if not isinstance(self.role, Unset): + files.append(("role", (None, str(self.role.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + unit = d.pop("unit") + + user_email = d.pop("user_email") + + _role = d.pop("role", UNSET) + role: Union[Unset, UnitMemberShipCreationByEmailRoleEnum] + if isinstance(_role, Unset): + role = UNSET + else: + role = UnitMemberShipCreationByEmailRoleEnum(_role) + + unit_member_ship_creation_by_email = cls( + unit=unit, + user_email=user_email, + role=role, + ) + + unit_member_ship_creation_by_email.additional_properties = d + return unit_member_ship_creation_by_email + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email_role_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email_role_enum.py new file mode 100644 index 0000000..bc212bc --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/unit_member_ship_creation_by_email_role_enum.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UnitMemberShipCreationByEmailRoleEnum(str, Enum): + MEMBER = "member" + OWNER = "owner" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/unit_membership.py b/poly-ticket-api-client/poly_ticket_api_client/models/unit_membership.py new file mode 100644 index 0000000..2e4c27f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/unit_membership.py @@ -0,0 +1,124 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..models.unit_membership_role_enum import UnitMembershipRoleEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UnitMembership") + + +@_attrs_define +class UnitMembership: + """Serializer for UnitMembership model + + Attributes: + id (int): + user (int): + unit (int): + user_email (str): + role (Union[Unset, UnitMembershipRoleEnum]): * `owner` - Owner + * `member` - Member + """ + + id: int + user: int + unit: int + user_email: str + role: Union[Unset, UnitMembershipRoleEnum] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + user = self.user + + unit = self.unit + + user_email = self.user_email + + role: Union[Unset, str] = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "user": user, + "unit": unit, + "user_email": user_email, + } + ) + if role is not UNSET: + field_dict["role"] = role + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + + files.append(("unit", (None, str(self.unit).encode(), "text/plain"))) + + files.append(("user_email", (None, str(self.user_email).encode(), "text/plain"))) + + if not isinstance(self.role, Unset): + files.append(("role", (None, str(self.role.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + user = d.pop("user") + + unit = d.pop("unit") + + user_email = d.pop("user_email") + + _role = d.pop("role", UNSET) + role: Union[Unset, UnitMembershipRoleEnum] + if isinstance(_role, Unset): + role = UNSET + else: + role = UnitMembershipRoleEnum(_role) + + unit_membership = cls( + id=id, + user=user, + unit=unit, + user_email=user_email, + role=role, + ) + + unit_membership.additional_properties = d + return unit_membership + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/unit_membership_role_enum.py b/poly-ticket-api-client/poly_ticket_api_client/models/unit_membership_role_enum.py new file mode 100644 index 0000000..6f09b50 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/unit_membership_role_enum.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UnitMembershipRoleEnum(str, Enum): + MEMBER = "member" + OWNER = "owner" + + def __str__(self) -> str: + return str(self.value) diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/uploaded_image.py b/poly-ticket-api-client/poly_ticket_api_client/models/uploaded_image.py new file mode 100644 index 0000000..ae6d47c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/uploaded_image.py @@ -0,0 +1,194 @@ +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from .. import types +from ..models.privacy_level_enum import PrivacyLevelEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UploadedImage") + + +@_attrs_define +class UploadedImage: + """ + Attributes: + id (int): + file (str): + uploaded_at (datetime.datetime): the datetime the image was uploaded at + event (Union[None, Unset, int]): the event associated to the image + frontend_login (Union[None, Unset, int]): the frontendlogin who uploaded the image + user (Union[None, Unset, int]): the user who uploaded the image + privacy_level (Union[Unset, PrivacyLevelEnum]): * `public` - Public + * `event` - Event + * `personal` - Personal + """ + + id: int + file: str + uploaded_at: datetime.datetime + event: Union[None, Unset, int] = UNSET + frontend_login: Union[None, Unset, int] = UNSET + user: Union[None, Unset, int] = UNSET + privacy_level: Union[Unset, PrivacyLevelEnum] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + file = self.file + + uploaded_at = self.uploaded_at.isoformat() + + event: Union[None, Unset, int] + if isinstance(self.event, Unset): + event = UNSET + else: + event = self.event + + frontend_login: Union[None, Unset, int] + if isinstance(self.frontend_login, Unset): + frontend_login = UNSET + else: + frontend_login = self.frontend_login + + user: Union[None, Unset, int] + if isinstance(self.user, Unset): + user = UNSET + else: + user = self.user + + privacy_level: Union[Unset, str] = UNSET + if not isinstance(self.privacy_level, Unset): + privacy_level = self.privacy_level.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "file": file, + "uploaded_at": uploaded_at, + } + ) + if event is not UNSET: + field_dict["event"] = event + if frontend_login is not UNSET: + field_dict["frontend_login"] = frontend_login + if user is not UNSET: + field_dict["user"] = user + if privacy_level is not UNSET: + field_dict["privacy_level"] = privacy_level + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("file", (None, str(self.file).encode(), "text/plain"))) + + files.append(("uploaded_at", (None, self.uploaded_at.isoformat().encode(), "text/plain"))) + + if not isinstance(self.event, Unset): + if isinstance(self.event, int): + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + else: + files.append(("event", (None, str(self.event).encode(), "text/plain"))) + + if not isinstance(self.frontend_login, Unset): + if isinstance(self.frontend_login, int): + files.append(("frontend_login", (None, str(self.frontend_login).encode(), "text/plain"))) + else: + files.append(("frontend_login", (None, str(self.frontend_login).encode(), "text/plain"))) + + if not isinstance(self.user, Unset): + if isinstance(self.user, int): + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + else: + files.append(("user", (None, str(self.user).encode(), "text/plain"))) + + if not isinstance(self.privacy_level, Unset): + files.append(("privacy_level", (None, str(self.privacy_level.value).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + file = d.pop("file") + + uploaded_at = isoparse(d.pop("uploaded_at")) + + def _parse_event(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + event = _parse_event(d.pop("event", UNSET)) + + def _parse_frontend_login(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + frontend_login = _parse_frontend_login(d.pop("frontend_login", UNSET)) + + def _parse_user(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + user = _parse_user(d.pop("user", UNSET)) + + _privacy_level = d.pop("privacy_level", UNSET) + privacy_level: Union[Unset, PrivacyLevelEnum] + if isinstance(_privacy_level, Unset): + privacy_level = UNSET + else: + privacy_level = PrivacyLevelEnum(_privacy_level) + + uploaded_image = cls( + id=id, + file=file, + uploaded_at=uploaded_at, + event=event, + frontend_login=frontend_login, + user=user, + privacy_level=privacy_level, + ) + + uploaded_image.additional_properties = d + return uploaded_image + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/user_password_change.py b/poly-ticket-api-client/poly_ticket_api_client/models/user_password_change.py new file mode 100644 index 0000000..3bfffd8 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/user_password_change.py @@ -0,0 +1,83 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="UserPasswordChange") + + +@_attrs_define +class UserPasswordChange: + """Serializer used for user password change requests. It verifies the user has the correct current password for the + account and validates the new one. + + Attributes: + current_password (str): The current password associated with your account + new_password (str): The new password to be used for your account + """ + + current_password: str + new_password: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + current_password = self.current_password + + new_password = self.new_password + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "current_password": current_password, + "new_password": new_password, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("current_password", (None, str(self.current_password).encode(), "text/plain"))) + + files.append(("new_password", (None, str(self.new_password).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + current_password = d.pop("current_password") + + new_password = d.pop("new_password") + + user_password_change = cls( + current_password=current_password, + new_password=new_password, + ) + + user_password_change.additional_properties = d + return user_password_change + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset.py b/poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset.py new file mode 100644 index 0000000..ceb95b9 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset.py @@ -0,0 +1,92 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="UserPasswordReset") + + +@_attrs_define +class UserPasswordReset: + """Serializer used for user password reset. It should be used after having made the request for a password reset. + + Attributes: + user_id_b64 (str): The user's id encoded + password (str): The new password + password_reset_token_b64 (str): The password reset token encoded given by the reset request + """ + + user_id_b64: str + password: str + password_reset_token_b64: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + user_id_b64 = self.user_id_b64 + + password = self.password + + password_reset_token_b64 = self.password_reset_token_b64 + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "user_id_b64": user_id_b64, + "password": password, + "password_reset_token_b64": password_reset_token_b64, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("user_id_b64", (None, str(self.user_id_b64).encode(), "text/plain"))) + + files.append(("password", (None, str(self.password).encode(), "text/plain"))) + + files.append(("password_reset_token_b64", (None, str(self.password_reset_token_b64).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id_b64 = d.pop("user_id_b64") + + password = d.pop("password") + + password_reset_token_b64 = d.pop("password_reset_token_b64") + + user_password_reset = cls( + user_id_b64=user_id_b64, + password=password, + password_reset_token_b64=password_reset_token_b64, + ) + + user_password_reset.additional_properties = d + return user_password_reset + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset_request.py b/poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset_request.py new file mode 100644 index 0000000..3f6718c --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/user_password_reset_request.py @@ -0,0 +1,72 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="UserPasswordResetRequest") + + +@_attrs_define +class UserPasswordResetRequest: + """Serializer used for users password reset requests. If verifies the email is associated with a valid account. + + Attributes: + email (str): The email associated with the account to reset the password for. + """ + + email: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + user_password_reset_request = cls( + email=email, + ) + + user_password_reset_request.additional_properties = d + return user_password_reset_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/user_registration.py b/poly-ticket-api-client/poly_ticket_api_client/models/user_registration.py new file mode 100644 index 0000000..b054c3d --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/user_registration.py @@ -0,0 +1,140 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserRegistration") + + +@_attrs_define +class UserRegistration: + """Serializer for PolyTicketUser registration + + Attributes: + id (int): + email (str): + password (str): The password associated with your account + captcha (str): Captcha response token from the Recaptcha JS library challenge + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + captcha_bypass (Union[Unset, str]): For testing purposes, permits to bypass captcha verification. This field + expects a shared secret. This feature is only usable on DEV and INT environnments. + """ + + id: int + email: str + password: str + captcha: str + first_name: Union[Unset, str] = UNSET + last_name: Union[Unset, str] = UNSET + captcha_bypass: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + email = self.email + + password = self.password + + captcha = self.captcha + + first_name = self.first_name + + last_name = self.last_name + + captcha_bypass = self.captcha_bypass + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "email": email, + "password": password, + "captcha": captcha, + } + ) + if first_name is not UNSET: + field_dict["first_name"] = first_name + if last_name is not UNSET: + field_dict["last_name"] = last_name + if captcha_bypass is not UNSET: + field_dict["captcha_bypass"] = captcha_bypass + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("id", (None, str(self.id).encode(), "text/plain"))) + + files.append(("email", (None, str(self.email).encode(), "text/plain"))) + + files.append(("password", (None, str(self.password).encode(), "text/plain"))) + + files.append(("captcha", (None, str(self.captcha).encode(), "text/plain"))) + + if not isinstance(self.first_name, Unset): + files.append(("first_name", (None, str(self.first_name).encode(), "text/plain"))) + + if not isinstance(self.last_name, Unset): + files.append(("last_name", (None, str(self.last_name).encode(), "text/plain"))) + + if not isinstance(self.captcha_bypass, Unset): + files.append(("captcha_bypass", (None, str(self.captcha_bypass).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + email = d.pop("email") + + password = d.pop("password") + + captcha = d.pop("captcha") + + first_name = d.pop("first_name", UNSET) + + last_name = d.pop("last_name", UNSET) + + captcha_bypass = d.pop("captcha_bypass", UNSET) + + user_registration = cls( + id=id, + email=email, + password=password, + captcha=captcha, + first_name=first_name, + last_name=last_name, + captcha_bypass=captcha_bypass, + ) + + user_registration.additional_properties = d + return user_registration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/user_verification.py b/poly-ticket-api-client/poly_ticket_api_client/models/user_verification.py new file mode 100644 index 0000000..057531a --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/user_verification.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="UserVerification") + + +@_attrs_define +class UserVerification: + """Serializer for PolyTicketUser verification + + Attributes: + user_id_b64 (str): + account_activation_token_b64 (str): + """ + + user_id_b64: str + account_activation_token_b64: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + user_id_b64 = self.user_id_b64 + + account_activation_token_b64 = self.account_activation_token_b64 + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "user_id_b64": user_id_b64, + "account_activation_token_b64": account_activation_token_b64, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("user_id_b64", (None, str(self.user_id_b64).encode(), "text/plain"))) + + files.append( + ("account_activation_token_b64", (None, str(self.account_activation_token_b64).encode(), "text/plain")) + ) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id_b64 = d.pop("user_id_b64") + + account_activation_token_b64 = d.pop("account_activation_token_b64") + + user_verification = cls( + user_id_b64=user_id_b64, + account_activation_token_b64=account_activation_token_b64, + ) + + user_verification.additional_properties = d + return user_verification + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/validate_third_party_token_login.py b/poly-ticket-api-client/poly_ticket_api_client/models/validate_third_party_token_login.py new file mode 100644 index 0000000..c4b343f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/validate_third_party_token_login.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +T = TypeVar("T", bound="ValidateThirdPartyTokenLogin") + + +@_attrs_define +class ValidateThirdPartyTokenLogin: + """Serializer used in the authentication of third party logins with `third_party_token`. + + Attributes: + active_module_id (int): The id of the active module linked to the third party token login module. + third_party_token (str): The token provided by third party for PolyTicket authentication. + """ + + active_module_id: int + third_party_token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_module_id = self.active_module_id + + third_party_token = self.third_party_token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_module_id": active_module_id, + "third_party_token": third_party_token, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("active_module_id", (None, str(self.active_module_id).encode(), "text/plain"))) + + files.append(("third_party_token", (None, str(self.third_party_token).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_module_id = d.pop("active_module_id") + + third_party_token = d.pop("third_party_token") + + validate_third_party_token_login = cls( + active_module_id=active_module_id, + third_party_token=third_party_token, + ) + + validate_third_party_token_login.additional_properties = d + return validate_third_party_token_login + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/validate_trusted_email_login.py b/poly-ticket-api-client/poly_ticket_api_client/models/validate_trusted_email_login.py new file mode 100644 index 0000000..0a301db --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/validate_trusted_email_login.py @@ -0,0 +1,107 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ValidateTrustedEmailLogin") + + +@_attrs_define +class ValidateTrustedEmailLogin: + """Serializer used to retrieve credentials from the TrustedEmailLogin activation url. + + Attributes: + active_module_id (int): + login_pk_b64 (str): + email_validation_token_b64 (str): + testing (Union[Unset, bool]): Default: False. + """ + + active_module_id: int + login_pk_b64: str + email_validation_token_b64: str + testing: Union[Unset, bool] = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + active_module_id = self.active_module_id + + login_pk_b64 = self.login_pk_b64 + + email_validation_token_b64 = self.email_validation_token_b64 + + testing = self.testing + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "active_module_id": active_module_id, + "login_pk_b64": login_pk_b64, + "email_validation_token_b64": email_validation_token_b64, + } + ) + if testing is not UNSET: + field_dict["testing"] = testing + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("active_module_id", (None, str(self.active_module_id).encode(), "text/plain"))) + + files.append(("login_pk_b64", (None, str(self.login_pk_b64).encode(), "text/plain"))) + + files.append( + ("email_validation_token_b64", (None, str(self.email_validation_token_b64).encode(), "text/plain")) + ) + + if not isinstance(self.testing, Unset): + files.append(("testing", (None, str(self.testing).encode(), "text/plain"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + active_module_id = d.pop("active_module_id") + + login_pk_b64 = d.pop("login_pk_b64") + + email_validation_token_b64 = d.pop("email_validation_token_b64") + + testing = d.pop("testing", UNSET) + + validate_trusted_email_login = cls( + active_module_id=active_module_id, + login_pk_b64=login_pk_b64, + email_validation_token_b64=email_validation_token_b64, + testing=testing, + ) + + validate_trusted_email_login.additional_properties = d + return validate_trusted_email_login + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/verification_error.py b/poly-ticket-api-client/poly_ticket_api_client/models/verification_error.py new file mode 100644 index 0000000..46f442f --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/verification_error.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="VerificationError") + + +@_attrs_define +class VerificationError: + """ + Attributes: + errors (list[str]): List of errors encountered during account activation. + """ + + errors: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + errors = self.errors + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "errors": errors, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + errors = cast(list[str], d.pop("errors")) + + verification_error = cls( + errors=errors, + ) + + verification_error.additional_properties = d + return verification_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/verification_success.py b/poly-ticket-api-client/poly_ticket_api_client/models/verification_success.py new file mode 100644 index 0000000..ed4e081 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/verification_success.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="VerificationSuccess") + + +@_attrs_define +class VerificationSuccess: + """ + Attributes: + message (str): Message indicating account activation was successful. + """ + + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message") + + verification_success = cls( + message=message, + ) + + verification_success.additional_properties = d + return verification_success + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/models/webhooks.py b/poly-ticket-api-client/poly_ticket_api_client/models/webhooks.py new file mode 100644 index 0000000..a20dd90 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/models/webhooks.py @@ -0,0 +1,81 @@ +import json +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from .. import types + +if TYPE_CHECKING: + from ..models.payrexx_transaction import PayrexxTransaction + + +T = TypeVar("T", bound="Webhooks") + + +@_attrs_define +class Webhooks: + """Webhook data containing a transaction + + Attributes: + transaction (PayrexxTransaction): Transaction containing info for the webhook. + + referenceId can't be snake_case because the data is provided from Payrexx. + """ + + transaction: "PayrexxTransaction" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + transaction = self.transaction.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "transaction": transaction, + } + ) + + return field_dict + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("transaction", (None, json.dumps(self.transaction.to_dict()).encode(), "application/json"))) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.payrexx_transaction import PayrexxTransaction + + d = dict(src_dict) + transaction = PayrexxTransaction.from_dict(d.pop("transaction")) + + webhooks = cls( + transaction=transaction, + ) + + webhooks.additional_properties = d + return webhooks + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/poly-ticket-api-client/poly_ticket_api_client/py.typed b/poly-ticket-api-client/poly_ticket_api_client/py.typed new file mode 100644 index 0000000..1aad327 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/poly-ticket-api-client/poly_ticket_api_client/types.py b/poly-ticket-api-client/poly_ticket_api_client/types.py new file mode 100644 index 0000000..1b96ca4 --- /dev/null +++ b/poly-ticket-api-client/poly_ticket_api_client/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, Optional, TypeVar, Union + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = Union[IO[bytes], bytes, str] +FileTypes = Union[ + # (filename, file (or bytes), content_type) + tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], +] +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: Optional[str] = None + mime_type: Optional[str] = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: Optional[T] + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/poly-ticket-api-client/pyproject.toml b/poly-ticket-api-client/pyproject.toml new file mode 100644 index 0000000..58a5856 --- /dev/null +++ b/poly-ticket-api-client/pyproject.toml @@ -0,0 +1,27 @@ +[tool.poetry] +name = "poly-ticket-api-client" +version = "0.0.1" +description = "A client library for accessing PolyTicket API" +authors = [] +readme = "README.md" +packages = [ + {include = "poly_ticket_api_client"}, +] +include = ["CHANGELOG.md", "poly_ticket_api_client/py.typed"] + + +[tool.poetry.dependencies] +python = "^3.9" +httpx = ">=0.23.0,<0.29.0" +attrs = ">=22.2.0" +python-dateutil = "^2.8.0" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.ruff] +line-length = 120 + +[tool.ruff.lint] +select = ["F", "I", "UP"] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..51ed1bd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[project] +name = "polyticket-api" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.13" +dependencies = [ + "openapi-python-client>=0.25.2", +] diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..e0cc107 --- /dev/null +++ b/uv.lock @@ -0,0 +1,398 @@ +version = 1 +revision = 2 +requires-python = ">=3.13" + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "sniffio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/95/7d/4c1bd541d4dffa1b52bd83fb8527089e097a106fc90b467a7313b105f840/anyio-4.9.0.tar.gz", hash = "sha256:673c0c244e15788651a4ff38710fea9675823028a6f08a5eda409e0c9840a028", size = 190949, upload-time = "2025-03-17T00:02:54.77Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/ee/48ca1a7c89ffec8b6a0c5d02b89c305671d5ffd8d3c94acf8b8c408575bb/anyio-4.9.0-py3-none-any.whl", hash = "sha256:9f76d541cad6e36af7beb62e978876f3b41e3e04f2c1fbf0884604c0a9c4d93c", size = 100916, upload-time = "2025-03-17T00:02:52.713Z" }, +] + +[[package]] +name = "attrs" +version = "25.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/b0/1367933a8532ee6ff8d63537de4f1177af4bff9f3e829baf7331f595bb24/attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b", size = 812032, upload-time = "2025-03-13T11:10:22.779Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815, upload-time = "2025-03-13T11:10:21.14Z" }, +] + +[[package]] +name = "certifi" +version = "2025.7.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/de/8a/c729b6b60c66a38f590c4e774decc4b2ec7b0576be8f1aa984a53ffa812a/certifi-2025.7.9.tar.gz", hash = "sha256:c1d2ec05395148ee10cf672ffc28cd37ea0ab0d99f9cc74c43e588cbd111b079", size = 160386, upload-time = "2025-07-09T02:13:58.874Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/66/f3/80a3f974c8b535d394ff960a11ac20368e06b736da395b551a49ce950cce/certifi-2025.7.9-py3-none-any.whl", hash = "sha256:d842783a14f8fdd646895ac26f719a061408834473cfc10203f6a575beb15d39", size = 159230, upload-time = "2025-07-09T02:13:57.007Z" }, +] + +[[package]] +name = "click" +version = "8.2.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/60/6c/8ca2efa64cf75a977a0d7fac081354553ebe483345c734fb6b6515d96bbc/click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", size = 286342, upload-time = "2025-05-20T23:19:49.832Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/85/32/10bb5764d90a8eee674e9dc6f4db6a0ab47c8c4d0d83c27f7c39ac415a4d/click-8.2.1-py3-none-any.whl", hash = "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b", size = 102215, upload-time = "2025-05-20T23:19:47.796Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, +] + +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "3.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", size = 20537, upload-time = "2024-10-18T15:21:54.129Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/83/0e/67eb10a7ecc77a0c2bbe2b0235765b98d164d81600746914bebada795e97/MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", size = 14274, upload-time = "2024-10-18T15:21:24.577Z" }, + { url = "https://files.pythonhosted.org/packages/2b/6d/9409f3684d3335375d04e5f05744dfe7e9f120062c9857df4ab490a1031a/MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", size = 12352, upload-time = "2024-10-18T15:21:25.382Z" }, + { url = "https://files.pythonhosted.org/packages/d2/f5/6eadfcd3885ea85fe2a7c128315cc1bb7241e1987443d78c8fe712d03091/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", size = 24122, upload-time = "2024-10-18T15:21:26.199Z" }, + { url = "https://files.pythonhosted.org/packages/0c/91/96cf928db8236f1bfab6ce15ad070dfdd02ed88261c2afafd4b43575e9e9/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", size = 23085, upload-time = "2024-10-18T15:21:27.029Z" }, + { url = "https://files.pythonhosted.org/packages/c2/cf/c9d56af24d56ea04daae7ac0940232d31d5a8354f2b457c6d856b2057d69/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", size = 22978, upload-time = "2024-10-18T15:21:27.846Z" }, + { url = "https://files.pythonhosted.org/packages/2a/9f/8619835cd6a711d6272d62abb78c033bda638fdc54c4e7f4272cf1c0962b/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", size = 24208, upload-time = "2024-10-18T15:21:28.744Z" }, + { url = "https://files.pythonhosted.org/packages/f9/bf/176950a1792b2cd2102b8ffeb5133e1ed984547b75db47c25a67d3359f77/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", size = 23357, upload-time = "2024-10-18T15:21:29.545Z" }, + { url = "https://files.pythonhosted.org/packages/ce/4f/9a02c1d335caabe5c4efb90e1b6e8ee944aa245c1aaaab8e8a618987d816/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", size = 23344, upload-time = "2024-10-18T15:21:30.366Z" }, + { url = "https://files.pythonhosted.org/packages/ee/55/c271b57db36f748f0e04a759ace9f8f759ccf22b4960c270c78a394f58be/MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", size = 15101, upload-time = "2024-10-18T15:21:31.207Z" }, + { url = "https://files.pythonhosted.org/packages/29/88/07df22d2dd4df40aba9f3e402e6dc1b8ee86297dddbad4872bd5e7b0094f/MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", size = 15603, upload-time = "2024-10-18T15:21:32.032Z" }, + { url = "https://files.pythonhosted.org/packages/62/6a/8b89d24db2d32d433dffcd6a8779159da109842434f1dd2f6e71f32f738c/MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", size = 14510, upload-time = "2024-10-18T15:21:33.625Z" }, + { url = "https://files.pythonhosted.org/packages/7a/06/a10f955f70a2e5a9bf78d11a161029d278eeacbd35ef806c3fd17b13060d/MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", size = 12486, upload-time = "2024-10-18T15:21:34.611Z" }, + { url = "https://files.pythonhosted.org/packages/34/cf/65d4a571869a1a9078198ca28f39fba5fbb910f952f9dbc5220afff9f5e6/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", size = 25480, upload-time = "2024-10-18T15:21:35.398Z" }, + { url = "https://files.pythonhosted.org/packages/0c/e3/90e9651924c430b885468b56b3d597cabf6d72be4b24a0acd1fa0e12af67/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", size = 23914, upload-time = "2024-10-18T15:21:36.231Z" }, + { url = "https://files.pythonhosted.org/packages/66/8c/6c7cf61f95d63bb866db39085150df1f2a5bd3335298f14a66b48e92659c/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", size = 23796, upload-time = "2024-10-18T15:21:37.073Z" }, + { url = "https://files.pythonhosted.org/packages/bb/35/cbe9238ec3f47ac9a7c8b3df7a808e7cb50fe149dc7039f5f454b3fba218/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", size = 25473, upload-time = "2024-10-18T15:21:37.932Z" }, + { url = "https://files.pythonhosted.org/packages/e6/32/7621a4382488aa283cc05e8984a9c219abad3bca087be9ec77e89939ded9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", size = 24114, upload-time = "2024-10-18T15:21:39.799Z" }, + { url = "https://files.pythonhosted.org/packages/0d/80/0985960e4b89922cb5a0bac0ed39c5b96cbc1a536a99f30e8c220a996ed9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", size = 24098, upload-time = "2024-10-18T15:21:40.813Z" }, + { url = "https://files.pythonhosted.org/packages/82/78/fedb03c7d5380df2427038ec8d973587e90561b2d90cd472ce9254cf348b/MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", size = 15208, upload-time = "2024-10-18T15:21:41.814Z" }, + { url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739, upload-time = "2024-10-18T15:21:42.784Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "openapi-python-client" +version = "0.25.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "httpx" }, + { name = "jinja2" }, + { name = "pydantic" }, + { name = "python-dateutil" }, + { name = "ruamel-yaml" }, + { name = "ruff" }, + { name = "shellingham" }, + { name = "typer" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2f/b0/8cda0476b5148016ee661a8079cf703d5be06127f1f2dba4e5bf26cb5de3/openapi_python_client-0.25.2.tar.gz", hash = "sha256:8a0a03c3391ff77793047b14f70bb8f6705b9150153d1bd5baf35fea6b1669c2", size = 124422, upload-time = "2025-07-03T02:42:18.065Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/84/03/f9c3680dc8a04d0d7dfa79e2f83b29e56c8ac18d8824066f08320f2a242e/openapi_python_client-0.25.2-py3-none-any.whl", hash = "sha256:b2a6898804805cd6669d74aa0c93b4dc8da8575070885128ab1b8eae729b3bc8", size = 180849, upload-time = "2025-07-03T02:42:16.408Z" }, +] + +[[package]] +name = "polyticket-api" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "openapi-python-client" }, +] + +[package.metadata] +requires-dist = [{ name = "openapi-python-client", specifier = ">=0.25.2" }] + +[[package]] +name = "pydantic" +version = "2.11.7" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/00/dd/4325abf92c39ba8623b5af936ddb36ffcfe0beae70405d456ab1fb2f5b8c/pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db", size = 788350, upload-time = "2025-06-14T08:33:17.137Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/c0/ec2b1c8712ca690e5d61979dee872603e92b8a32f94cc1b72d53beab008a/pydantic-2.11.7-py3-none-any.whl", hash = "sha256:dde5df002701f6de26248661f6835bbe296a47bf73990135c7d07ce741b9623b", size = 444782, upload-time = "2025-06-14T08:33:14.905Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.33.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/46/8c/99040727b41f56616573a28771b1bfa08a3d3fe74d3d513f01251f79f172/pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f", size = 2015688, upload-time = "2025-04-23T18:31:53.175Z" }, + { url = "https://files.pythonhosted.org/packages/3a/cc/5999d1eb705a6cefc31f0b4a90e9f7fc400539b1a1030529700cc1b51838/pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6", size = 1844808, upload-time = "2025-04-23T18:31:54.79Z" }, + { url = "https://files.pythonhosted.org/packages/6f/5e/a0a7b8885c98889a18b6e376f344da1ef323d270b44edf8174d6bce4d622/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef", size = 1885580, upload-time = "2025-04-23T18:31:57.393Z" }, + { url = "https://files.pythonhosted.org/packages/3b/2a/953581f343c7d11a304581156618c3f592435523dd9d79865903272c256a/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a", size = 1973859, upload-time = "2025-04-23T18:31:59.065Z" }, + { url = "https://files.pythonhosted.org/packages/e6/55/f1a813904771c03a3f97f676c62cca0c0a4138654107c1b61f19c644868b/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916", size = 2120810, upload-time = "2025-04-23T18:32:00.78Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c3/053389835a996e18853ba107a63caae0b9deb4a276c6b472931ea9ae6e48/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a", size = 2676498, upload-time = "2025-04-23T18:32:02.418Z" }, + { url = "https://files.pythonhosted.org/packages/eb/3c/f4abd740877a35abade05e437245b192f9d0ffb48bbbbd708df33d3cda37/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d", size = 2000611, upload-time = "2025-04-23T18:32:04.152Z" }, + { url = "https://files.pythonhosted.org/packages/59/a7/63ef2fed1837d1121a894d0ce88439fe3e3b3e48c7543b2a4479eb99c2bd/pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56", size = 2107924, upload-time = "2025-04-23T18:32:06.129Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/2551964ef045669801675f1cfc3b0d74147f4901c3ffa42be2ddb1f0efc4/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5", size = 2063196, upload-time = "2025-04-23T18:32:08.178Z" }, + { url = "https://files.pythonhosted.org/packages/26/bd/d9602777e77fc6dbb0c7db9ad356e9a985825547dce5ad1d30ee04903918/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e", size = 2236389, upload-time = "2025-04-23T18:32:10.242Z" }, + { url = "https://files.pythonhosted.org/packages/42/db/0e950daa7e2230423ab342ae918a794964b053bec24ba8af013fc7c94846/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162", size = 2239223, upload-time = "2025-04-23T18:32:12.382Z" }, + { url = "https://files.pythonhosted.org/packages/58/4d/4f937099c545a8a17eb52cb67fe0447fd9a373b348ccfa9a87f141eeb00f/pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849", size = 1900473, upload-time = "2025-04-23T18:32:14.034Z" }, + { url = "https://files.pythonhosted.org/packages/a0/75/4a0a9bac998d78d889def5e4ef2b065acba8cae8c93696906c3a91f310ca/pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9", size = 1955269, upload-time = "2025-04-23T18:32:15.783Z" }, + { url = "https://files.pythonhosted.org/packages/f9/86/1beda0576969592f1497b4ce8e7bc8cbdf614c352426271b1b10d5f0aa64/pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9", size = 1893921, upload-time = "2025-04-23T18:32:18.473Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7d/e09391c2eebeab681df2b74bfe6c43422fffede8dc74187b2b0bf6fd7571/pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", size = 1806162, upload-time = "2025-04-23T18:32:20.188Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3d/847b6b1fed9f8ed3bb95a9ad04fbd0b212e832d4f0f50ff4d9ee5a9f15cf/pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", size = 1981560, upload-time = "2025-04-23T18:32:22.354Z" }, + { url = "https://files.pythonhosted.org/packages/6f/9a/e73262f6c6656262b5fdd723ad90f518f579b7bc8622e43a942eec53c938/pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", size = 1935777, upload-time = "2025-04-23T18:32:25.088Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "rich" +version = "14.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a1/53/830aa4c3066a8ab0ae9a9955976fb770fe9c6102117c8ec4ab3ea62d89e8/rich-14.0.0.tar.gz", hash = "sha256:82f1bc23a6a21ebca4ae0c45af9bdbc492ed20231dcb63f297d6d1021a9d5725", size = 224078, upload-time = "2025-03-30T14:15:14.23Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/9b/63f4c7ebc259242c89b3acafdb37b41d1185c07ff0011164674e9076b491/rich-14.0.0-py3-none-any.whl", hash = "sha256:1c9491e1951aac09caffd42f448ee3d04e58923ffe14993f6e83068dc395d7e0", size = 243229, upload-time = "2025-03-30T14:15:12.283Z" }, +] + +[[package]] +name = "ruamel-yaml" +version = "0.18.14" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ruamel-yaml-clib", marker = "python_full_version < '3.14' and platform_python_implementation == 'CPython'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/39/87/6da0df742a4684263261c253f00edd5829e6aca970fff69e75028cccc547/ruamel.yaml-0.18.14.tar.gz", hash = "sha256:7227b76aaec364df15936730efbf7d72b30c0b79b1d578bbb8e3dcb2d81f52b7", size = 145511, upload-time = "2025-06-09T08:51:09.828Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/af/6d/6fe4805235e193aad4aaf979160dd1f3c487c57d48b810c816e6e842171b/ruamel.yaml-0.18.14-py3-none-any.whl", hash = "sha256:710ff198bb53da66718c7db27eec4fbcc9aa6ca7204e4c1df2f282b6fe5eb6b2", size = 118570, upload-time = "2025-06-09T08:51:06.348Z" }, +] + +[[package]] +name = "ruamel-yaml-clib" +version = "0.2.12" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/20/84/80203abff8ea4993a87d823a5f632e4d92831ef75d404c9fc78d0176d2b5/ruamel.yaml.clib-0.2.12.tar.gz", hash = "sha256:6c8fbb13ec503f99a91901ab46e0b07ae7941cd527393187039aec586fdfd36f", size = 225315, upload-time = "2024-10-20T10:10:56.22Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/29/00/4864119668d71a5fa45678f380b5923ff410701565821925c69780356ffa/ruamel.yaml.clib-0.2.12-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:4c8c5d82f50bb53986a5e02d1b3092b03622c02c2eb78e29bec33fd9593bae1a", size = 132011, upload-time = "2024-10-20T10:13:04.377Z" }, + { url = "https://files.pythonhosted.org/packages/7f/5e/212f473a93ae78c669ffa0cb051e3fee1139cb2d385d2ae1653d64281507/ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux2014_aarch64.whl", hash = "sha256:e7e3736715fbf53e9be2a79eb4db68e4ed857017344d697e8b9749444ae57475", size = 642488, upload-time = "2024-10-20T10:13:05.906Z" }, + { url = "https://files.pythonhosted.org/packages/1f/8f/ecfbe2123ade605c49ef769788f79c38ddb1c8fa81e01f4dbf5cf1a44b16/ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b7e75b4965e1d4690e93021adfcecccbca7d61c7bddd8e22406ef2ff20d74ef", size = 745066, upload-time = "2024-10-20T10:13:07.26Z" }, + { url = "https://files.pythonhosted.org/packages/e2/a9/28f60726d29dfc01b8decdb385de4ced2ced9faeb37a847bd5cf26836815/ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96777d473c05ee3e5e3c3e999f5d23c6f4ec5b0c38c098b3a5229085f74236c6", size = 701785, upload-time = "2024-10-20T10:13:08.504Z" }, + { url = "https://files.pythonhosted.org/packages/84/7e/8e7ec45920daa7f76046578e4f677a3215fe8f18ee30a9cb7627a19d9b4c/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:3bc2a80e6420ca8b7d3590791e2dfc709c88ab9152c00eeb511c9875ce5778bf", size = 693017, upload-time = "2024-10-21T11:26:48.866Z" }, + { url = "https://files.pythonhosted.org/packages/c5/b3/d650eaade4ca225f02a648321e1ab835b9d361c60d51150bac49063b83fa/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e188d2699864c11c36cdfdada94d781fd5d6b0071cd9c427bceb08ad3d7c70e1", size = 741270, upload-time = "2024-10-21T11:26:50.213Z" }, + { url = "https://files.pythonhosted.org/packages/87/b8/01c29b924dcbbed75cc45b30c30d565d763b9c4d540545a0eeecffb8f09c/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4f6f3eac23941b32afccc23081e1f50612bdbe4e982012ef4f5797986828cd01", size = 709059, upload-time = "2024-12-11T19:58:18.846Z" }, + { url = "https://files.pythonhosted.org/packages/30/8c/ed73f047a73638257aa9377ad356bea4d96125b305c34a28766f4445cc0f/ruamel.yaml.clib-0.2.12-cp313-cp313-win32.whl", hash = "sha256:6442cb36270b3afb1b4951f060eccca1ce49f3d087ca1ca4563a6eb479cb3de6", size = 98583, upload-time = "2024-10-20T10:13:09.658Z" }, + { url = "https://files.pythonhosted.org/packages/b0/85/e8e751d8791564dd333d5d9a4eab0a7a115f7e349595417fd50ecae3395c/ruamel.yaml.clib-0.2.12-cp313-cp313-win_amd64.whl", hash = "sha256:e5b8daf27af0b90da7bb903a876477a9e6d7270be6146906b276605997c7e9a3", size = 115190, upload-time = "2024-10-20T10:13:10.66Z" }, +] + +[[package]] +name = "ruff" +version = "0.12.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6c/3d/d9a195676f25d00dbfcf3cf95fdd4c685c497fcfa7e862a44ac5e4e96480/ruff-0.12.2.tar.gz", hash = "sha256:d7b4f55cd6f325cb7621244f19c873c565a08aff5a4ba9c69aa7355f3f7afd3e", size = 4432239, upload-time = "2025-07-03T16:40:19.566Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/74/b6/2098d0126d2d3318fd5bec3ad40d06c25d377d95749f7a0c5af17129b3b1/ruff-0.12.2-py3-none-linux_armv6l.whl", hash = "sha256:093ea2b221df1d2b8e7ad92fc6ffdca40a2cb10d8564477a987b44fd4008a7be", size = 10369761, upload-time = "2025-07-03T16:39:38.847Z" }, + { url = "https://files.pythonhosted.org/packages/b1/4b/5da0142033dbe155dc598cfb99262d8ee2449d76920ea92c4eeb9547c208/ruff-0.12.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:09e4cf27cc10f96b1708100fa851e0daf21767e9709e1649175355280e0d950e", size = 11155659, upload-time = "2025-07-03T16:39:42.294Z" }, + { url = "https://files.pythonhosted.org/packages/3e/21/967b82550a503d7c5c5c127d11c935344b35e8c521f52915fc858fb3e473/ruff-0.12.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8ae64755b22f4ff85e9c52d1f82644abd0b6b6b6deedceb74bd71f35c24044cc", size = 10537769, upload-time = "2025-07-03T16:39:44.75Z" }, + { url = "https://files.pythonhosted.org/packages/33/91/00cff7102e2ec71a4890fb7ba1803f2cdb122d82787c7d7cf8041fe8cbc1/ruff-0.12.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3eb3a6b2db4d6e2c77e682f0b988d4d61aff06860158fdb413118ca133d57922", size = 10717602, upload-time = "2025-07-03T16:39:47.652Z" }, + { url = "https://files.pythonhosted.org/packages/9b/eb/928814daec4e1ba9115858adcda44a637fb9010618721937491e4e2283b8/ruff-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:73448de992d05517170fc37169cbca857dfeaeaa8c2b9be494d7bcb0d36c8f4b", size = 10198772, upload-time = "2025-07-03T16:39:49.641Z" }, + { url = "https://files.pythonhosted.org/packages/50/fa/f15089bc20c40f4f72334f9145dde55ab2b680e51afb3b55422effbf2fb6/ruff-0.12.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b8b94317cbc2ae4a2771af641739f933934b03555e51515e6e021c64441532d", size = 11845173, upload-time = "2025-07-03T16:39:52.069Z" }, + { url = "https://files.pythonhosted.org/packages/43/9f/1f6f98f39f2b9302acc161a4a2187b1e3a97634fe918a8e731e591841cf4/ruff-0.12.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:45fc42c3bf1d30d2008023a0a9a0cfb06bf9835b147f11fe0679f21ae86d34b1", size = 12553002, upload-time = "2025-07-03T16:39:54.551Z" }, + { url = "https://files.pythonhosted.org/packages/d8/70/08991ac46e38ddd231c8f4fd05ef189b1b94be8883e8c0c146a025c20a19/ruff-0.12.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce48f675c394c37e958bf229fb5c1e843e20945a6d962cf3ea20b7a107dcd9f4", size = 12171330, upload-time = "2025-07-03T16:39:57.55Z" }, + { url = "https://files.pythonhosted.org/packages/88/a9/5a55266fec474acfd0a1c73285f19dd22461d95a538f29bba02edd07a5d9/ruff-0.12.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:793d8859445ea47591272021a81391350205a4af65a9392401f418a95dfb75c9", size = 11774717, upload-time = "2025-07-03T16:39:59.78Z" }, + { url = "https://files.pythonhosted.org/packages/87/e5/0c270e458fc73c46c0d0f7cf970bb14786e5fdb88c87b5e423a4bd65232b/ruff-0.12.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6932323db80484dda89153da3d8e58164d01d6da86857c79f1961934354992da", size = 11646659, upload-time = "2025-07-03T16:40:01.934Z" }, + { url = "https://files.pythonhosted.org/packages/b7/b6/45ab96070c9752af37f0be364d849ed70e9ccede07675b0ec4e3ef76b63b/ruff-0.12.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6aa7e623a3a11538108f61e859ebf016c4f14a7e6e4eba1980190cacb57714ce", size = 10604012, upload-time = "2025-07-03T16:40:04.363Z" }, + { url = "https://files.pythonhosted.org/packages/86/91/26a6e6a424eb147cc7627eebae095cfa0b4b337a7c1c413c447c9ebb72fd/ruff-0.12.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2a4a20aeed74671b2def096bdf2eac610c7d8ffcbf4fb0e627c06947a1d7078d", size = 10176799, upload-time = "2025-07-03T16:40:06.514Z" }, + { url = "https://files.pythonhosted.org/packages/f5/0c/9f344583465a61c8918a7cda604226e77b2c548daf8ef7c2bfccf2b37200/ruff-0.12.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:71a4c550195612f486c9d1f2b045a600aeba851b298c667807ae933478fcef04", size = 11241507, upload-time = "2025-07-03T16:40:08.708Z" }, + { url = "https://files.pythonhosted.org/packages/1c/b7/99c34ded8fb5f86c0280278fa89a0066c3760edc326e935ce0b1550d315d/ruff-0.12.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:4987b8f4ceadf597c927beee65a5eaf994c6e2b631df963f86d8ad1bdea99342", size = 11717609, upload-time = "2025-07-03T16:40:10.836Z" }, + { url = "https://files.pythonhosted.org/packages/51/de/8589fa724590faa057e5a6d171e7f2f6cffe3287406ef40e49c682c07d89/ruff-0.12.2-py3-none-win32.whl", hash = "sha256:369ffb69b70cd55b6c3fc453b9492d98aed98062db9fec828cdfd069555f5f1a", size = 10523823, upload-time = "2025-07-03T16:40:13.203Z" }, + { url = "https://files.pythonhosted.org/packages/94/47/8abf129102ae4c90cba0c2199a1a9b0fa896f6f806238d6f8c14448cc748/ruff-0.12.2-py3-none-win_amd64.whl", hash = "sha256:dca8a3b6d6dc9810ed8f328d406516bf4d660c00caeaef36eb831cf4871b0639", size = 11629831, upload-time = "2025-07-03T16:40:15.478Z" }, + { url = "https://files.pythonhosted.org/packages/e2/1f/72d2946e3cc7456bb837e88000eb3437e55f80db339c840c04015a11115d/ruff-0.12.2-py3-none-win_arm64.whl", hash = "sha256:48d6c6bfb4761df68bc05ae630e24f506755e702d4fb08f08460be778c7ccb12", size = 10735334, upload-time = "2025-07-03T16:40:17.677Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, +] + +[[package]] +name = "typer" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "rich" }, + { name = "shellingham" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c5/8c/7d682431efca5fd290017663ea4588bf6f2c6aad085c7f108c5dbc316e70/typer-0.16.0.tar.gz", hash = "sha256:af377ffaee1dbe37ae9440cb4e8f11686ea5ce4e9bae01b84ae7c63b87f1dd3b", size = 102625, upload-time = "2025-05-26T14:30:31.824Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/42/3efaf858001d2c2913de7f354563e3a3a2f0decae3efe98427125a8f441e/typer-0.16.0-py3-none-any.whl", hash = "sha256:1f79bed11d4d02d4310e3c1b7ba594183bcedb0ac73b27a9e5f28f6fb5b98855", size = 46317, upload-time = "2025-05-26T14:30:30.523Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.14.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/98/5a/da40306b885cc8c09109dc2e1abd358d5684b1425678151cdaed4731c822/typing_extensions-4.14.1.tar.gz", hash = "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36", size = 107673, upload-time = "2025-07-04T13:28:34.16Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/00/d631e67a838026495268c2f6884f3711a15a9a2a96cd244fdaea53b823fb/typing_extensions-4.14.1-py3-none-any.whl", hash = "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76", size = 43906, upload-time = "2025-07-04T13:28:32.743Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, +]