From 0123b36b2d3cf8e0f67fbf13c4402329fc54ee53 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 03:09:30 +0000 Subject: [PATCH] SDK regeneration Unable to analyze changes with AI, incrementing PATCH version. --- .fern/metadata.json | 17 - .fernignore | 3 +- .gitignore | 4 +- LICENSE | 2 +- changelog.md | 4 + poetry.lock | 240 ++-- pyproject.toml | 33 +- reference.md | 1139 +---------------- requirements.txt | 2 +- src/square/__init__.py | 149 +-- src/square/apple_pay/__init__.py | 2 - src/square/apple_pay/client.py | 15 +- src/square/apple_pay/raw_client.py | 21 +- src/square/bank_accounts/__init__.py | 2 - src/square/bank_accounts/client.py | 108 +- src/square/bank_accounts/raw_client.py | 179 +-- src/square/bookings/__init__.py | 36 +- src/square/bookings/client.py | 312 ++--- .../custom_attribute_definitions/__init__.py | 2 - .../custom_attribute_definitions/client.py | 124 +- .../raw_client.py | 187 +-- .../bookings/custom_attributes/__init__.py | 2 - .../bookings/custom_attributes/client.py | 141 +- .../bookings/custom_attributes/raw_client.py | 223 +--- .../bookings/location_profiles/__init__.py | 2 - .../bookings/location_profiles/client.py | 88 +- .../bookings/location_profiles/raw_client.py | 131 +- src/square/bookings/raw_client.py | 285 +---- .../bookings/team_member_profiles/__init__.py | 2 - .../bookings/team_member_profiles/client.py | 110 +- .../team_member_profiles/raw_client.py | 169 +-- src/square/cards/__init__.py | 2 - src/square/cards/client.py | 136 +- src/square/cards/raw_client.py | 216 +--- src/square/cash_drawers/__init__.py | 31 +- src/square/cash_drawers/client.py | 37 +- src/square/cash_drawers/raw_client.py | 3 +- src/square/cash_drawers/shifts/__init__.py | 2 - src/square/cash_drawers/shifts/client.py | 204 ++- src/square/cash_drawers/shifts/raw_client.py | 345 +---- src/square/catalog/__init__.py | 31 +- src/square/catalog/client.py | 287 ++--- src/square/catalog/images/__init__.py | 2 - src/square/catalog/images/client.py | 27 +- src/square/catalog/images/raw_client.py | 39 +- src/square/catalog/object/__init__.py | 2 - src/square/catalog/object/client.py | 41 +- src/square/catalog/object/raw_client.py | 43 +- src/square/catalog/raw_client.py | 277 +--- src/square/channels/__init__.py | 4 - src/square/channels/client.py | 340 ----- src/square/channels/raw_client.py | 356 ------ src/square/checkout/__init__.py | 31 +- src/square/checkout/client.py | 73 +- src/square/checkout/payment_links/__init__.py | 2 - src/square/checkout/payment_links/client.py | 130 +- .../checkout/payment_links/raw_client.py | 195 +-- src/square/checkout/raw_client.py | 53 +- src/square/client.py | 842 ++---------- src/square/core/__init__.py | 31 +- src/square/core/client_wrapper.py | 22 +- src/square/core/custom_pagination.py | 152 --- src/square/core/force_multipart.py | 18 - src/square/core/http_client.py | 94 +- src/square/core/http_response.py | 30 +- src/square/core/http_sse/__init__.py | 42 - src/square/core/http_sse/_api.py | 112 -- src/square/core/http_sse/_decoders.py | 61 - src/square/core/http_sse/_exceptions.py | 7 - src/square/core/http_sse/_models.py | 17 - src/square/core/pagination.py | 93 +- src/square/core/pydantic_utilities.py | 186 +-- src/square/core/unchecked_base_model.py | 81 +- src/square/customers/__init__.py | 37 +- src/square/customers/cards/__init__.py | 2 - src/square/customers/cards/client.py | 25 +- src/square/customers/cards/raw_client.py | 33 +- src/square/customers/client.py | 333 +++-- .../custom_attribute_definitions/__init__.py | 2 - .../custom_attribute_definitions/client.py | 144 ++- .../raw_client.py | 213 +-- .../customers/custom_attributes/__init__.py | 2 - .../customers/custom_attributes/client.py | 123 +- .../customers/custom_attributes/raw_client.py | 213 +-- src/square/customers/groups/__init__.py | 2 - src/square/customers/groups/client.py | 144 ++- src/square/customers/groups/raw_client.py | 205 +-- src/square/customers/raw_client.py | 297 +---- src/square/customers/segments/__init__.py | 2 - src/square/customers/segments/client.py | 96 +- src/square/customers/segments/raw_client.py | 157 +-- src/square/devices/__init__.py | 31 +- src/square/devices/client.py | 135 +- src/square/devices/codes/__init__.py | 2 - src/square/devices/codes/client.py | 122 +- src/square/devices/codes/raw_client.py | 193 +-- src/square/devices/raw_client.py | 180 +-- src/square/disputes/__init__.py | 31 +- src/square/disputes/client.py | 172 ++- src/square/disputes/evidence/__init__.py | 2 - src/square/disputes/evidence/client.py | 105 +- src/square/disputes/evidence/raw_client.py | 155 +-- src/square/disputes/raw_client.py | 206 +-- src/square/employees/__init__.py | 2 - src/square/employees/client.py | 106 +- src/square/employees/raw_client.py | 170 +-- src/square/events/__init__.py | 2 - src/square/events/client.py | 43 +- src/square/events/raw_client.py | 47 +- src/square/gift_cards/__init__.py | 31 +- src/square/gift_cards/activities/__init__.py | 2 - src/square/gift_cards/activities/client.py | 134 +- .../gift_cards/activities/raw_client.py | 249 +--- src/square/gift_cards/client.py | 180 ++- src/square/gift_cards/raw_client.py | 241 +--- src/square/inventory/__init__.py | 2 - src/square/inventory/client.py | 460 +++++-- src/square/inventory/raw_client.py | 876 +------------ src/square/invoices/__init__.py | 2 - src/square/invoices/client.py | 182 ++- src/square/invoices/raw_client.py | 253 +--- src/square/labor/__init__.py | 37 +- src/square/labor/break_types/__init__.py | 2 - src/square/labor/break_types/client.py | 128 +- src/square/labor/break_types/raw_client.py | 189 +-- src/square/labor/client.py | 245 ++-- src/square/labor/employee_wages/__init__.py | 2 - src/square/labor/employee_wages/client.py | 100 +- src/square/labor/employee_wages/raw_client.py | 159 +-- src/square/labor/raw_client.py | 123 +- src/square/labor/shifts/__init__.py | 2 - src/square/labor/shifts/client.py | 55 +- src/square/labor/shifts/raw_client.py | 61 +- .../labor/team_member_wages/__init__.py | 2 - src/square/labor/team_member_wages/client.py | 102 +- .../labor/team_member_wages/raw_client.py | 161 +-- src/square/labor/workweek_configs/__init__.py | 2 - src/square/labor/workweek_configs/client.py | 98 +- .../labor/workweek_configs/raw_client.py | 147 +-- src/square/locations/__init__.py | 35 +- src/square/locations/client.py | 142 +- .../custom_attribute_definitions/__init__.py | 2 - .../custom_attribute_definitions/client.py | 134 +- .../raw_client.py | 206 +-- .../locations/custom_attributes/__init__.py | 2 - .../locations/custom_attributes/client.py | 153 ++- .../locations/custom_attributes/raw_client.py | 244 +--- src/square/locations/raw_client.py | 65 +- src/square/locations/transactions/__init__.py | 2 - src/square/locations/transactions/client.py | 45 +- .../locations/transactions/raw_client.py | 51 +- src/square/loyalty/__init__.py | 31 +- src/square/loyalty/accounts/__init__.py | 2 - src/square/loyalty/accounts/client.py | 59 +- src/square/loyalty/accounts/raw_client.py | 65 +- src/square/loyalty/client.py | 95 +- src/square/loyalty/programs/__init__.py | 31 +- src/square/loyalty/programs/client.py | 63 +- .../loyalty/programs/promotions/__init__.py | 2 - .../loyalty/programs/promotions/client.py | 125 +- .../loyalty/programs/promotions/raw_client.py | 204 +-- src/square/loyalty/programs/raw_client.py | 41 +- src/square/loyalty/raw_client.py | 23 +- src/square/loyalty/rewards/__init__.py | 2 - src/square/loyalty/rewards/client.py | 55 +- src/square/loyalty/rewards/raw_client.py | 61 +- src/square/merchants/__init__.py | 34 +- src/square/merchants/client.py | 153 ++- .../custom_attribute_definitions/__init__.py | 2 - .../custom_attribute_definitions/client.py | 134 +- .../raw_client.py | 206 +-- .../merchants/custom_attributes/__init__.py | 2 - .../merchants/custom_attributes/client.py | 153 ++- .../merchants/custom_attributes/raw_client.py | 244 +--- src/square/merchants/raw_client.py | 145 +-- src/square/mobile/__init__.py | 2 - src/square/mobile/client.py | 15 +- src/square/mobile/raw_client.py | 21 +- src/square/o_auth/__init__.py | 2 - src/square/o_auth/client.py | 41 +- src/square/o_auth/raw_client.py | 45 +- src/square/orders/__init__.py | 34 +- src/square/orders/client.py | 143 +-- .../custom_attribute_definitions/__init__.py | 2 - .../custom_attribute_definitions/client.py | 130 +- .../raw_client.py | 206 +-- .../orders/custom_attributes/__init__.py | 2 - src/square/orders/custom_attributes/client.py | 153 ++- .../orders/custom_attributes/raw_client.py | 250 +--- src/square/orders/raw_client.py | 95 +- src/square/payments/__init__.py | 2 - src/square/payments/client.py | 230 ++-- src/square/payments/raw_client.py | 426 +----- src/square/payouts/__init__.py | 2 - src/square/payouts/client.py | 214 +++- src/square/payouts/raw_client.py | 390 +----- src/square/refunds/__init__.py | 2 - src/square/refunds/client.py | 166 ++- src/square/refunds/raw_client.py | 342 +---- src/square/requests/__init__.py | 2 - .../requests/accept_dispute_response.py | 6 +- .../requests/accepted_payment_methods.py | 4 +- .../accumulate_loyalty_points_response.py | 4 +- src/square/requests/ach_details.py | 4 +- .../add_group_to_customer_response.py | 4 +- src/square/requests/additional_recipient.py | 4 +- src/square/requests/address.py | 4 +- .../adjust_loyalty_points_response.py | 4 +- src/square/requests/afterpay_details.py | 4 +- src/square/requests/application_details.py | 4 +- src/square/requests/appointment_segment.py | 4 +- src/square/requests/availability.py | 4 +- src/square/requests/bank_account.py | 8 +- .../requests/bank_account_created_event.py | 4 +- .../bank_account_created_event_data.py | 4 +- .../bank_account_created_event_object.py | 1 + .../requests/bank_account_disabled_event.py | 4 +- .../bank_account_disabled_event_data.py | 4 +- .../bank_account_disabled_event_object.py | 1 + .../requests/bank_account_payment_details.py | 4 +- .../requests/bank_account_verified_event.py | 4 +- .../bank_account_verified_event_data.py | 4 +- .../bank_account_verified_event_object.py | 1 + .../batch_change_inventory_request.py | 4 +- .../batch_change_inventory_response.py | 6 +- .../batch_create_team_members_response.py | 4 +- .../requests/batch_create_vendors_response.py | 6 +- .../batch_delete_catalog_objects_response.py | 4 +- .../batch_get_catalog_objects_response.py | 6 +- .../batch_get_inventory_changes_response.py | 4 +- .../batch_get_inventory_counts_request.py | 4 +- .../batch_get_inventory_counts_response.py | 4 +- .../requests/batch_get_orders_response.py | 6 +- .../requests/batch_get_vendors_response.py | 4 +- ...atch_retrieve_inventory_changes_request.py | 4 +- .../batch_update_team_members_response.py | 6 +- .../requests/batch_update_vendors_response.py | 4 +- .../batch_upsert_catalog_objects_response.py | 8 +- ...ustomer_custom_attribute_upsert_request.py | 4 +- ...ert_customer_custom_attributes_response.py | 4 +- ...stomer_custom_attribute_upsert_response.py | 4 +- src/square/requests/booking.py | 10 +- src/square/requests/booking_created_event.py | 4 +- .../requests/booking_created_event_data.py | 4 +- .../requests/booking_created_event_object.py | 1 + .../requests/booking_creator_details.py | 1 + ...ttribute_definition_owned_created_event.py | 4 +- ...ttribute_definition_owned_deleted_event.py | 4 +- ...ttribute_definition_owned_updated_event.py | 4 +- ...ribute_definition_visible_created_event.py | 4 +- ...ribute_definition_visible_deleted_event.py | 4 +- ...ribute_definition_visible_updated_event.py | 4 +- ...ooking_custom_attribute_delete_response.py | 4 +- ...ng_custom_attribute_owned_deleted_event.py | 4 +- ...ng_custom_attribute_owned_updated_event.py | 4 +- ...booking_custom_attribute_upsert_request.py | 4 +- ...ooking_custom_attribute_upsert_response.py | 4 +- ..._custom_attribute_visible_deleted_event.py | 4 +- ..._custom_attribute_visible_updated_event.py | 4 +- src/square/requests/booking_updated_event.py | 4 +- .../requests/booking_updated_event_data.py | 4 +- .../requests/booking_updated_event_object.py | 1 + src/square/requests/break_.py | 4 +- src/square/requests/break_type.py | 1 + .../requests/bulk_create_customer_data.py | 4 +- .../bulk_create_customers_response.py | 4 +- ...lete_booking_custom_attributes_response.py | 4 +- .../bulk_delete_customers_response.py | 4 +- ...ocation_custom_attribute_delete_request.py | 1 + ...ete_location_custom_attributes_response.py | 4 +- ...cation_custom_attribute_delete_response.py | 4 +- ...erchant_custom_attribute_delete_request.py | 1 + ...ete_merchant_custom_attributes_response.py | 4 +- ...rchant_custom_attribute_delete_response.py | 4 +- ...ributes_request_delete_custom_attribute.py | 1 + ...delete_order_custom_attributes_response.py | 6 +- .../bulk_publish_scheduled_shifts_data.py | 1 + .../bulk_publish_scheduled_shifts_response.py | 6 +- .../bulk_retrieve_bookings_response.py | 6 +- .../bulk_retrieve_channels_response.py | 27 - .../bulk_retrieve_customers_response.py | 6 +- ...e_team_member_booking_profiles_response.py | 6 +- .../requests/bulk_swap_plan_response.py | 4 +- .../requests/bulk_update_customer_data.py | 4 +- .../bulk_update_customers_response.py | 6 +- ...sert_booking_custom_attributes_response.py | 4 +- ...ocation_custom_attribute_upsert_request.py | 4 +- ...ert_location_custom_attributes_response.py | 4 +- ...cation_custom_attribute_upsert_response.py | 4 +- ...erchant_custom_attribute_upsert_request.py | 4 +- ...ert_merchant_custom_attributes_response.py | 4 +- ...rchant_custom_attribute_upsert_response.py | 4 +- ...ributes_request_upsert_custom_attribute.py | 4 +- ...upsert_order_custom_attributes_response.py | 4 +- .../requests/business_appointment_settings.py | 8 +- .../requests/business_booking_profile.py | 6 +- src/square/requests/business_hours.py | 4 +- src/square/requests/business_hours_period.py | 4 +- .../requests/buy_now_pay_later_details.py | 4 +- .../calculate_loyalty_points_response.py | 4 +- .../requests/calculate_order_response.py | 6 +- .../requests/cancel_booking_response.py | 4 +- .../requests/cancel_invoice_response.py | 6 +- .../cancel_loyalty_promotion_response.py | 4 +- ...cel_payment_by_idempotency_key_response.py | 4 +- .../requests/cancel_payment_response.py | 4 +- .../requests/cancel_subscription_response.py | 4 +- .../cancel_terminal_action_response.py | 4 +- .../cancel_terminal_checkout_response.py | 4 +- .../cancel_terminal_refund_response.py | 4 +- .../cancel_transfer_order_response.py | 23 - .../requests/capture_transaction_response.py | 4 +- src/square/requests/card.py | 12 +- .../card_automatically_updated_event.py | 4 +- .../card_automatically_updated_event_data.py | 4 +- ...card_automatically_updated_event_object.py | 1 + src/square/requests/card_created_event.py | 4 +- .../requests/card_created_event_data.py | 4 +- .../requests/card_created_event_object.py | 1 + src/square/requests/card_disabled_event.py | 4 +- .../requests/card_disabled_event_data.py | 4 +- .../requests/card_disabled_event_object.py | 1 + src/square/requests/card_forgotten_event.py | 4 +- .../requests/card_forgotten_event_card.py | 4 +- .../requests/card_forgotten_event_data.py | 4 +- .../requests/card_forgotten_event_object.py | 1 + src/square/requests/card_payment_details.py | 32 +- src/square/requests/card_payment_timeline.py | 4 +- src/square/requests/card_updated_event.py | 4 +- .../requests/card_updated_event_data.py | 4 +- .../requests/card_updated_event_object.py | 1 + src/square/requests/cash_app_details.py | 4 +- src/square/requests/cash_drawer_device.py | 4 +- src/square/requests/cash_drawer_shift.py | 6 +- .../requests/cash_drawer_shift_event.py | 4 +- .../requests/cash_drawer_shift_summary.py | 4 +- src/square/requests/cash_payment_details.py | 1 + .../requests/catalog_availability_period.py | 4 +- src/square/requests/catalog_category.py | 6 +- .../catalog_custom_attribute_definition.py | 14 +- ...stom_attribute_definition_number_config.py | 4 +- ...m_attribute_definition_selection_config.py | 4 +- ...ction_config_custom_attribute_selection.py | 4 +- ...stom_attribute_definition_string_config.py | 4 +- .../catalog_custom_attribute_value.py | 4 +- src/square/requests/catalog_discount.py | 6 +- src/square/requests/catalog_ecom_seo_data.py | 4 +- src/square/requests/catalog_id_mapping.py | 4 +- src/square/requests/catalog_image.py | 4 +- src/square/requests/catalog_info_response.py | 6 +- .../requests/catalog_info_response_limits.py | 4 +- src/square/requests/catalog_item.py | 12 +- .../catalog_item_food_and_beverage_details.py | 4 +- ...and_beverage_details_dietary_preference.py | 10 +- ...em_food_and_beverage_details_ingredient.py | 4 +- .../catalog_item_modifier_list_info.py | 10 +- src/square/requests/catalog_item_option.py | 6 +- .../requests/catalog_item_option_for_item.py | 4 +- .../requests/catalog_item_option_value.py | 4 +- ...og_item_option_value_for_item_variation.py | 4 +- src/square/requests/catalog_item_variation.py | 8 +- .../requests/catalog_measurement_unit.py | 4 +- src/square/requests/catalog_modifier.py | 6 +- src/square/requests/catalog_modifier_list.py | 8 +- .../requests/catalog_modifier_override.py | 8 +- src/square/requests/catalog_object.py | 411 +++++- .../catalog_object_availability_period.py | 91 +- src/square/requests/catalog_object_base.py | 14 +- src/square/requests/catalog_object_batch.py | 3 +- .../requests/catalog_object_category.py | 10 +- ...alog_object_custom_attribute_definition.py | 91 +- .../requests/catalog_object_discount.py | 91 +- src/square/requests/catalog_object_image.py | 91 +- src/square/requests/catalog_object_item.py | 93 +- .../requests/catalog_object_item_option.py | 93 +- .../catalog_object_item_option_value.py | 91 +- .../requests/catalog_object_item_variation.py | 91 +- .../catalog_object_measurement_unit.py | 91 +- .../requests/catalog_object_modifier.py | 91 +- .../requests/catalog_object_modifier_list.py | 93 +- .../requests/catalog_object_pricing_rule.py | 91 +- .../requests/catalog_object_product_set.py | 91 +- .../catalog_object_quick_amounts_settings.py | 91 +- .../requests/catalog_object_reference.py | 4 +- .../catalog_object_subscription_plan.py | 93 +- ...alog_object_subscription_plan_variation.py | 91 +- src/square/requests/catalog_object_tax.py | 91 +- .../requests/catalog_object_time_period.py | 91 +- src/square/requests/catalog_pricing_rule.py | 4 +- src/square/requests/catalog_product_set.py | 4 +- src/square/requests/catalog_query.py | 13 +- ..._item_variations_for_item_option_values.py | 4 +- .../catalog_query_items_for_item_options.py | 4 +- .../catalog_query_items_for_modifier_list.py | 3 +- .../requests/catalog_query_items_for_tax.py | 3 +- src/square/requests/catalog_query_range.py | 4 +- src/square/requests/catalog_query_set.py | 3 +- .../catalog_query_sorted_attribute.py | 4 +- src/square/requests/catalog_query_text.py | 3 +- src/square/requests/catalog_quick_amount.py | 4 +- .../catalog_quick_amounts_settings.py | 4 +- .../requests/catalog_subscription_plan.py | 6 +- .../catalog_subscription_plan_variation.py | 4 +- src/square/requests/catalog_tax.py | 4 +- src/square/requests/catalog_time_period.py | 4 +- src/square/requests/catalog_v1id.py | 4 +- .../requests/catalog_version_updated_event.py | 4 +- ...g_version_updated_event_catalog_version.py | 1 + .../catalog_version_updated_event_data.py | 4 +- .../catalog_version_updated_event_object.py | 1 + .../requests/category_path_to_root_node.py | 4 +- .../change_billing_anchor_date_response.py | 4 +- src/square/requests/channel.py | 52 - src/square/requests/checkout.py | 6 +- .../requests/checkout_location_settings.py | 8 +- .../checkout_location_settings_branding.py | 6 +- .../checkout_location_settings_coupons.py | 4 +- .../checkout_location_settings_policy.py | 4 +- .../checkout_location_settings_tipping.py | 4 +- .../requests/checkout_merchant_settings.py | 1 + ...ckout_merchant_settings_payment_methods.py | 7 +- ...tings_payment_methods_afterpay_clearpay.py | 1 + ...settings_payment_methods_payment_method.py | 4 +- src/square/requests/checkout_options.py | 6 +- src/square/requests/clearpay_details.py | 4 +- src/square/requests/clone_order_response.py | 6 +- src/square/requests/collected_data.py | 1 + .../requests/complete_payment_response.py | 4 +- src/square/requests/component.py | 5 +- src/square/requests/confirmation_decision.py | 1 + src/square/requests/confirmation_options.py | 4 +- src/square/requests/coordinates.py | 4 +- ...ng_custom_attribute_definition_response.py | 4 +- .../requests/create_booking_response.py | 4 +- .../requests/create_break_type_response.py | 4 +- src/square/requests/create_card_response.py | 6 +- .../requests/create_catalog_image_request.py | 1 + .../requests/create_catalog_image_response.py | 6 +- .../requests/create_checkout_response.py | 4 +- .../requests/create_customer_card_response.py | 6 +- ...er_custom_attribute_definition_response.py | 4 +- .../create_customer_group_response.py | 6 +- .../requests/create_customer_response.py | 6 +- .../requests/create_device_code_response.py | 6 +- .../create_dispute_evidence_file_request.py | 1 + .../create_dispute_evidence_file_response.py | 6 +- .../create_dispute_evidence_text_response.py | 6 +- .../create_gift_card_activity_response.py | 4 +- .../requests/create_gift_card_response.py | 4 +- .../create_invoice_attachment_request_data.py | 1 + .../create_invoice_attachment_response.py | 6 +- .../requests/create_invoice_response.py | 6 +- src/square/requests/create_job_response.py | 6 +- ...on_custom_attribute_definition_response.py | 4 +- .../requests/create_location_response.py | 4 +- .../create_loyalty_account_response.py | 4 +- .../create_loyalty_promotion_response.py | 4 +- .../create_loyalty_reward_response.py | 4 +- ...nt_custom_attribute_definition_response.py | 4 +- ...eate_mobile_authorization_code_response.py | 4 +- ...er_custom_attribute_definition_response.py | 4 +- src/square/requests/create_order_request.py | 1 + src/square/requests/create_order_response.py | 6 +- .../requests/create_payment_link_response.py | 4 +- .../requests/create_payment_response.py | 4 +- .../create_scheduled_shift_response.py | 6 +- src/square/requests/create_shift_response.py | 6 +- .../requests/create_subscription_response.py | 4 +- .../requests/create_team_member_request.py | 1 + .../requests/create_team_member_response.py | 6 +- .../create_terminal_action_response.py | 4 +- .../create_terminal_checkout_response.py | 4 +- .../create_terminal_refund_response.py | 4 +- .../requests/create_timecard_response.py | 6 +- .../requests/create_transfer_order_data.py | 52 - .../create_transfer_order_line_data.py | 24 - .../create_transfer_order_response.py | 23 - src/square/requests/create_vendor_response.py | 4 +- .../create_webhook_subscription_response.py | 4 +- src/square/requests/custom_attribute.py | 6 +- .../requests/custom_attribute_definition.py | 6 +- .../custom_attribute_definition_event_data.py | 4 +- ..._attribute_definition_event_data_object.py | 1 + .../requests/custom_attribute_event_data.py | 4 +- .../custom_attribute_event_data_object.py | 1 + .../requests/custom_attribute_filter.py | 4 +- src/square/requests/customer.py | 6 +- .../requests/customer_address_filter.py | 3 +- src/square/requests/customer_created_event.py | 4 +- .../requests/customer_created_event_data.py | 4 +- .../customer_created_event_event_context.py | 1 + ...tomer_created_event_event_context_merge.py | 4 +- .../requests/customer_created_event_object.py | 1 + .../customer_creation_source_filter.py | 4 +- ...stom_attribute_definition_created_event.py | 4 +- ...tribute_definition_created_public_event.py | 4 +- ...stom_attribute_definition_deleted_event.py | 4 +- ...tribute_definition_deleted_public_event.py | 4 +- ...ttribute_definition_owned_created_event.py | 4 +- ...ttribute_definition_owned_deleted_event.py | 4 +- ...ttribute_definition_owned_updated_event.py | 4 +- ...stom_attribute_definition_updated_event.py | 4 +- ...tribute_definition_updated_public_event.py | 4 +- ...ribute_definition_visible_created_event.py | 4 +- ...ribute_definition_visible_deleted_event.py | 4 +- ...ribute_definition_visible_updated_event.py | 4 +- ...customer_custom_attribute_deleted_event.py | 4 +- ...r_custom_attribute_deleted_public_event.py | 4 +- .../customer_custom_attribute_filter.py | 1 + .../customer_custom_attribute_filter_value.py | 8 +- .../customer_custom_attribute_filters.py | 4 +- ...er_custom_attribute_owned_deleted_event.py | 4 +- ...er_custom_attribute_owned_updated_event.py | 4 +- ...customer_custom_attribute_updated_event.py | 4 +- ...r_custom_attribute_updated_public_event.py | 4 +- ..._custom_attribute_visible_deleted_event.py | 4 +- ..._custom_attribute_visible_updated_event.py | 4 +- src/square/requests/customer_deleted_event.py | 4 +- .../requests/customer_deleted_event_data.py | 4 +- .../customer_deleted_event_event_context.py | 1 + ...tomer_deleted_event_event_context_merge.py | 4 +- .../requests/customer_deleted_event_object.py | 1 + src/square/requests/customer_details.py | 4 +- src/square/requests/customer_filter.py | 5 +- src/square/requests/customer_group.py | 1 + src/square/requests/customer_preferences.py | 4 +- src/square/requests/customer_query.py | 1 + src/square/requests/customer_segment.py | 1 + src/square/requests/customer_sort.py | 1 + src/square/requests/customer_tax_ids.py | 4 +- src/square/requests/customer_text_filter.py | 4 +- src/square/requests/customer_updated_event.py | 4 +- .../requests/customer_updated_event_data.py | 4 +- .../requests/customer_updated_event_object.py | 1 + .../requests/data_collection_options.py | 1 + src/square/requests/date_range.py | 4 +- ...ng_custom_attribute_definition_response.py | 4 +- ...elete_booking_custom_attribute_response.py | 4 +- .../requests/delete_break_type_response.py | 4 +- .../delete_catalog_object_response.py | 4 +- .../requests/delete_customer_card_response.py | 4 +- ...er_custom_attribute_definition_response.py | 4 +- ...lete_customer_custom_attribute_response.py | 4 +- .../delete_customer_group_response.py | 4 +- .../requests/delete_customer_response.py | 4 +- .../delete_dispute_evidence_response.py | 4 +- .../delete_invoice_attachment_response.py | 4 +- .../requests/delete_invoice_response.py | 4 +- ...on_custom_attribute_definition_response.py | 4 +- ...lete_location_custom_attribute_response.py | 4 +- .../delete_loyalty_reward_response.py | 4 +- ...nt_custom_attribute_definition_response.py | 4 +- ...lete_merchant_custom_attribute_response.py | 4 +- ...er_custom_attribute_definition_response.py | 4 +- .../delete_order_custom_attribute_response.py | 4 +- .../requests/delete_payment_link_response.py | 4 +- src/square/requests/delete_shift_response.py | 4 +- .../requests/delete_snippet_response.py | 4 +- .../delete_subscription_action_response.py | 4 +- .../requests/delete_timecard_response.py | 4 +- .../delete_transfer_order_response.py | 17 - .../delete_webhook_subscription_response.py | 4 +- src/square/requests/destination.py | 1 + src/square/requests/destination_details.py | 1 + ...destination_details_card_refund_details.py | 4 +- ...destination_details_cash_refund_details.py | 1 + ...ination_details_external_refund_details.py | 6 +- src/square/requests/device.py | 6 +- src/square/requests/device_attributes.py | 4 +- .../requests/device_checkout_options.py | 4 +- src/square/requests/device_code.py | 6 +- .../requests/device_code_paired_event.py | 4 +- .../requests/device_code_paired_event_data.py | 4 +- .../device_code_paired_event_object.py | 1 + ...e_component_details_application_details.py | 4 +- ...evice_component_details_battery_details.py | 4 +- ...e_component_details_card_reader_details.py | 1 + ...vice_component_details_ethernet_details.py | 9 +- .../device_component_details_measurement.py | 7 +- .../device_component_details_wi_fi_details.py | 9 +- src/square/requests/device_created_event.py | 4 +- .../requests/device_created_event_data.py | 4 +- .../requests/device_created_event_object.py | 1 + src/square/requests/device_details.py | 4 +- src/square/requests/device_metadata.py | 4 +- src/square/requests/device_status.py | 3 +- src/square/requests/digital_wallet_details.py | 4 +- src/square/requests/disable_card_response.py | 6 +- .../requests/disable_events_response.py | 4 +- .../dismiss_terminal_action_response.py | 4 +- .../dismiss_terminal_checkout_response.py | 4 +- .../dismiss_terminal_refund_response.py | 4 +- src/square/requests/dispute.py | 8 +- src/square/requests/dispute_created_event.py | 4 +- .../requests/dispute_created_event_data.py | 4 +- .../requests/dispute_created_event_object.py | 1 + src/square/requests/dispute_evidence.py | 6 +- .../requests/dispute_evidence_added_event.py | 4 +- .../dispute_evidence_added_event_data.py | 4 +- .../dispute_evidence_added_event_object.py | 1 + .../dispute_evidence_created_event.py | 4 +- .../dispute_evidence_created_event_data.py | 4 +- .../dispute_evidence_created_event_object.py | 1 + .../dispute_evidence_deleted_event.py | 4 +- .../dispute_evidence_deleted_event_data.py | 4 +- .../dispute_evidence_deleted_event_object.py | 1 + src/square/requests/dispute_evidence_file.py | 4 +- .../dispute_evidence_removed_event.py | 4 +- .../dispute_evidence_removed_event_data.py | 4 +- .../dispute_evidence_removed_event_object.py | 1 + .../requests/dispute_state_changed_event.py | 4 +- .../dispute_state_changed_event_data.py | 4 +- .../dispute_state_changed_event_object.py | 1 + .../requests/dispute_state_updated_event.py | 4 +- .../dispute_state_updated_event_data.py | 4 +- .../dispute_state_updated_event_object.py | 1 + src/square/requests/disputed_payment.py | 4 +- src/square/requests/employee.py | 4 +- src/square/requests/employee_wage.py | 4 +- src/square/requests/enable_events_response.py | 4 +- src/square/requests/error.py | 1 + src/square/requests/event.py | 4 +- src/square/requests/event_data.py | 6 +- src/square/requests/event_metadata.py | 4 +- src/square/requests/event_type_metadata.py | 1 + .../requests/external_payment_details.py | 6 +- src/square/requests/filter_value.py | 4 +- src/square/requests/float_number_range.py | 4 +- src/square/requests/fulfillment.py | 10 +- .../requests/fulfillment_delivery_details.py | 6 +- .../requests/fulfillment_fulfillment_entry.py | 4 +- .../requests/fulfillment_pickup_details.py | 6 +- ..._pickup_details_curbside_pickup_details.py | 4 +- src/square/requests/fulfillment_recipient.py | 4 +- .../requests/fulfillment_shipment_details.py | 4 +- .../get_bank_account_by_v1id_response.py | 6 +- .../requests/get_bank_account_response.py | 6 +- src/square/requests/get_booking_response.py | 4 +- .../requests/get_break_type_response.py | 4 +- .../get_business_booking_profile_response.py | 4 +- src/square/requests/get_card_response.py | 6 +- .../get_cash_drawer_shift_response.py | 4 +- .../requests/get_catalog_object_response.py | 6 +- ...er_custom_attribute_definition_response.py | 4 +- .../get_customer_custom_attribute_response.py | 4 +- .../requests/get_customer_group_response.py | 6 +- src/square/requests/get_customer_response.py | 6 +- .../requests/get_customer_segment_response.py | 6 +- .../requests/get_device_code_response.py | 6 +- src/square/requests/get_device_response.py | 6 +- .../requests/get_dispute_evidence_response.py | 6 +- src/square/requests/get_dispute_response.py | 6 +- src/square/requests/get_employee_response.py | 4 +- .../requests/get_employee_wage_response.py | 4 +- .../get_gift_card_from_gan_response.py | 4 +- .../get_gift_card_from_nonce_response.py | 4 +- src/square/requests/get_gift_card_response.py | 4 +- .../get_inventory_adjustment_response.py | 4 +- .../get_inventory_changes_response.py | 4 +- .../requests/get_inventory_count_response.py | 4 +- .../get_inventory_physical_count_response.py | 4 +- .../get_inventory_transfer_response.py | 4 +- src/square/requests/get_invoice_response.py | 6 +- src/square/requests/get_location_response.py | 4 +- .../requests/get_loyalty_account_response.py | 4 +- .../requests/get_loyalty_program_response.py | 4 +- .../get_loyalty_promotion_response.py | 4 +- .../requests/get_loyalty_reward_response.py | 4 +- src/square/requests/get_merchant_response.py | 4 +- src/square/requests/get_order_response.py | 6 +- .../requests/get_payment_link_response.py | 4 +- .../requests/get_payment_refund_response.py | 4 +- src/square/requests/get_payment_response.py | 4 +- src/square/requests/get_payout_response.py | 6 +- src/square/requests/get_shift_response.py | 6 +- src/square/requests/get_snippet_response.py | 4 +- .../requests/get_subscription_response.py | 4 +- ...et_team_member_booking_profile_response.py | 6 +- .../requests/get_team_member_response.py | 6 +- .../requests/get_team_member_wage_response.py | 6 +- .../requests/get_terminal_action_response.py | 4 +- .../get_terminal_checkout_response.py | 4 +- .../requests/get_terminal_refund_response.py | 4 +- .../requests/get_transaction_response.py | 4 +- src/square/requests/get_vendor_response.py | 4 +- .../requests/get_wage_setting_response.py | 6 +- .../get_webhook_subscription_response.py | 4 +- src/square/requests/gift_card.py | 6 +- src/square/requests/gift_card_activity.py | 24 +- .../requests/gift_card_activity_activate.py | 4 +- .../gift_card_activity_adjust_decrement.py | 2 +- .../gift_card_activity_adjust_increment.py | 2 +- .../gift_card_activity_created_event.py | 4 +- .../gift_card_activity_created_event_data.py | 4 +- ...gift_card_activity_created_event_object.py | 1 + .../requests/gift_card_activity_load.py | 4 +- .../requests/gift_card_activity_redeem.py | 6 +- .../requests/gift_card_activity_refund.py | 4 +- ..._card_activity_unlinked_activity_refund.py | 4 +- .../gift_card_activity_updated_event.py | 4 +- .../gift_card_activity_updated_event_data.py | 4 +- ...gift_card_activity_updated_event_object.py | 1 + .../requests/gift_card_created_event.py | 4 +- .../requests/gift_card_created_event_data.py | 4 +- .../gift_card_created_event_object.py | 1 + .../gift_card_customer_linked_event.py | 4 +- .../gift_card_customer_linked_event_data.py | 4 +- .../gift_card_customer_linked_event_object.py | 4 +- .../gift_card_customer_unlinked_event.py | 4 +- .../gift_card_customer_unlinked_event_data.py | 4 +- ...ift_card_customer_unlinked_event_object.py | 4 +- .../requests/gift_card_updated_event.py | 4 +- .../requests/gift_card_updated_event_data.py | 4 +- .../gift_card_updated_event_object.py | 1 + src/square/requests/inventory_adjustment.py | 6 +- .../requests/inventory_adjustment_group.py | 1 + src/square/requests/inventory_change.py | 5 +- src/square/requests/inventory_count.py | 4 +- .../requests/inventory_count_updated_event.py | 4 +- .../inventory_count_updated_event_data.py | 4 +- .../inventory_count_updated_event_object.py | 4 +- .../requests/inventory_physical_count.py | 4 +- src/square/requests/inventory_transfer.py | 4 +- src/square/requests/invoice.py | 16 +- .../invoice_accepted_payment_methods.py | 4 +- src/square/requests/invoice_attachment.py | 1 + src/square/requests/invoice_canceled_event.py | 4 +- .../requests/invoice_canceled_event_data.py | 4 +- .../requests/invoice_canceled_event_object.py | 1 + src/square/requests/invoice_created_event.py | 4 +- .../requests/invoice_created_event_data.py | 4 +- .../requests/invoice_created_event_object.py | 1 + src/square/requests/invoice_custom_field.py | 4 +- src/square/requests/invoice_deleted_event.py | 4 +- .../requests/invoice_deleted_event_data.py | 4 +- src/square/requests/invoice_filter.py | 2 +- .../requests/invoice_payment_made_event.py | 4 +- .../invoice_payment_made_event_data.py | 4 +- .../invoice_payment_made_event_object.py | 1 + .../requests/invoice_payment_reminder.py | 4 +- .../requests/invoice_payment_request.py | 10 +- .../requests/invoice_published_event.py | 4 +- .../requests/invoice_published_event_data.py | 4 +- .../invoice_published_event_object.py | 1 + src/square/requests/invoice_query.py | 1 + src/square/requests/invoice_recipient.py | 4 +- .../requests/invoice_recipient_tax_ids.py | 1 + src/square/requests/invoice_refunded_event.py | 4 +- .../requests/invoice_refunded_event_data.py | 4 +- .../requests/invoice_refunded_event_object.py | 1 + .../invoice_scheduled_charge_failed_event.py | 4 +- ...oice_scheduled_charge_failed_event_data.py | 4 +- ...ce_scheduled_charge_failed_event_object.py | 1 + src/square/requests/invoice_sort.py | 1 + src/square/requests/invoice_updated_event.py | 4 +- .../requests/invoice_updated_event_data.py | 4 +- .../requests/invoice_updated_event_object.py | 1 + .../item_variation_location_overrides.py | 6 +- src/square/requests/job.py | 4 +- src/square/requests/job_assignment.py | 4 +- src/square/requests/job_created_event.py | 4 +- src/square/requests/job_created_event_data.py | 4 +- .../requests/job_created_event_object.py | 1 + src/square/requests/job_updated_event.py | 4 +- src/square/requests/job_updated_event_data.py | 4 +- .../requests/job_updated_event_object.py | 1 + .../labor_scheduled_shift_created_event.py | 4 +- ...abor_scheduled_shift_created_event_data.py | 4 +- ...or_scheduled_shift_created_event_object.py | 3 +- .../labor_scheduled_shift_deleted_event.py | 4 +- ...abor_scheduled_shift_deleted_event_data.py | 4 +- .../labor_scheduled_shift_published_event.py | 4 +- ...or_scheduled_shift_published_event_data.py | 4 +- ..._scheduled_shift_published_event_object.py | 3 +- .../labor_scheduled_shift_updated_event.py | 4 +- ...abor_scheduled_shift_updated_event_data.py | 4 +- ...or_scheduled_shift_updated_event_object.py | 3 +- .../requests/labor_shift_created_event.py | 4 +- .../labor_shift_created_event_data.py | 4 +- .../labor_shift_created_event_object.py | 1 + .../requests/labor_shift_deleted_event.py | 4 +- .../labor_shift_deleted_event_data.py | 4 +- .../requests/labor_shift_updated_event.py | 4 +- .../labor_shift_updated_event_data.py | 4 +- .../labor_shift_updated_event_object.py | 1 + .../requests/labor_timecard_created_event.py | 4 +- .../labor_timecard_created_event_data.py | 4 +- .../labor_timecard_created_event_object.py | 1 + .../requests/labor_timecard_deleted_event.py | 4 +- .../labor_timecard_deleted_event_data.py | 4 +- .../requests/labor_timecard_updated_event.py | 4 +- .../labor_timecard_updated_event_data.py | 4 +- .../labor_timecard_updated_event_object.py | 1 + .../link_customer_to_gift_card_response.py | 4 +- .../requests/list_bank_accounts_response.py | 6 +- ...g_custom_attribute_definitions_response.py | 4 +- ...list_booking_custom_attributes_response.py | 4 +- src/square/requests/list_bookings_response.py | 4 +- .../requests/list_break_types_response.py | 4 +- src/square/requests/list_cards_response.py | 6 +- .../list_cash_drawer_shift_events_response.py | 6 +- .../list_cash_drawer_shifts_response.py | 6 +- src/square/requests/list_catalog_response.py | 6 +- src/square/requests/list_channels_response.py | 24 - ...r_custom_attribute_definitions_response.py | 4 +- ...ist_customer_custom_attributes_response.py | 4 +- .../requests/list_customer_groups_response.py | 6 +- .../list_customer_segments_response.py | 6 +- .../requests/list_customers_response.py | 6 +- .../requests/list_device_codes_response.py | 6 +- src/square/requests/list_devices_response.py | 6 +- .../list_dispute_evidence_response.py | 4 +- src/square/requests/list_disputes_response.py | 6 +- .../requests/list_employee_wages_response.py | 4 +- .../requests/list_employees_response.py | 4 +- .../requests/list_event_types_response.py | 4 +- .../list_gift_card_activities_response.py | 4 +- .../requests/list_gift_cards_response.py | 4 +- src/square/requests/list_invoices_response.py | 6 +- src/square/requests/list_jobs_response.py | 6 +- ...list_location_booking_profiles_response.py | 6 +- ...n_custom_attribute_definitions_response.py | 4 +- ...ist_location_custom_attributes_response.py | 4 +- .../requests/list_locations_response.py | 4 +- .../list_loyalty_programs_response.py | 4 +- .../list_loyalty_promotions_response.py | 4 +- ...t_custom_attribute_definitions_response.py | 4 +- ...ist_merchant_custom_attributes_response.py | 4 +- .../requests/list_merchants_response.py | 4 +- ...r_custom_attribute_definitions_response.py | 4 +- .../list_order_custom_attributes_response.py | 4 +- .../requests/list_payment_links_response.py | 4 +- .../requests/list_payment_refunds_response.py | 4 +- src/square/requests/list_payments_response.py | 4 +- .../requests/list_payout_entries_response.py | 6 +- src/square/requests/list_payouts_response.py | 6 +- src/square/requests/list_sites_response.py | 4 +- .../list_subscription_events_response.py | 4 +- ...t_team_member_booking_profiles_response.py | 6 +- .../list_team_member_wages_response.py | 6 +- .../requests/list_transactions_response.py | 4 +- .../list_webhook_event_types_response.py | 4 +- .../list_webhook_subscriptions_response.py | 4 +- .../list_workweek_configs_response.py | 6 +- src/square/requests/location.py | 10 +- .../requests/location_booking_profile.py | 4 +- src/square/requests/location_created_event.py | 4 +- .../requests/location_created_event_data.py | 4 +- ...ttribute_definition_owned_created_event.py | 4 +- ...ttribute_definition_owned_deleted_event.py | 4 +- ...ttribute_definition_owned_updated_event.py | 4 +- ...ribute_definition_visible_created_event.py | 4 +- ...ribute_definition_visible_deleted_event.py | 4 +- ...ribute_definition_visible_updated_event.py | 4 +- ...on_custom_attribute_owned_deleted_event.py | 4 +- ...on_custom_attribute_owned_updated_event.py | 4 +- ..._custom_attribute_visible_deleted_event.py | 4 +- ..._custom_attribute_visible_updated_event.py | 4 +- .../location_settings_updated_event.py | 4 +- .../location_settings_updated_event_data.py | 4 +- .../location_settings_updated_event_object.py | 1 + src/square/requests/location_updated_event.py | 4 +- .../requests/location_updated_event_data.py | 4 +- src/square/requests/loyalty_account.py | 13 +- .../requests/loyalty_account_created_event.py | 4 +- .../loyalty_account_created_event_data.py | 4 +- .../loyalty_account_created_event_object.py | 1 + .../requests/loyalty_account_deleted_event.py | 4 +- .../loyalty_account_deleted_event_data.py | 4 +- .../loyalty_account_deleted_event_object.py | 1 + .../requests/loyalty_account_mapping.py | 4 +- .../requests/loyalty_account_updated_event.py | 4 +- .../loyalty_account_updated_event_data.py | 4 +- .../loyalty_account_updated_event_object.py | 1 + src/square/requests/loyalty_event.py | 9 +- .../loyalty_event_accumulate_points.py | 4 +- ...yalty_event_accumulate_promotion_points.py | 1 + .../requests/loyalty_event_adjust_points.py | 4 +- .../requests/loyalty_event_create_reward.py | 1 + .../requests/loyalty_event_created_event.py | 4 +- .../loyalty_event_created_event_data.py | 4 +- .../loyalty_event_created_event_object.py | 1 + .../requests/loyalty_event_delete_reward.py | 1 + .../requests/loyalty_event_expire_points.py | 1 + src/square/requests/loyalty_event_filter.py | 5 +- .../requests/loyalty_event_location_filter.py | 3 +- src/square/requests/loyalty_event_other.py | 1 + src/square/requests/loyalty_event_query.py | 1 + .../requests/loyalty_event_redeem_reward.py | 1 + .../requests/loyalty_event_type_filter.py | 3 +- src/square/requests/loyalty_program.py | 8 +- .../requests/loyalty_program_accrual_rule.py | 10 +- ...loyalty_program_accrual_rule_spend_data.py | 6 +- ...loyalty_program_accrual_rule_visit_data.py | 3 +- .../requests/loyalty_program_created_event.py | 4 +- .../loyalty_program_created_event_data.py | 4 +- .../loyalty_program_created_event_object.py | 1 + .../requests/loyalty_program_reward_tier.py | 1 + .../requests/loyalty_program_updated_event.py | 4 +- .../loyalty_program_updated_event_data.py | 4 +- .../loyalty_program_updated_event_object.py | 1 + src/square/requests/loyalty_promotion.py | 8 +- .../loyalty_promotion_available_time_data.py | 4 +- .../loyalty_promotion_created_event.py | 4 +- .../loyalty_promotion_created_event_data.py | 4 +- .../loyalty_promotion_created_event_object.py | 1 + .../requests/loyalty_promotion_incentive.py | 3 +- ...motion_incentive_points_multiplier_data.py | 4 +- .../loyalty_promotion_trigger_limit.py | 1 + .../loyalty_promotion_updated_event.py | 4 +- .../loyalty_promotion_updated_event_data.py | 4 +- .../loyalty_promotion_updated_event_object.py | 1 + src/square/requests/loyalty_reward.py | 4 +- src/square/requests/measurement_unit.py | 9 +- src/square/requests/merchant.py | 4 +- ...ttribute_definition_owned_created_event.py | 4 +- ...ttribute_definition_owned_deleted_event.py | 4 +- ...ttribute_definition_owned_updated_event.py | 4 +- ...ribute_definition_visible_created_event.py | 4 +- ...ribute_definition_visible_deleted_event.py | 4 +- ...ribute_definition_visible_updated_event.py | 4 +- ...nt_custom_attribute_owned_deleted_event.py | 4 +- ...nt_custom_attribute_owned_updated_event.py | 4 +- ..._custom_attribute_visible_deleted_event.py | 4 +- ..._custom_attribute_visible_updated_event.py | 4 +- .../merchant_settings_updated_event.py | 4 +- .../merchant_settings_updated_event_data.py | 4 +- .../merchant_settings_updated_event_object.py | 1 + .../requests/modifier_location_overrides.py | 4 +- src/square/requests/money.py | 4 +- .../oauth_authorization_revoked_event.py | 4 +- .../oauth_authorization_revoked_event_data.py | 4 +- ...auth_authorization_revoked_event_object.py | 1 + ...ization_revoked_event_revocation_object.py | 4 +- src/square/requests/obtain_token_response.py | 4 +- .../requests/offline_payment_details.py | 1 + src/square/requests/order.py | 24 +- src/square/requests/order_created.py | 4 +- src/square/requests/order_created_event.py | 4 +- .../requests/order_created_event_data.py | 4 +- src/square/requests/order_created_object.py | 1 + ...ttribute_definition_owned_created_event.py | 4 +- ...ttribute_definition_owned_deleted_event.py | 4 +- ...ttribute_definition_owned_updated_event.py | 4 +- ...ribute_definition_visible_created_event.py | 4 +- ...ribute_definition_visible_deleted_event.py | 4 +- ...ribute_definition_visible_updated_event.py | 4 +- ...er_custom_attribute_owned_deleted_event.py | 4 +- ...er_custom_attribute_owned_updated_event.py | 4 +- ..._custom_attribute_visible_deleted_event.py | 4 +- ..._custom_attribute_visible_updated_event.py | 4 +- src/square/requests/order_entry.py | 4 +- .../requests/order_fulfillment_updated.py | 4 +- .../order_fulfillment_updated_event.py | 4 +- .../order_fulfillment_updated_event_data.py | 4 +- .../order_fulfillment_updated_object.py | 1 + .../order_fulfillment_updated_update.py | 4 +- src/square/requests/order_line_item.py | 12 +- .../order_line_item_applied_discount.py | 4 +- .../order_line_item_applied_service_charge.py | 4 +- .../requests/order_line_item_applied_tax.py | 4 +- .../requests/order_line_item_discount.py | 6 +- .../requests/order_line_item_modifier.py | 4 +- .../order_line_item_pricing_blocklists.py | 4 +- ...tem_pricing_blocklists_blocked_discount.py | 4 +- ...ine_item_pricing_blocklists_blocked_tax.py | 4 +- src/square/requests/order_line_item_tax.py | 6 +- src/square/requests/order_money_amounts.py | 1 + src/square/requests/order_pricing_options.py | 4 +- src/square/requests/order_quantity_unit.py | 4 +- src/square/requests/order_return.py | 8 +- src/square/requests/order_return_discount.py | 6 +- src/square/requests/order_return_line_item.py | 12 +- .../order_return_line_item_modifier.py | 4 +- .../requests/order_return_service_charge.py | 10 +- src/square/requests/order_return_tax.py | 6 +- src/square/requests/order_return_tip.py | 4 +- .../requests/order_rounding_adjustment.py | 4 +- src/square/requests/order_service_charge.py | 12 +- src/square/requests/order_source.py | 4 +- src/square/requests/order_updated.py | 4 +- src/square/requests/order_updated_event.py | 4 +- .../requests/order_updated_event_data.py | 4 +- src/square/requests/order_updated_object.py | 1 + .../requests/pause_subscription_response.py | 4 +- src/square/requests/pay_order_response.py | 4 +- src/square/requests/payment.py | 28 +- ..._balance_activity_app_fee_refund_detail.py | 4 +- ...balance_activity_app_fee_revenue_detail.py | 4 +- ...lance_activity_automatic_savings_detail.py | 4 +- ...ivity_automatic_savings_reversed_detail.py | 4 +- .../payment_balance_activity_charge_detail.py | 4 +- ...ent_balance_activity_deposit_fee_detail.py | 4 +- ...ce_activity_deposit_fee_reversed_detail.py | 4 +- ...payment_balance_activity_dispute_detail.py | 4 +- .../payment_balance_activity_fee_detail.py | 4 +- ...balance_activity_free_processing_detail.py | 4 +- ...balance_activity_hold_adjustment_detail.py | 4 +- ...nt_balance_activity_open_dispute_detail.py | 4 +- ...alance_activity_other_adjustment_detail.py | 4 +- .../payment_balance_activity_other_detail.py | 4 +- .../payment_balance_activity_refund_detail.py | 4 +- ...ance_activity_release_adjustment_detail.py | 4 +- ...nt_balance_activity_reserve_hold_detail.py | 4 +- ...balance_activity_reserve_release_detail.py | 4 +- ..._activity_square_capital_payment_detail.py | 4 +- ..._square_capital_reversed_payment_detail.py | 4 +- ...activity_square_payroll_transfer_detail.py | 4 +- ...square_payroll_transfer_reversed_detail.py | 4 +- ...ment_balance_activity_tax_on_fee_detail.py | 4 +- ...balance_activity_third_party_fee_detail.py | 4 +- ..._activity_third_party_fee_refund_detail.py | 4 +- src/square/requests/payment_created_event.py | 4 +- .../requests/payment_created_event_data.py | 4 +- .../requests/payment_created_event_object.py | 1 + src/square/requests/payment_link.py | 4 +- .../payment_link_related_resources.py | 6 +- src/square/requests/payment_options.py | 4 +- src/square/requests/payment_refund.py | 4 +- src/square/requests/payment_updated_event.py | 4 +- .../requests/payment_updated_event_data.py | 4 +- .../requests/payment_updated_event_object.py | 1 + src/square/requests/payout.py | 8 +- src/square/requests/payout_entry.py | 18 +- src/square/requests/payout_failed_event.py | 4 +- .../requests/payout_failed_event_data.py | 4 +- .../requests/payout_failed_event_object.py | 1 + src/square/requests/payout_fee.py | 6 +- src/square/requests/payout_paid_event.py | 4 +- src/square/requests/payout_paid_event_data.py | 4 +- .../requests/payout_paid_event_object.py | 1 + src/square/requests/payout_sent_event.py | 4 +- src/square/requests/payout_sent_event_data.py | 4 +- .../requests/payout_sent_event_object.py | 1 + src/square/requests/phase.py | 4 +- src/square/requests/phase_input.py | 4 +- src/square/requests/pre_populated_data.py | 4 +- src/square/requests/processing_fee.py | 4 +- .../requests/publish_invoice_response.py | 6 +- .../publish_scheduled_shift_response.py | 6 +- src/square/requests/range.py | 4 +- src/square/requests/receipt_options.py | 4 +- .../receive_transfer_order_response.py | 23 - .../redeem_loyalty_reward_response.py | 4 +- src/square/requests/reference.py | 17 - src/square/requests/refund.py | 6 +- src/square/requests/refund_created_event.py | 4 +- .../requests/refund_created_event_data.py | 4 +- .../requests/refund_created_event_object.py | 1 + .../requests/refund_payment_response.py | 4 +- src/square/requests/refund_updated_event.py | 4 +- .../requests/refund_updated_event_data.py | 4 +- .../requests/refund_updated_event_object.py | 1 + .../requests/register_domain_response.py | 6 +- .../remove_group_from_customer_response.py | 4 +- .../requests/resume_subscription_response.py | 4 +- ...ng_custom_attribute_definition_response.py | 4 +- ...rieve_booking_custom_attribute_response.py | 4 +- .../requests/retrieve_channel_response.py | 19 - src/square/requests/retrieve_job_response.py | 6 +- ...rieve_location_booking_profile_response.py | 6 +- ...on_custom_attribute_definition_response.py | 4 +- ...ieve_location_custom_attribute_response.py | 4 +- .../retrieve_location_settings_response.py | 6 +- ...nt_custom_attribute_definition_response.py | 4 +- ...ieve_merchant_custom_attribute_response.py | 4 +- .../retrieve_merchant_settings_response.py | 6 +- ...er_custom_attribute_definition_response.py | 4 +- ...etrieve_order_custom_attribute_response.py | 4 +- .../retrieve_scheduled_shift_response.py | 6 +- .../requests/retrieve_timecard_response.py | 6 +- .../retrieve_token_status_response.py | 4 +- .../retrieve_transfer_order_response.py | 23 - src/square/requests/revoke_token_response.py | 4 +- src/square/requests/risk_evaluation.py | 1 + src/square/requests/save_card_options.py | 4 +- src/square/requests/scheduled_shift.py | 1 + .../requests/scheduled_shift_details.py | 4 +- src/square/requests/scheduled_shift_filter.py | 8 +- src/square/requests/scheduled_shift_query.py | 1 + src/square/requests/scheduled_shift_sort.py | 1 + .../requests/scheduled_shift_workday.py | 6 +- .../requests/search_availability_filter.py | 6 +- .../requests/search_availability_response.py | 4 +- .../requests/search_catalog_items_response.py | 6 +- .../search_catalog_objects_response.py | 6 +- .../requests/search_customers_response.py | 6 +- src/square/requests/search_events_filter.py | 4 +- src/square/requests/search_events_query.py | 1 + src/square/requests/search_events_response.py | 4 +- src/square/requests/search_events_sort.py | 1 + .../requests/search_invoices_response.py | 6 +- ..._accounts_request_loyalty_account_query.py | 4 +- .../search_loyalty_accounts_response.py | 4 +- .../search_loyalty_events_response.py | 4 +- ...ty_rewards_request_loyalty_reward_query.py | 1 + .../search_loyalty_rewards_response.py | 4 +- .../requests/search_orders_customer_filter.py | 4 +- .../search_orders_date_time_filter.py | 1 + src/square/requests/search_orders_filter.py | 5 +- .../search_orders_fulfillment_filter.py | 6 +- src/square/requests/search_orders_query.py | 1 + src/square/requests/search_orders_response.py | 8 +- src/square/requests/search_orders_sort.py | 1 + .../requests/search_orders_source_filter.py | 4 +- .../requests/search_orders_state_filter.py | 3 +- .../search_scheduled_shifts_response.py | 6 +- src/square/requests/search_shifts_response.py | 6 +- .../requests/search_subscriptions_filter.py | 4 +- .../requests/search_subscriptions_query.py | 1 + .../requests/search_subscriptions_response.py | 4 +- .../requests/search_team_members_filter.py | 4 +- .../requests/search_team_members_query.py | 1 + .../requests/search_team_members_response.py | 6 +- .../search_terminal_actions_response.py | 4 +- .../search_terminal_checkouts_response.py | 4 +- .../search_terminal_refunds_response.py | 4 +- .../requests/search_timecards_response.py | 6 +- .../search_transfer_orders_response.py | 28 - .../requests/search_vendors_request_filter.py | 4 +- .../requests/search_vendors_request_sort.py | 1 + .../requests/search_vendors_response.py | 4 +- src/square/requests/segment_filter.py | 1 + src/square/requests/select_options.py | 4 +- src/square/requests/shift.py | 8 +- src/square/requests/shift_filter.py | 6 +- src/square/requests/shift_query.py | 1 + src/square/requests/shift_sort.py | 1 + src/square/requests/shift_wage.py | 4 +- src/square/requests/shift_workday.py | 6 +- src/square/requests/shipping_fee.py | 4 +- src/square/requests/signature_image.py | 1 + src/square/requests/signature_options.py | 4 +- src/square/requests/site.py | 4 +- src/square/requests/snippet.py | 1 + src/square/requests/source_application.py | 4 +- src/square/requests/square_account_details.py | 4 +- .../requests/standard_unit_description.py | 4 +- .../standard_unit_description_group.py | 4 +- .../requests/start_transfer_order_response.py | 23 - .../requests/submit_evidence_response.py | 6 +- src/square/requests/subscription.py | 13 +- src/square/requests/subscription_action.py | 4 +- .../requests/subscription_created_event.py | 4 +- .../subscription_created_event_data.py | 4 +- .../subscription_created_event_object.py | 1 + src/square/requests/subscription_event.py | 6 +- .../requests/subscription_event_info.py | 4 +- src/square/requests/subscription_phase.py | 4 +- src/square/requests/subscription_pricing.py | 4 +- src/square/requests/subscription_source.py | 4 +- .../requests/subscription_test_result.py | 4 +- .../requests/subscription_updated_event.py | 4 +- .../subscription_updated_event_data.py | 4 +- .../subscription_updated_event_object.py | 1 + src/square/requests/swap_plan_response.py | 4 +- src/square/requests/tax_ids.py | 1 + src/square/requests/team_member.py | 4 +- .../team_member_assigned_locations.py | 4 +- .../requests/team_member_booking_profile.py | 4 +- .../requests/team_member_created_event.py | 4 +- .../team_member_created_event_data.py | 4 +- .../team_member_created_event_object.py | 1 + .../requests/team_member_updated_event.py | 4 +- .../team_member_updated_event_data.py | 4 +- .../team_member_updated_event_object.py | 1 + src/square/requests/team_member_wage.py | 4 +- .../team_member_wage_setting_updated_event.py | 4 +- ..._member_wage_setting_updated_event_data.py | 4 +- ...ember_wage_setting_updated_event_object.py | 1 + src/square/requests/tender.py | 12 +- .../requests/tender_bank_account_details.py | 1 + .../tender_buy_now_pay_later_details.py | 1 + src/square/requests/tender_card_details.py | 3 +- src/square/requests/tender_cash_details.py | 1 + .../requests/tender_square_account_details.py | 1 + src/square/requests/terminal_action.py | 14 +- .../requests/terminal_action_created_event.py | 4 +- .../terminal_action_created_event_data.py | 4 +- .../terminal_action_created_event_object.py | 1 + src/square/requests/terminal_action_query.py | 1 + .../requests/terminal_action_query_filter.py | 6 +- .../requests/terminal_action_query_sort.py | 1 + .../requests/terminal_action_updated_event.py | 4 +- .../terminal_action_updated_event_data.py | 4 +- .../terminal_action_updated_event_object.py | 1 + src/square/requests/terminal_checkout.py | 10 +- .../terminal_checkout_created_event.py | 4 +- .../terminal_checkout_created_event_data.py | 4 +- .../terminal_checkout_created_event_object.py | 1 + .../requests/terminal_checkout_query.py | 1 + .../terminal_checkout_query_filter.py | 4 +- .../requests/terminal_checkout_query_sort.py | 1 + .../terminal_checkout_updated_event.py | 4 +- .../terminal_checkout_updated_event_data.py | 4 +- .../terminal_checkout_updated_event_object.py | 1 + src/square/requests/terminal_refund.py | 6 +- .../requests/terminal_refund_created_event.py | 4 +- .../terminal_refund_created_event_data.py | 4 +- .../terminal_refund_created_event_object.py | 1 + src/square/requests/terminal_refund_query.py | 1 + .../requests/terminal_refund_query_filter.py | 4 +- .../requests/terminal_refund_query_sort.py | 4 +- .../requests/terminal_refund_updated_event.py | 4 +- .../terminal_refund_updated_event_data.py | 4 +- .../terminal_refund_updated_event_object.py | 1 + .../test_webhook_subscription_response.py | 4 +- src/square/requests/time_range.py | 4 +- src/square/requests/timecard.py | 8 +- src/square/requests/timecard_filter.py | 4 +- src/square/requests/timecard_query.py | 1 + src/square/requests/timecard_sort.py | 3 +- src/square/requests/timecard_wage.py | 4 +- src/square/requests/timecard_workday.py | 6 +- src/square/requests/tip_settings.py | 4 +- src/square/requests/transaction.py | 8 +- src/square/requests/transfer_order.py | 131 -- .../requests/transfer_order_created_event.py | 37 - .../transfer_order_created_event_data.py | 23 - .../transfer_order_created_event_object.py | 11 - .../requests/transfer_order_deleted_event.py | 37 - .../transfer_order_deleted_event_data.py | 22 - src/square/requests/transfer_order_filter.py | 28 - .../requests/transfer_order_goods_receipt.py | 44 - .../transfer_order_goods_receipt_line_item.py | 33 - src/square/requests/transfer_order_line.py | 57 - src/square/requests/transfer_order_query.py | 21 - src/square/requests/transfer_order_sort.py | 23 - .../requests/transfer_order_updated_event.py | 37 - .../transfer_order_updated_event_data.py | 23 - .../transfer_order_updated_event_object.py | 11 - ...unlink_customer_from_gift_card_response.py | 4 +- ...ng_custom_attribute_definition_response.py | 4 +- .../requests/update_booking_response.py | 4 +- .../requests/update_break_type_response.py | 4 +- .../requests/update_catalog_image_response.py | 6 +- ...er_custom_attribute_definition_response.py | 4 +- .../update_customer_group_response.py | 6 +- .../requests/update_customer_response.py | 6 +- .../requests/update_invoice_response.py | 6 +- .../update_item_modifier_lists_response.py | 4 +- .../requests/update_item_taxes_response.py | 4 +- src/square/requests/update_job_response.py | 6 +- ...on_custom_attribute_definition_response.py | 4 +- .../requests/update_location_response.py | 4 +- .../update_location_settings_response.py | 6 +- ...nt_custom_attribute_definition_response.py | 4 +- .../update_merchant_settings_response.py | 6 +- ...er_custom_attribute_definition_response.py | 4 +- src/square/requests/update_order_response.py | 6 +- .../requests/update_payment_link_response.py | 4 +- .../requests/update_payment_response.py | 4 +- .../update_scheduled_shift_response.py | 6 +- src/square/requests/update_shift_response.py | 6 +- .../requests/update_subscription_response.py | 4 +- .../requests/update_team_member_request.py | 1 + .../requests/update_team_member_response.py | 6 +- .../requests/update_timecard_response.py | 6 +- .../requests/update_transfer_order_data.py | 44 - .../update_transfer_order_line_data.py | 33 - .../update_transfer_order_response.py | 23 - src/square/requests/update_vendor_request.py | 4 +- src/square/requests/update_vendor_response.py | 4 +- .../requests/update_wage_setting_response.py | 6 +- .../update_webhook_subscription_response.py | 4 +- ...ook_subscription_signature_key_response.py | 4 +- .../update_workweek_config_response.py | 6 +- ...psert_booking_custom_attribute_response.py | 4 +- .../upsert_catalog_object_response.py | 8 +- ...sert_customer_custom_attribute_response.py | 4 +- ...sert_location_custom_attribute_response.py | 4 +- ...sert_merchant_custom_attribute_response.py | 4 +- .../upsert_order_custom_attribute_response.py | 4 +- .../requests/upsert_snippet_response.py | 4 +- src/square/requests/v1money.py | 4 +- src/square/requests/v1order.py | 8 +- src/square/requests/v1order_history_entry.py | 1 + src/square/requests/v1tender.py | 6 +- src/square/requests/vendor.py | 6 +- src/square/requests/vendor_contact.py | 4 +- src/square/requests/vendor_created_event.py | 4 +- .../requests/vendor_created_event_data.py | 4 +- .../requests/vendor_created_event_object.py | 1 + src/square/requests/vendor_updated_event.py | 4 +- .../requests/vendor_updated_event_data.py | 4 +- .../requests/vendor_updated_event_object.py | 1 + .../requests/void_transaction_response.py | 4 +- src/square/requests/wage_setting.py | 4 +- src/square/requests/webhook_subscription.py | 4 +- src/square/requests/workweek_config.py | 1 + src/square/sites/__init__.py | 2 - src/square/sites/client.py | 15 +- src/square/sites/raw_client.py | 21 +- src/square/snippets/__init__.py | 2 - src/square/snippets/client.py | 35 +- src/square/snippets/raw_client.py | 43 +- src/square/subscriptions/__init__.py | 2 - src/square/subscriptions/client.py | 205 ++- src/square/subscriptions/raw_client.py | 269 +--- src/square/team/__init__.py | 2 - src/square/team/client.py | 41 +- src/square/team/raw_client.py | 49 +- src/square/team_members/__init__.py | 31 +- src/square/team_members/client.py | 93 +- src/square/team_members/raw_client.py | 83 +- .../team_members/wage_setting/__init__.py | 2 - .../team_members/wage_setting/client.py | 25 +- .../team_members/wage_setting/raw_client.py | 33 +- src/square/terminal/__init__.py | 31 +- src/square/terminal/actions/__init__.py | 2 - src/square/terminal/actions/client.py | 47 +- src/square/terminal/actions/raw_client.py | 53 +- src/square/terminal/checkouts/__init__.py | 2 - src/square/terminal/checkouts/client.py | 47 +- src/square/terminal/checkouts/raw_client.py | 53 +- src/square/terminal/client.py | 110 +- src/square/terminal/raw_client.py | 39 +- src/square/terminal/refunds/__init__.py | 2 - src/square/terminal/refunds/client.py | 47 +- src/square/terminal/refunds/raw_client.py | 53 +- src/square/transfer_orders/__init__.py | 4 - src/square/transfer_orders/client.py | 1123 ---------------- src/square/transfer_orders/raw_client.py | 1106 ---------------- src/square/types/__init__.py | 2 - src/square/types/accept_dispute_response.py | 7 +- src/square/types/accepted_payment_methods.py | 3 +- .../accumulate_loyalty_points_response.py | 7 +- src/square/types/ach_details.py | 3 +- .../types/add_group_to_customer_response.py | 5 +- src/square/types/additional_recipient.py | 7 +- src/square/types/address.py | 9 +- .../types/adjust_loyalty_points_response.py | 7 +- src/square/types/afterpay_details.py | 3 +- src/square/types/application_details.py | 5 +- src/square/types/appointment_segment.py | 3 +- src/square/types/availability.py | 5 +- src/square/types/bank_account.py | 11 +- .../types/bank_account_created_event.py | 5 +- .../types/bank_account_created_event_data.py | 5 +- .../bank_account_created_event_object.py | 5 +- .../types/bank_account_disabled_event.py | 5 +- .../types/bank_account_disabled_event_data.py | 5 +- .../bank_account_disabled_event_object.py | 5 +- .../types/bank_account_payment_details.py | 5 +- .../types/bank_account_verified_event.py | 5 +- .../types/bank_account_verified_event_data.py | 5 +- .../bank_account_verified_event_object.py | 5 +- .../types/batch_change_inventory_request.py | 7 +- .../types/batch_change_inventory_response.py | 9 +- .../batch_create_team_members_response.py | 7 +- .../types/batch_create_vendors_response.py | 7 +- .../batch_delete_catalog_objects_response.py | 5 +- .../batch_get_catalog_objects_response.py | 39 +- .../batch_get_inventory_changes_response.py | 7 +- .../batch_get_inventory_counts_request.py | 5 +- .../batch_get_inventory_counts_response.py | 7 +- src/square/types/batch_get_orders_response.py | 7 +- .../types/batch_get_vendors_response.py | 7 +- ...atch_retrieve_inventory_changes_request.py | 5 +- .../batch_update_team_members_response.py | 7 +- .../types/batch_update_vendors_response.py | 7 +- .../batch_upsert_catalog_objects_response.py | 37 +- ...ustomer_custom_attribute_upsert_request.py | 7 +- ...ert_customer_custom_attributes_response.py | 7 +- ...stomer_custom_attribute_upsert_response.py | 5 +- src/square/types/booking.py | 13 +- src/square/types/booking_created_event.py | 5 +- .../types/booking_created_event_data.py | 5 +- .../types/booking_created_event_object.py | 5 +- src/square/types/booking_creator_details.py | 5 +- ...ttribute_definition_owned_created_event.py | 5 +- ...ttribute_definition_owned_deleted_event.py | 5 +- ...ttribute_definition_owned_updated_event.py | 5 +- ...ribute_definition_visible_created_event.py | 5 +- ...ribute_definition_visible_deleted_event.py | 5 +- ...ribute_definition_visible_updated_event.py | 5 +- ...booking_custom_attribute_delete_request.py | 5 +- ...ooking_custom_attribute_delete_response.py | 5 +- ...ng_custom_attribute_owned_deleted_event.py | 5 +- ...ng_custom_attribute_owned_updated_event.py | 5 +- ...booking_custom_attribute_upsert_request.py | 7 +- ...ooking_custom_attribute_upsert_response.py | 5 +- ..._custom_attribute_visible_deleted_event.py | 5 +- ..._custom_attribute_visible_updated_event.py | 5 +- src/square/types/booking_updated_event.py | 5 +- .../types/booking_updated_event_data.py | 5 +- .../types/booking_updated_event_object.py | 5 +- src/square/types/break_.py | 3 +- src/square/types/break_type.py | 3 +- src/square/types/bulk_create_customer_data.py | 5 +- .../types/bulk_create_customers_response.py | 7 +- ...lete_booking_custom_attributes_response.py | 7 +- .../types/bulk_delete_customers_response.py | 7 +- ...ocation_custom_attribute_delete_request.py | 3 +- ...ete_location_custom_attributes_response.py | 7 +- ...cation_custom_attribute_delete_response.py | 5 +- ...erchant_custom_attribute_delete_request.py | 3 +- ...ete_merchant_custom_attributes_response.py | 7 +- ...rchant_custom_attribute_delete_response.py | 5 +- ...ributes_request_delete_custom_attribute.py | 3 +- ...delete_order_custom_attributes_response.py | 7 +- .../bulk_publish_scheduled_shifts_data.py | 3 +- .../bulk_publish_scheduled_shifts_response.py | 7 +- .../types/bulk_retrieve_bookings_response.py | 7 +- ...ulk_retrieve_channels_request_constants.py | 5 - .../types/bulk_retrieve_channels_response.py | 38 - .../types/bulk_retrieve_customers_response.py | 7 +- ...e_team_member_booking_profiles_response.py | 7 +- src/square/types/bulk_swap_plan_response.py | 5 +- src/square/types/bulk_update_customer_data.py | 5 +- .../types/bulk_update_customers_response.py | 7 +- ...sert_booking_custom_attributes_response.py | 7 +- ...ocation_custom_attribute_upsert_request.py | 7 +- ...ert_location_custom_attributes_response.py | 7 +- ...cation_custom_attribute_upsert_response.py | 5 +- ...erchant_custom_attribute_upsert_request.py | 7 +- ...ert_merchant_custom_attributes_response.py | 7 +- ...rchant_custom_attribute_upsert_response.py | 5 +- ...ributes_request_upsert_custom_attribute.py | 7 +- ...upsert_order_custom_attributes_response.py | 7 +- .../types/business_appointment_settings.py | 9 +- src/square/types/business_booking_profile.py | 9 +- src/square/types/business_hours.py | 5 +- src/square/types/business_hours_period.py | 5 +- src/square/types/buy_now_pay_later_details.py | 5 +- .../calculate_loyalty_points_response.py | 5 +- src/square/types/calculate_order_response.py | 7 +- src/square/types/cancel_booking_response.py | 7 +- src/square/types/cancel_invoice_response.py | 7 +- .../cancel_loyalty_promotion_response.py | 7 +- ...cel_payment_by_idempotency_key_response.py | 5 +- src/square/types/cancel_payment_response.py | 7 +- .../types/cancel_subscription_response.py | 7 +- .../types/cancel_terminal_action_response.py | 7 +- .../cancel_terminal_checkout_response.py | 7 +- .../types/cancel_terminal_refund_response.py | 7 +- .../types/cancel_transfer_order_response.py | 34 - .../types/capture_transaction_response.py | 5 +- src/square/types/card.py | 11 +- .../types/card_automatically_updated_event.py | 5 +- .../card_automatically_updated_event_data.py | 5 +- ...card_automatically_updated_event_object.py | 5 +- src/square/types/card_created_event.py | 5 +- src/square/types/card_created_event_data.py | 5 +- src/square/types/card_created_event_object.py | 5 +- src/square/types/card_disabled_event.py | 5 +- src/square/types/card_disabled_event_data.py | 5 +- .../types/card_disabled_event_object.py | 5 +- src/square/types/card_forgotten_event.py | 5 +- src/square/types/card_forgotten_event_card.py | 3 +- src/square/types/card_forgotten_event_data.py | 5 +- .../types/card_forgotten_event_object.py | 5 +- src/square/types/card_payment_details.py | 7 +- src/square/types/card_payment_timeline.py | 3 +- src/square/types/card_updated_event.py | 5 +- src/square/types/card_updated_event_data.py | 5 +- src/square/types/card_updated_event_object.py | 5 +- src/square/types/cash_app_details.py | 3 +- src/square/types/cash_drawer_device.py | 3 +- src/square/types/cash_drawer_shift.py | 7 +- src/square/types/cash_drawer_shift_event.py | 5 +- src/square/types/cash_drawer_shift_summary.py | 5 +- src/square/types/cash_payment_details.py | 7 +- .../types/catalog_availability_period.py | 5 +- src/square/types/catalog_category.py | 9 +- .../catalog_custom_attribute_definition.py | 17 +- ...stom_attribute_definition_number_config.py | 3 +- ...m_attribute_definition_selection_config.py | 5 +- ...ction_config_custom_attribute_selection.py | 3 +- ...stom_attribute_definition_string_config.py | 3 +- .../types/catalog_custom_attribute_value.py | 5 +- src/square/types/catalog_discount.py | 7 +- src/square/types/catalog_ecom_seo_data.py | 3 +- src/square/types/catalog_id_mapping.py | 3 +- src/square/types/catalog_image.py | 3 +- src/square/types/catalog_info_response.py | 7 +- .../types/catalog_info_response_limits.py | 3 +- src/square/types/catalog_item.py | 43 +- .../catalog_item_food_and_beverage_details.py | 5 +- ...and_beverage_details_dietary_preference.py | 11 +- ...em_food_and_beverage_details_ingredient.py | 7 +- .../types/catalog_item_modifier_list_info.py | 13 +- src/square/types/catalog_item_option.py | 30 +- .../types/catalog_item_option_for_item.py | 3 +- src/square/types/catalog_item_option_value.py | 3 +- ...og_item_option_value_for_item_variation.py | 3 +- src/square/types/catalog_item_variation.py | 13 +- src/square/types/catalog_measurement_unit.py | 5 +- src/square/types/catalog_modifier.py | 7 +- src/square/types/catalog_modifier_list.py | 32 +- src/square/types/catalog_modifier_override.py | 9 +- src/square/types/catalog_object.py | 852 +++++++++++- .../catalog_object_availability_period.py | 96 +- src/square/types/catalog_object_base.py | 19 +- src/square/types/catalog_object_batch.py | 35 +- src/square/types/catalog_object_category.py | 15 +- ...alog_object_custom_attribute_definition.py | 96 +- src/square/types/catalog_object_discount.py | 96 +- src/square/types/catalog_object_image.py | 96 +- src/square/types/catalog_object_item.py | 108 +- .../types/catalog_object_item_option.py | 108 +- .../types/catalog_object_item_option_value.py | 96 +- .../types/catalog_object_item_variation.py | 96 +- .../types/catalog_object_measurement_unit.py | 96 +- src/square/types/catalog_object_modifier.py | 96 +- .../types/catalog_object_modifier_list.py | 108 +- .../types/catalog_object_pricing_rule.py | 96 +- .../types/catalog_object_product_set.py | 96 +- .../catalog_object_quick_amounts_settings.py | 96 +- src/square/types/catalog_object_reference.py | 3 +- .../types/catalog_object_subscription_plan.py | 108 +- ...alog_object_subscription_plan_variation.py | 96 +- src/square/types/catalog_object_tax.py | 96 +- .../types/catalog_object_time_period.py | 96 +- src/square/types/catalog_pricing_rule.py | 5 +- src/square/types/catalog_product_set.py | 3 +- src/square/types/catalog_query.py | 17 +- src/square/types/catalog_query_exact.py | 5 +- ..._item_variations_for_item_option_values.py | 3 +- .../catalog_query_items_for_item_options.py | 3 +- .../catalog_query_items_for_modifier_list.py | 3 +- .../types/catalog_query_items_for_tax.py | 3 +- src/square/types/catalog_query_prefix.py | 5 +- src/square/types/catalog_query_range.py | 5 +- src/square/types/catalog_query_set.py | 5 +- .../types/catalog_query_sorted_attribute.py | 7 +- src/square/types/catalog_query_text.py | 3 +- src/square/types/catalog_quick_amount.py | 7 +- .../types/catalog_quick_amounts_settings.py | 9 +- src/square/types/catalog_stock_conversion.py | 5 +- src/square/types/catalog_subscription_plan.py | 32 +- .../catalog_subscription_plan_variation.py | 7 +- src/square/types/catalog_tax.py | 5 +- src/square/types/catalog_time_period.py | 3 +- src/square/types/catalog_v1id.py | 7 +- .../types/catalog_version_updated_event.py | 5 +- ...g_version_updated_event_catalog_version.py | 3 +- .../catalog_version_updated_event_data.py | 5 +- .../catalog_version_updated_event_object.py | 5 +- .../types/category_path_to_root_node.py | 3 +- .../change_billing_anchor_date_response.py | 7 +- src/square/types/channel.py | 63 - src/square/types/channel_status.py | 5 - .../charge_request_additional_recipient.py | 7 +- src/square/types/checkout.py | 7 +- .../types/checkout_location_settings.py | 9 +- .../checkout_location_settings_branding.py | 7 +- .../checkout_location_settings_coupons.py | 3 +- .../checkout_location_settings_policy.py | 3 +- .../checkout_location_settings_tipping.py | 5 +- .../types/checkout_merchant_settings.py | 5 +- ...ckout_merchant_settings_payment_methods.py | 13 +- ...tings_payment_methods_afterpay_clearpay.py | 7 +- ...ods_afterpay_clearpay_eligibility_range.py | 7 +- ...settings_payment_methods_payment_method.py | 3 +- src/square/types/checkout_options.py | 7 +- src/square/types/clearpay_details.py | 3 +- src/square/types/clone_order_response.py | 7 +- src/square/types/collected_data.py | 3 +- src/square/types/complete_payment_response.py | 7 +- src/square/types/component.py | 11 +- src/square/types/confirmation_decision.py | 3 +- src/square/types/confirmation_options.py | 7 +- src/square/types/coordinates.py | 3 +- ...ng_custom_attribute_definition_response.py | 7 +- src/square/types/create_booking_response.py | 7 +- .../types/create_break_type_response.py | 7 +- src/square/types/create_card_response.py | 7 +- .../types/create_catalog_image_request.py | 37 +- .../types/create_catalog_image_response.py | 37 +- src/square/types/create_checkout_response.py | 7 +- .../types/create_customer_card_response.py | 7 +- ...er_custom_attribute_definition_response.py | 7 +- .../types/create_customer_group_response.py | 7 +- src/square/types/create_customer_response.py | 7 +- .../types/create_device_code_response.py | 7 +- .../create_dispute_evidence_file_request.py | 7 +- .../create_dispute_evidence_file_response.py | 7 +- .../create_dispute_evidence_text_response.py | 7 +- .../create_gift_card_activity_response.py | 7 +- src/square/types/create_gift_card_response.py | 7 +- .../create_invoice_attachment_request_data.py | 3 +- .../create_invoice_attachment_response.py | 7 +- src/square/types/create_invoice_response.py | 7 +- src/square/types/create_job_response.py | 7 +- ...on_custom_attribute_definition_response.py | 7 +- src/square/types/create_location_response.py | 7 +- .../types/create_loyalty_account_response.py | 7 +- .../create_loyalty_promotion_response.py | 7 +- .../types/create_loyalty_reward_response.py | 7 +- ...nt_custom_attribute_definition_response.py | 7 +- ...eate_mobile_authorization_code_response.py | 5 +- ...er_custom_attribute_definition_response.py | 7 +- src/square/types/create_order_request.py | 5 +- src/square/types/create_order_response.py | 7 +- .../types/create_payment_link_response.py | 22 +- src/square/types/create_payment_response.py | 7 +- .../types/create_scheduled_shift_response.py | 7 +- src/square/types/create_shift_response.py | 7 +- .../types/create_subscription_response.py | 7 +- .../types/create_team_member_request.py | 5 +- .../types/create_team_member_response.py | 7 +- .../types/create_terminal_action_response.py | 7 +- .../create_terminal_checkout_response.py | 7 +- .../types/create_terminal_refund_response.py | 7 +- src/square/types/create_timecard_response.py | 7 +- .../types/create_transfer_order_data.py | 63 - .../types/create_transfer_order_line_data.py | 37 - .../types/create_transfer_order_response.py | 34 - src/square/types/create_vendor_response.py | 7 +- .../create_webhook_subscription_response.py | 7 +- src/square/types/custom_attribute.py | 9 +- .../types/custom_attribute_definition.py | 7 +- .../custom_attribute_definition_event_data.py | 5 +- ..._attribute_definition_event_data_object.py | 5 +- .../types/custom_attribute_event_data.py | 5 +- .../custom_attribute_event_data_object.py | 5 +- src/square/types/custom_attribute_filter.py | 5 +- src/square/types/custom_field.py | 5 +- src/square/types/customer.py | 7 +- src/square/types/customer_address_filter.py | 7 +- src/square/types/customer_created_event.py | 5 +- .../types/customer_created_event_data.py | 5 +- .../customer_created_event_event_context.py | 5 +- ...tomer_created_event_event_context_merge.py | 3 +- .../types/customer_created_event_object.py | 7 +- .../types/customer_creation_source_filter.py | 7 +- ...stom_attribute_definition_created_event.py | 5 +- ...tribute_definition_created_public_event.py | 5 +- ...stom_attribute_definition_deleted_event.py | 5 +- ...tribute_definition_deleted_public_event.py | 5 +- ...ttribute_definition_owned_created_event.py | 5 +- ...ttribute_definition_owned_deleted_event.py | 5 +- ...ttribute_definition_owned_updated_event.py | 5 +- ...stom_attribute_definition_updated_event.py | 5 +- ...tribute_definition_updated_public_event.py | 5 +- ...ribute_definition_visible_created_event.py | 5 +- ...ribute_definition_visible_deleted_event.py | 5 +- ...ribute_definition_visible_updated_event.py | 5 +- ...customer_custom_attribute_deleted_event.py | 5 +- ...r_custom_attribute_deleted_public_event.py | 5 +- .../types/customer_custom_attribute_filter.py | 7 +- .../customer_custom_attribute_filter_value.py | 11 +- .../customer_custom_attribute_filters.py | 5 +- ...er_custom_attribute_owned_deleted_event.py | 5 +- ...er_custom_attribute_owned_updated_event.py | 5 +- ...customer_custom_attribute_updated_event.py | 5 +- ...r_custom_attribute_updated_public_event.py | 5 +- ..._custom_attribute_visible_deleted_event.py | 5 +- ..._custom_attribute_visible_updated_event.py | 5 +- src/square/types/customer_deleted_event.py | 5 +- .../types/customer_deleted_event_data.py | 5 +- .../customer_deleted_event_event_context.py | 5 +- ...tomer_deleted_event_event_context_merge.py | 3 +- .../types/customer_deleted_event_object.py | 7 +- src/square/types/customer_details.py | 3 +- src/square/types/customer_filter.py | 11 +- src/square/types/customer_group.py | 3 +- src/square/types/customer_preferences.py | 3 +- src/square/types/customer_query.py | 7 +- src/square/types/customer_segment.py | 3 +- src/square/types/customer_sort.py | 7 +- src/square/types/customer_tax_ids.py | 3 +- src/square/types/customer_text_filter.py | 3 +- src/square/types/customer_updated_event.py | 5 +- .../types/customer_updated_event_data.py | 5 +- .../types/customer_updated_event_object.py | 5 +- src/square/types/data_collection_options.py | 9 +- src/square/types/date_range.py | 3 +- ...ng_custom_attribute_definition_response.py | 5 +- ...elete_booking_custom_attribute_response.py | 5 +- .../types/delete_break_type_response.py | 5 +- .../types/delete_catalog_object_response.py | 5 +- .../types/delete_customer_card_response.py | 5 +- ...er_custom_attribute_definition_response.py | 5 +- ...lete_customer_custom_attribute_response.py | 5 +- .../types/delete_customer_group_response.py | 5 +- src/square/types/delete_customer_response.py | 5 +- .../types/delete_dispute_evidence_response.py | 5 +- .../delete_invoice_attachment_response.py | 5 +- src/square/types/delete_invoice_response.py | 5 +- ...on_custom_attribute_definition_response.py | 5 +- ...lete_location_custom_attribute_response.py | 5 +- .../types/delete_loyalty_reward_response.py | 5 +- ...nt_custom_attribute_definition_response.py | 5 +- ...lete_merchant_custom_attribute_response.py | 5 +- ...er_custom_attribute_definition_response.py | 5 +- .../delete_order_custom_attribute_response.py | 5 +- .../types/delete_payment_link_response.py | 5 +- src/square/types/delete_shift_response.py | 5 +- src/square/types/delete_snippet_response.py | 5 +- .../delete_subscription_action_response.py | 7 +- src/square/types/delete_timecard_response.py | 5 +- .../types/delete_transfer_order_response.py | 28 - .../delete_webhook_subscription_response.py | 5 +- src/square/types/destination.py | 5 +- src/square/types/destination_details.py | 7 +- ...destination_details_card_refund_details.py | 5 +- ...destination_details_cash_refund_details.py | 7 +- ...ination_details_external_refund_details.py | 7 +- src/square/types/device.py | 7 +- src/square/types/device_attributes.py | 9 +- .../types/device_attributes_device_type.py | 2 +- src/square/types/device_checkout_options.py | 7 +- src/square/types/device_code.py | 7 +- src/square/types/device_code_paired_event.py | 5 +- .../types/device_code_paired_event_data.py | 5 +- .../types/device_code_paired_event_object.py | 5 +- ...e_component_details_application_details.py | 5 +- ...evice_component_details_battery_details.py | 5 +- ...e_component_details_card_reader_details.py | 3 +- ...vice_component_details_ethernet_details.py | 8 +- .../device_component_details_measurement.py | 10 +- .../device_component_details_wi_fi_details.py | 10 +- src/square/types/device_created_event.py | 5 +- src/square/types/device_created_event_data.py | 5 +- .../types/device_created_event_object.py | 5 +- src/square/types/device_details.py | 3 +- src/square/types/device_metadata.py | 3 +- src/square/types/device_status.py | 7 +- src/square/types/digital_wallet_details.py | 5 +- src/square/types/disable_card_response.py | 7 +- src/square/types/disable_events_response.py | 5 +- .../types/dismiss_terminal_action_response.py | 7 +- .../dismiss_terminal_checkout_response.py | 7 +- .../types/dismiss_terminal_refund_response.py | 7 +- src/square/types/dispute.py | 9 +- src/square/types/dispute_created_event.py | 5 +- .../types/dispute_created_event_data.py | 5 +- .../types/dispute_created_event_object.py | 5 +- src/square/types/dispute_evidence.py | 5 +- .../types/dispute_evidence_added_event.py | 5 +- .../dispute_evidence_added_event_data.py | 5 +- .../dispute_evidence_added_event_object.py | 5 +- .../types/dispute_evidence_created_event.py | 5 +- .../dispute_evidence_created_event_data.py | 5 +- .../dispute_evidence_created_event_object.py | 5 +- .../types/dispute_evidence_deleted_event.py | 5 +- .../dispute_evidence_deleted_event_data.py | 5 +- .../dispute_evidence_deleted_event_object.py | 5 +- src/square/types/dispute_evidence_file.py | 3 +- .../types/dispute_evidence_removed_event.py | 5 +- .../dispute_evidence_removed_event_data.py | 5 +- .../dispute_evidence_removed_event_object.py | 5 +- .../types/dispute_state_changed_event.py | 5 +- .../types/dispute_state_changed_event_data.py | 5 +- .../dispute_state_changed_event_object.py | 5 +- .../types/dispute_state_updated_event.py | 5 +- .../types/dispute_state_updated_event_data.py | 5 +- .../dispute_state_updated_event_object.py | 5 +- src/square/types/disputed_payment.py | 3 +- src/square/types/employee.py | 5 +- src/square/types/employee_wage.py | 5 +- src/square/types/enable_events_response.py | 5 +- src/square/types/error.py | 7 +- src/square/types/event.py | 5 +- src/square/types/event_data.py | 5 +- src/square/types/event_metadata.py | 3 +- src/square/types/event_type_metadata.py | 3 +- src/square/types/external_payment_details.py | 9 +- src/square/types/filter_value.py | 7 +- src/square/types/float_number_range.py | 3 +- src/square/types/fulfillment.py | 13 +- .../types/fulfillment_delivery_details.py | 7 +- .../types/fulfillment_fulfillment_entry.py | 3 +- .../types/fulfillment_pickup_details.py | 9 +- ..._pickup_details_curbside_pickup_details.py | 3 +- src/square/types/fulfillment_recipient.py | 5 +- .../types/fulfillment_shipment_details.py | 5 +- .../get_bank_account_by_v1id_response.py | 7 +- src/square/types/get_bank_account_response.py | 7 +- src/square/types/get_booking_request.py | 2 +- src/square/types/get_booking_response.py | 7 +- src/square/types/get_break_type_response.py | 7 +- .../get_business_booking_profile_request.py | 2 +- .../get_business_booking_profile_response.py | 7 +- src/square/types/get_card_request.py | 2 +- src/square/types/get_card_response.py | 7 +- .../types/get_cash_drawer_shift_response.py | 7 +- .../types/get_catalog_object_response.py | 39 +- ...er_custom_attribute_definition_response.py | 7 +- .../get_customer_custom_attribute_response.py | 7 +- .../types/get_customer_group_request.py | 2 +- .../types/get_customer_group_response.py | 7 +- src/square/types/get_customer_request.py | 2 +- src/square/types/get_customer_response.py | 7 +- .../types/get_customer_segment_request.py | 2 +- .../types/get_customer_segment_response.py | 7 +- src/square/types/get_device_code_response.py | 7 +- src/square/types/get_device_response.py | 7 +- .../types/get_dispute_evidence_request.py | 2 +- .../types/get_dispute_evidence_response.py | 7 +- src/square/types/get_dispute_request.py | 2 +- src/square/types/get_dispute_response.py | 7 +- src/square/types/get_employee_request.py | 2 +- src/square/types/get_employee_response.py | 7 +- .../types/get_employee_wage_response.py | 7 +- .../types/get_gift_card_from_gan_response.py | 7 +- .../get_gift_card_from_nonce_response.py | 7 +- src/square/types/get_gift_card_request.py | 2 +- src/square/types/get_gift_card_response.py | 7 +- .../types/get_inventory_adjustment_request.py | 2 +- .../get_inventory_adjustment_response.py | 7 +- .../types/get_inventory_changes_response.py | 7 +- .../types/get_inventory_count_response.py | 7 +- .../get_inventory_physical_count_request.py | 2 +- .../get_inventory_physical_count_response.py | 7 +- .../types/get_inventory_transfer_request.py | 2 +- .../types/get_inventory_transfer_response.py | 7 +- src/square/types/get_invoice_response.py | 7 +- src/square/types/get_location_request.py | 2 +- src/square/types/get_location_response.py | 7 +- .../types/get_loyalty_account_request.py | 2 +- .../types/get_loyalty_account_response.py | 7 +- .../types/get_loyalty_program_request.py | 2 +- .../types/get_loyalty_program_response.py | 7 +- .../types/get_loyalty_promotion_request.py | 2 +- .../types/get_loyalty_promotion_response.py | 7 +- .../types/get_loyalty_reward_request.py | 2 +- .../types/get_loyalty_reward_response.py | 7 +- src/square/types/get_merchant_request.py | 2 +- src/square/types/get_merchant_response.py | 7 +- src/square/types/get_order_request.py | 2 +- src/square/types/get_order_response.py | 7 +- src/square/types/get_payment_link_request.py | 2 +- src/square/types/get_payment_link_response.py | 7 +- .../types/get_payment_refund_response.py | 7 +- src/square/types/get_payment_response.py | 7 +- src/square/types/get_payout_response.py | 7 +- src/square/types/get_shift_response.py | 7 +- src/square/types/get_snippet_request.py | 2 +- src/square/types/get_snippet_response.py | 7 +- src/square/types/get_subscription_response.py | 7 +- ...get_team_member_booking_profile_request.py | 2 +- ...et_team_member_booking_profile_response.py | 7 +- src/square/types/get_team_member_request.py | 2 +- src/square/types/get_team_member_response.py | 7 +- .../types/get_team_member_wage_response.py | 7 +- .../types/get_terminal_action_response.py | 7 +- .../types/get_terminal_checkout_response.py | 7 +- .../types/get_terminal_refund_response.py | 7 +- src/square/types/get_transaction_request.py | 2 +- src/square/types/get_transaction_response.py | 7 +- src/square/types/get_vendor_request.py | 2 +- src/square/types/get_vendor_response.py | 7 +- src/square/types/get_wage_setting_request.py | 2 +- src/square/types/get_wage_setting_response.py | 7 +- .../types/get_webhook_subscription_request.py | 2 +- .../get_webhook_subscription_response.py | 7 +- src/square/types/gift_card.py | 7 +- src/square/types/gift_card_activity.py | 27 +- .../types/gift_card_activity_activate.py | 5 +- .../gift_card_activity_adjust_decrement.py | 9 +- .../gift_card_activity_adjust_increment.py | 9 +- src/square/types/gift_card_activity_block.py | 7 +- .../types/gift_card_activity_clear_balance.py | 7 +- .../types/gift_card_activity_created_event.py | 5 +- .../gift_card_activity_created_event_data.py | 5 +- ...gift_card_activity_created_event_object.py | 5 +- .../types/gift_card_activity_deactivate.py | 7 +- src/square/types/gift_card_activity_import.py | 7 +- .../gift_card_activity_import_reversal.py | 7 +- src/square/types/gift_card_activity_load.py | 5 +- src/square/types/gift_card_activity_redeem.py | 9 +- src/square/types/gift_card_activity_refund.py | 5 +- ...ift_card_activity_transfer_balance_from.py | 7 +- .../gift_card_activity_transfer_balance_to.py | 7 +- .../types/gift_card_activity_unblock.py | 7 +- ..._card_activity_unlinked_activity_refund.py | 7 +- .../types/gift_card_activity_updated_event.py | 5 +- .../gift_card_activity_updated_event_data.py | 5 +- ...gift_card_activity_updated_event_object.py | 5 +- src/square/types/gift_card_created_event.py | 5 +- .../types/gift_card_created_event_data.py | 5 +- .../types/gift_card_created_event_object.py | 5 +- .../types/gift_card_customer_linked_event.py | 5 +- .../gift_card_customer_linked_event_data.py | 5 +- .../gift_card_customer_linked_event_object.py | 5 +- .../gift_card_customer_unlinked_event.py | 5 +- .../gift_card_customer_unlinked_event_data.py | 5 +- ...ift_card_customer_unlinked_event_object.py | 5 +- src/square/types/gift_card_updated_event.py | 5 +- .../types/gift_card_updated_event_data.py | 5 +- .../types/gift_card_updated_event_object.py | 5 +- src/square/types/inventory_adjustment.py | 7 +- .../types/inventory_adjustment_group.py | 5 +- src/square/types/inventory_change.py | 11 +- src/square/types/inventory_count.py | 5 +- .../types/inventory_count_updated_event.py | 5 +- .../inventory_count_updated_event_data.py | 5 +- .../inventory_count_updated_event_object.py | 5 +- src/square/types/inventory_physical_count.py | 5 +- src/square/types/inventory_transfer.py | 5 +- src/square/types/invoice.py | 21 +- .../types/invoice_accepted_payment_methods.py | 3 +- src/square/types/invoice_attachment.py | 3 +- src/square/types/invoice_canceled_event.py | 5 +- .../types/invoice_canceled_event_data.py | 5 +- .../types/invoice_canceled_event_object.py | 5 +- src/square/types/invoice_created_event.py | 5 +- .../types/invoice_created_event_data.py | 5 +- .../types/invoice_created_event_object.py | 5 +- src/square/types/invoice_custom_field.py | 5 +- src/square/types/invoice_deleted_event.py | 5 +- .../types/invoice_deleted_event_data.py | 3 +- src/square/types/invoice_filter.py | 3 +- .../types/invoice_payment_made_event.py | 5 +- .../types/invoice_payment_made_event_data.py | 5 +- .../invoice_payment_made_event_object.py | 5 +- src/square/types/invoice_payment_reminder.py | 5 +- src/square/types/invoice_payment_request.py | 11 +- src/square/types/invoice_published_event.py | 5 +- .../types/invoice_published_event_data.py | 5 +- .../types/invoice_published_event_object.py | 5 +- src/square/types/invoice_query.py | 7 +- src/square/types/invoice_recipient.py | 5 +- src/square/types/invoice_recipient_tax_ids.py | 3 +- src/square/types/invoice_refunded_event.py | 5 +- .../types/invoice_refunded_event_data.py | 5 +- .../types/invoice_refunded_event_object.py | 5 +- .../invoice_scheduled_charge_failed_event.py | 5 +- ...oice_scheduled_charge_failed_event_data.py | 5 +- ...ce_scheduled_charge_failed_event_object.py | 5 +- src/square/types/invoice_sort.py | 7 +- src/square/types/invoice_updated_event.py | 5 +- .../types/invoice_updated_event_data.py | 5 +- .../types/invoice_updated_event_object.py | 5 +- .../item_variation_location_overrides.py | 7 +- src/square/types/job.py | 3 +- src/square/types/job_assignment.py | 5 +- src/square/types/job_created_event.py | 5 +- src/square/types/job_created_event_data.py | 5 +- src/square/types/job_created_event_object.py | 5 +- src/square/types/job_updated_event.py | 5 +- src/square/types/job_updated_event_data.py | 5 +- src/square/types/job_updated_event_object.py | 5 +- .../labor_scheduled_shift_created_event.py | 5 +- ...abor_scheduled_shift_created_event_data.py | 5 +- ...or_scheduled_shift_created_event_object.py | 9 +- .../labor_scheduled_shift_deleted_event.py | 5 +- ...abor_scheduled_shift_deleted_event_data.py | 3 +- .../labor_scheduled_shift_published_event.py | 5 +- ...or_scheduled_shift_published_event_data.py | 5 +- ..._scheduled_shift_published_event_object.py | 9 +- .../labor_scheduled_shift_updated_event.py | 5 +- ...abor_scheduled_shift_updated_event_data.py | 5 +- ...or_scheduled_shift_updated_event_object.py | 9 +- src/square/types/labor_shift_created_event.py | 5 +- .../types/labor_shift_created_event_data.py | 5 +- .../types/labor_shift_created_event_object.py | 5 +- src/square/types/labor_shift_deleted_event.py | 5 +- .../types/labor_shift_deleted_event_data.py | 3 +- src/square/types/labor_shift_updated_event.py | 5 +- .../types/labor_shift_updated_event_data.py | 5 +- .../types/labor_shift_updated_event_object.py | 5 +- .../types/labor_timecard_created_event.py | 5 +- .../labor_timecard_created_event_data.py | 5 +- .../labor_timecard_created_event_object.py | 5 +- .../types/labor_timecard_deleted_event.py | 5 +- .../labor_timecard_deleted_event_data.py | 3 +- .../types/labor_timecard_updated_event.py | 5 +- .../labor_timecard_updated_event_data.py | 5 +- .../labor_timecard_updated_event_object.py | 5 +- .../link_customer_to_gift_card_response.py | 7 +- .../types/list_bank_accounts_response.py | 7 +- ...g_custom_attribute_definitions_response.py | 7 +- ...list_booking_custom_attributes_response.py | 7 +- src/square/types/list_bookings_response.py | 7 +- src/square/types/list_break_types_response.py | 7 +- src/square/types/list_cards_response.py | 7 +- .../list_cash_drawer_shift_events_response.py | 7 +- .../types/list_cash_drawer_shifts_response.py | 7 +- src/square/types/list_catalog_response.py | 37 +- .../types/list_channels_request_constants.py | 5 - src/square/types/list_channels_response.py | 35 - ...r_custom_attribute_definitions_response.py | 7 +- ...ist_customer_custom_attributes_response.py | 7 +- .../types/list_customer_groups_response.py | 7 +- .../types/list_customer_segments_response.py | 7 +- src/square/types/list_customers_response.py | 7 +- .../types/list_device_codes_response.py | 7 +- src/square/types/list_devices_response.py | 7 +- .../types/list_dispute_evidence_response.py | 7 +- src/square/types/list_disputes_response.py | 7 +- .../types/list_employee_wages_response.py | 7 +- src/square/types/list_employees_response.py | 7 +- src/square/types/list_event_types_response.py | 7 +- .../list_gift_card_activities_response.py | 7 +- src/square/types/list_gift_cards_response.py | 7 +- src/square/types/list_invoices_response.py | 7 +- src/square/types/list_jobs_response.py | 7 +- ...list_location_booking_profiles_response.py | 7 +- ...n_custom_attribute_definitions_response.py | 7 +- ...ist_location_custom_attributes_response.py | 7 +- src/square/types/list_locations_response.py | 7 +- .../types/list_loyalty_programs_response.py | 7 +- .../types/list_loyalty_promotions_response.py | 7 +- ...t_custom_attribute_definitions_response.py | 7 +- ...ist_merchant_custom_attributes_response.py | 7 +- src/square/types/list_merchants_response.py | 7 +- ...r_custom_attribute_definitions_response.py | 7 +- .../list_order_custom_attributes_response.py | 7 +- .../types/list_payment_links_response.py | 7 +- .../types/list_payment_refunds_response.py | 7 +- src/square/types/list_payments_response.py | 7 +- .../types/list_payout_entries_response.py | 7 +- src/square/types/list_payouts_response.py | 7 +- src/square/types/list_sites_response.py | 7 +- .../list_subscription_events_response.py | 7 +- ...t_team_member_booking_profiles_response.py | 7 +- .../types/list_team_member_wages_response.py | 7 +- .../types/list_transactions_response.py | 7 +- .../list_webhook_event_types_response.py | 7 +- .../list_webhook_subscriptions_response.py | 7 +- .../types/list_workweek_configs_response.py | 7 +- src/square/types/location.py | 13 +- src/square/types/location_booking_profile.py | 3 +- src/square/types/location_created_event.py | 5 +- .../types/location_created_event_data.py | 3 +- ...ttribute_definition_owned_created_event.py | 5 +- ...ttribute_definition_owned_deleted_event.py | 5 +- ...ttribute_definition_owned_updated_event.py | 5 +- ...ribute_definition_visible_created_event.py | 5 +- ...ribute_definition_visible_deleted_event.py | 5 +- ...ribute_definition_visible_updated_event.py | 5 +- ...on_custom_attribute_owned_deleted_event.py | 5 +- ...on_custom_attribute_owned_updated_event.py | 5 +- ..._custom_attribute_visible_deleted_event.py | 5 +- ..._custom_attribute_visible_updated_event.py | 5 +- .../types/location_settings_updated_event.py | 5 +- .../location_settings_updated_event_data.py | 5 +- .../location_settings_updated_event_object.py | 5 +- src/square/types/location_updated_event.py | 5 +- .../types/location_updated_event_data.py | 3 +- src/square/types/loyalty_account.py | 14 +- .../types/loyalty_account_created_event.py | 5 +- .../loyalty_account_created_event_data.py | 5 +- .../loyalty_account_created_event_object.py | 5 +- .../types/loyalty_account_deleted_event.py | 5 +- .../loyalty_account_deleted_event_data.py | 5 +- .../loyalty_account_deleted_event_object.py | 5 +- ...loyalty_account_expiring_point_deadline.py | 5 +- src/square/types/loyalty_account_mapping.py | 3 +- .../types/loyalty_account_updated_event.py | 5 +- .../loyalty_account_updated_event_data.py | 5 +- .../loyalty_account_updated_event_object.py | 5 +- src/square/types/loyalty_event.py | 15 +- .../types/loyalty_event_accumulate_points.py | 3 +- ...yalty_event_accumulate_promotion_points.py | 3 +- .../types/loyalty_event_adjust_points.py | 3 +- .../types/loyalty_event_create_reward.py | 3 +- .../types/loyalty_event_created_event.py | 5 +- .../types/loyalty_event_created_event_data.py | 5 +- .../loyalty_event_created_event_object.py | 5 +- .../types/loyalty_event_date_time_filter.py | 7 +- .../types/loyalty_event_delete_reward.py | 3 +- .../types/loyalty_event_expire_points.py | 3 +- src/square/types/loyalty_event_filter.py | 9 +- .../types/loyalty_event_location_filter.py | 3 +- .../loyalty_event_loyalty_account_filter.py | 5 +- .../types/loyalty_event_order_filter.py | 5 +- src/square/types/loyalty_event_other.py | 3 +- src/square/types/loyalty_event_query.py | 5 +- .../types/loyalty_event_redeem_reward.py | 3 +- src/square/types/loyalty_event_type_filter.py | 5 +- src/square/types/loyalty_program.py | 11 +- .../types/loyalty_program_accrual_rule.py | 13 +- ...alty_program_accrual_rule_category_data.py | 5 +- ...rogram_accrual_rule_item_variation_data.py | 5 +- ...loyalty_program_accrual_rule_spend_data.py | 9 +- ...loyalty_program_accrual_rule_visit_data.py | 7 +- .../types/loyalty_program_created_event.py | 5 +- .../loyalty_program_created_event_data.py | 5 +- .../loyalty_program_created_event_object.py | 5 +- .../loyalty_program_expiration_policy.py | 5 +- .../types/loyalty_program_reward_tier.py | 5 +- .../types/loyalty_program_terminology.py | 5 +- .../types/loyalty_program_updated_event.py | 5 +- .../loyalty_program_updated_event_data.py | 5 +- .../loyalty_program_updated_event_object.py | 5 +- src/square/types/loyalty_promotion.py | 9 +- .../loyalty_promotion_available_time_data.py | 3 +- .../types/loyalty_promotion_created_event.py | 5 +- .../loyalty_promotion_created_event_data.py | 5 +- .../loyalty_promotion_created_event_object.py | 5 +- .../types/loyalty_promotion_incentive.py | 11 +- ...romotion_incentive_points_addition_data.py | 5 +- ...motion_incentive_points_multiplier_data.py | 3 +- .../types/loyalty_promotion_trigger_limit.py | 7 +- .../types/loyalty_promotion_updated_event.py | 5 +- .../loyalty_promotion_updated_event_data.py | 5 +- .../loyalty_promotion_updated_event_object.py | 5 +- src/square/types/loyalty_reward.py | 5 +- src/square/types/measurement_unit.py | 13 +- src/square/types/measurement_unit_custom.py | 5 +- src/square/types/merchant.py | 5 +- ...ttribute_definition_owned_created_event.py | 5 +- ...ttribute_definition_owned_deleted_event.py | 5 +- ...ttribute_definition_owned_updated_event.py | 5 +- ...ribute_definition_visible_created_event.py | 5 +- ...ribute_definition_visible_deleted_event.py | 5 +- ...ribute_definition_visible_updated_event.py | 5 +- ...nt_custom_attribute_owned_deleted_event.py | 5 +- ...nt_custom_attribute_owned_updated_event.py | 5 +- ..._custom_attribute_visible_deleted_event.py | 5 +- ..._custom_attribute_visible_updated_event.py | 5 +- .../types/merchant_settings_updated_event.py | 5 +- .../merchant_settings_updated_event_data.py | 5 +- .../merchant_settings_updated_event_object.py | 5 +- .../types/modifier_location_overrides.py | 5 +- src/square/types/money.py | 5 +- .../oauth_authorization_revoked_event.py | 5 +- .../oauth_authorization_revoked_event_data.py | 5 +- ...auth_authorization_revoked_event_object.py | 5 +- ...ization_revoked_event_revocation_object.py | 5 +- src/square/types/obtain_token_response.py | 5 +- src/square/types/offline_payment_details.py | 3 +- src/square/types/order.py | 25 +- src/square/types/order_created.py | 5 +- src/square/types/order_created_event.py | 5 +- src/square/types/order_created_event_data.py | 5 +- src/square/types/order_created_object.py | 5 +- ...ttribute_definition_owned_created_event.py | 5 +- ...ttribute_definition_owned_deleted_event.py | 5 +- ...ttribute_definition_owned_updated_event.py | 5 +- ...ribute_definition_visible_created_event.py | 5 +- ...ribute_definition_visible_deleted_event.py | 5 +- ...ribute_definition_visible_updated_event.py | 5 +- ...er_custom_attribute_owned_deleted_event.py | 5 +- ...er_custom_attribute_owned_updated_event.py | 5 +- ..._custom_attribute_visible_deleted_event.py | 5 +- ..._custom_attribute_visible_updated_event.py | 5 +- src/square/types/order_entry.py | 3 +- src/square/types/order_fulfillment_updated.py | 7 +- .../types/order_fulfillment_updated_event.py | 5 +- .../order_fulfillment_updated_event_data.py | 5 +- .../types/order_fulfillment_updated_object.py | 5 +- .../types/order_fulfillment_updated_update.py | 5 +- src/square/types/order_line_item.py | 15 +- .../types/order_line_item_applied_discount.py | 5 +- .../order_line_item_applied_service_charge.py | 5 +- .../types/order_line_item_applied_tax.py | 5 +- src/square/types/order_line_item_discount.py | 7 +- src/square/types/order_line_item_modifier.py | 5 +- .../order_line_item_pricing_blocklists.py | 7 +- ...tem_pricing_blocklists_blocked_discount.py | 3 +- ...ine_item_pricing_blocklists_blocked_tax.py | 3 +- src/square/types/order_line_item_tax.py | 7 +- src/square/types/order_money_amounts.py | 5 +- src/square/types/order_pricing_options.py | 3 +- src/square/types/order_quantity_unit.py | 5 +- src/square/types/order_return.py | 9 +- src/square/types/order_return_discount.py | 7 +- src/square/types/order_return_line_item.py | 15 +- .../types/order_return_line_item_modifier.py | 5 +- .../types/order_return_service_charge.py | 9 +- src/square/types/order_return_tax.py | 7 +- src/square/types/order_return_tip.py | 5 +- src/square/types/order_reward.py | 5 +- src/square/types/order_rounding_adjustment.py | 5 +- src/square/types/order_service_charge.py | 11 +- src/square/types/order_source.py | 3 +- src/square/types/order_updated.py | 5 +- src/square/types/order_updated_event.py | 5 +- src/square/types/order_updated_event_data.py | 5 +- src/square/types/order_updated_object.py | 5 +- .../types/pause_subscription_response.py | 7 +- src/square/types/pay_order_response.py | 7 +- src/square/types/payment.py | 29 +- ..._balance_activity_app_fee_refund_detail.py | 3 +- ...balance_activity_app_fee_revenue_detail.py | 3 +- ...lance_activity_automatic_savings_detail.py | 3 +- ...ivity_automatic_savings_reversed_detail.py | 3 +- .../payment_balance_activity_charge_detail.py | 3 +- ...ent_balance_activity_deposit_fee_detail.py | 3 +- ...ce_activity_deposit_fee_reversed_detail.py | 3 +- ...payment_balance_activity_dispute_detail.py | 3 +- .../payment_balance_activity_fee_detail.py | 3 +- ...balance_activity_free_processing_detail.py | 3 +- ...balance_activity_hold_adjustment_detail.py | 3 +- ...nt_balance_activity_open_dispute_detail.py | 3 +- ...alance_activity_other_adjustment_detail.py | 3 +- .../payment_balance_activity_other_detail.py | 3 +- .../payment_balance_activity_refund_detail.py | 3 +- ...ance_activity_release_adjustment_detail.py | 3 +- ...nt_balance_activity_reserve_hold_detail.py | 3 +- ...balance_activity_reserve_release_detail.py | 3 +- ..._activity_square_capital_payment_detail.py | 3 +- ..._square_capital_reversed_payment_detail.py | 3 +- ...activity_square_payroll_transfer_detail.py | 3 +- ...square_payroll_transfer_reversed_detail.py | 3 +- ...ment_balance_activity_tax_on_fee_detail.py | 3 +- ...balance_activity_third_party_fee_detail.py | 3 +- ..._activity_third_party_fee_refund_detail.py | 3 +- src/square/types/payment_created_event.py | 5 +- .../types/payment_created_event_data.py | 5 +- .../types/payment_created_event_object.py | 5 +- src/square/types/payment_link.py | 5 +- .../types/payment_link_related_resources.py | 37 +- src/square/types/payment_options.py | 5 +- src/square/types/payment_refund.py | 7 +- src/square/types/payment_updated_event.py | 5 +- .../types/payment_updated_event_data.py | 5 +- .../types/payment_updated_event_object.py | 5 +- src/square/types/payout.py | 13 +- src/square/types/payout_entry.py | 17 +- src/square/types/payout_failed_event.py | 5 +- src/square/types/payout_failed_event_data.py | 5 +- .../types/payout_failed_event_object.py | 5 +- src/square/types/payout_fee.py | 7 +- src/square/types/payout_paid_event.py | 5 +- src/square/types/payout_paid_event_data.py | 5 +- src/square/types/payout_paid_event_object.py | 5 +- src/square/types/payout_sent_event.py | 5 +- src/square/types/payout_sent_event_data.py | 5 +- src/square/types/payout_sent_event_object.py | 5 +- src/square/types/phase.py | 3 +- src/square/types/phase_input.py | 5 +- src/square/types/pre_populated_data.py | 5 +- src/square/types/processing_fee.py | 5 +- src/square/types/publish_invoice_response.py | 7 +- .../types/publish_scheduled_shift_response.py | 7 +- src/square/types/qr_code_options.py | 5 +- src/square/types/quick_pay.py | 7 +- src/square/types/range.py | 3 +- src/square/types/receipt_options.py | 5 +- .../types/receive_transfer_order_response.py | 34 - .../types/redeem_loyalty_reward_response.py | 7 +- src/square/types/reference.py | 30 - src/square/types/reference_type.py | 24 - src/square/types/refund.py | 9 +- src/square/types/refund_created_event.py | 5 +- src/square/types/refund_created_event_data.py | 5 +- .../types/refund_created_event_object.py | 5 +- src/square/types/refund_payment_response.py | 7 +- src/square/types/refund_updated_event.py | 5 +- src/square/types/refund_updated_event_data.py | 5 +- .../types/refund_updated_event_object.py | 5 +- src/square/types/register_domain_response.py | 7 +- .../remove_group_from_customer_response.py | 5 +- .../types/resume_subscription_response.py | 7 +- ...ng_custom_attribute_definition_response.py | 7 +- ...rieve_booking_custom_attribute_response.py | 7 +- src/square/types/retrieve_channel_response.py | 30 - src/square/types/retrieve_job_response.py | 7 +- ...rieve_location_booking_profile_response.py | 7 +- ...on_custom_attribute_definition_response.py | 7 +- ...ieve_location_custom_attribute_response.py | 7 +- .../retrieve_location_settings_response.py | 7 +- ...nt_custom_attribute_definition_response.py | 7 +- ...ieve_merchant_custom_attribute_response.py | 7 +- .../retrieve_merchant_settings_response.py | 7 +- ...er_custom_attribute_definition_response.py | 7 +- ...etrieve_order_custom_attribute_response.py | 7 +- .../retrieve_scheduled_shift_response.py | 7 +- .../types/retrieve_timecard_response.py | 7 +- .../types/retrieve_token_status_response.py | 5 +- .../types/retrieve_transfer_order_response.py | 34 - src/square/types/revoke_token_response.py | 5 +- src/square/types/risk_evaluation.py | 5 +- src/square/types/save_card_options.py | 5 +- src/square/types/scheduled_shift.py | 5 +- src/square/types/scheduled_shift_details.py | 3 +- src/square/types/scheduled_shift_filter.py | 9 +- src/square/types/scheduled_shift_query.py | 7 +- src/square/types/scheduled_shift_sort.py | 7 +- src/square/types/scheduled_shift_workday.py | 7 +- .../types/search_availability_filter.py | 9 +- src/square/types/search_availability_query.py | 7 +- .../types/search_availability_response.py | 7 +- .../types/search_catalog_items_response.py | 37 +- .../types/search_catalog_objects_response.py | 39 +- src/square/types/search_customers_response.py | 7 +- src/square/types/search_events_filter.py | 5 +- src/square/types/search_events_query.py | 7 +- src/square/types/search_events_response.py | 7 +- src/square/types/search_events_sort.py | 7 +- src/square/types/search_invoices_response.py | 7 +- ..._accounts_request_loyalty_account_query.py | 5 +- .../types/search_loyalty_accounts_response.py | 7 +- .../types/search_loyalty_events_response.py | 7 +- ...ty_rewards_request_loyalty_reward_query.py | 7 +- .../types/search_loyalty_rewards_response.py | 7 +- .../types/search_orders_customer_filter.py | 3 +- .../types/search_orders_date_time_filter.py | 5 +- src/square/types/search_orders_filter.py | 9 +- .../types/search_orders_fulfillment_filter.py | 7 +- src/square/types/search_orders_query.py | 7 +- src/square/types/search_orders_response.py | 9 +- src/square/types/search_orders_sort.py | 7 +- .../types/search_orders_source_filter.py | 3 +- .../types/search_orders_state_filter.py | 5 +- .../types/search_scheduled_shifts_response.py | 7 +- src/square/types/search_shifts_response.py | 7 +- .../types/search_subscriptions_filter.py | 3 +- .../types/search_subscriptions_query.py | 5 +- .../types/search_subscriptions_response.py | 7 +- .../types/search_team_members_filter.py | 5 +- src/square/types/search_team_members_query.py | 5 +- .../types/search_team_members_response.py | 7 +- .../types/search_terminal_actions_response.py | 7 +- .../search_terminal_checkouts_response.py | 7 +- .../types/search_terminal_refunds_response.py | 7 +- src/square/types/search_timecards_response.py | 7 +- .../types/search_transfer_orders_response.py | 39 - .../types/search_vendors_request_filter.py | 5 +- .../types/search_vendors_request_sort.py | 7 +- src/square/types/search_vendors_response.py | 7 +- src/square/types/segment_filter.py | 7 +- src/square/types/select_option.py | 5 +- src/square/types/select_options.py | 7 +- src/square/types/shift.py | 9 +- src/square/types/shift_filter.py | 7 +- src/square/types/shift_query.py | 7 +- src/square/types/shift_sort.py | 7 +- src/square/types/shift_wage.py | 5 +- src/square/types/shift_workday.py | 7 +- src/square/types/shipping_fee.py | 5 +- src/square/types/signature_image.py | 3 +- src/square/types/signature_options.py | 7 +- src/square/types/site.py | 3 +- src/square/types/snippet.py | 3 +- src/square/types/source_application.py | 5 +- src/square/types/square_account_details.py | 5 +- src/square/types/standard_unit_description.py | 5 +- .../types/standard_unit_description_group.py | 5 +- .../types/start_transfer_order_response.py | 34 - src/square/types/submit_evidence_response.py | 7 +- src/square/types/subscription.py | 16 +- src/square/types/subscription_action.py | 7 +- src/square/types/subscription_action_type.py | 2 +- .../types/subscription_created_event.py | 5 +- .../types/subscription_created_event_data.py | 5 +- .../subscription_created_event_object.py | 5 +- src/square/types/subscription_event.py | 11 +- src/square/types/subscription_event_info.py | 5 +- src/square/types/subscription_phase.py | 7 +- src/square/types/subscription_pricing.py | 7 +- src/square/types/subscription_source.py | 3 +- src/square/types/subscription_status.py | 4 +- src/square/types/subscription_test_result.py | 3 +- .../types/subscription_updated_event.py | 5 +- .../types/subscription_updated_event_data.py | 5 +- .../subscription_updated_event_object.py | 5 +- src/square/types/swap_plan_response.py | 7 +- src/square/types/tax_ids.py | 3 +- src/square/types/team_member.py | 7 +- .../types/team_member_assigned_locations.py | 5 +- .../types/team_member_booking_profile.py | 3 +- src/square/types/team_member_created_event.py | 5 +- .../types/team_member_created_event_data.py | 5 +- .../types/team_member_created_event_object.py | 5 +- src/square/types/team_member_updated_event.py | 5 +- .../types/team_member_updated_event_data.py | 5 +- .../types/team_member_updated_event_object.py | 5 +- src/square/types/team_member_wage.py | 5 +- .../team_member_wage_setting_updated_event.py | 5 +- ..._member_wage_setting_updated_event_data.py | 5 +- ...ember_wage_setting_updated_event_object.py | 5 +- src/square/types/tender.py | 13 +- .../types/tender_bank_account_details.py | 5 +- .../types/tender_buy_now_pay_later_details.py | 7 +- src/square/types/tender_card_details.py | 7 +- src/square/types/tender_cash_details.py | 5 +- .../types/tender_square_account_details.py | 5 +- src/square/types/terminal_action.py | 17 +- .../types/terminal_action_created_event.py | 5 +- .../terminal_action_created_event_data.py | 5 +- .../terminal_action_created_event_object.py | 5 +- src/square/types/terminal_action_query.py | 7 +- .../types/terminal_action_query_filter.py | 7 +- .../types/terminal_action_query_sort.py | 5 +- .../types/terminal_action_updated_event.py | 5 +- .../terminal_action_updated_event_data.py | 5 +- .../terminal_action_updated_event_object.py | 5 +- src/square/types/terminal_checkout.py | 11 +- .../types/terminal_checkout_created_event.py | 5 +- .../terminal_checkout_created_event_data.py | 5 +- .../terminal_checkout_created_event_object.py | 5 +- src/square/types/terminal_checkout_query.py | 7 +- .../types/terminal_checkout_query_filter.py | 5 +- .../types/terminal_checkout_query_sort.py | 5 +- .../types/terminal_checkout_updated_event.py | 5 +- .../terminal_checkout_updated_event_data.py | 5 +- .../terminal_checkout_updated_event_object.py | 5 +- src/square/types/terminal_refund.py | 7 +- .../types/terminal_refund_created_event.py | 5 +- .../terminal_refund_created_event_data.py | 5 +- .../terminal_refund_created_event_object.py | 5 +- src/square/types/terminal_refund_query.py | 7 +- .../types/terminal_refund_query_filter.py | 5 +- .../types/terminal_refund_query_sort.py | 3 +- .../types/terminal_refund_updated_event.py | 5 +- .../terminal_refund_updated_event_data.py | 5 +- .../terminal_refund_updated_event_object.py | 5 +- .../test_webhook_subscription_response.py | 7 +- src/square/types/time_range.py | 3 +- src/square/types/timecard.py | 9 +- src/square/types/timecard_filter.py | 7 +- src/square/types/timecard_query.py | 7 +- src/square/types/timecard_sort.py | 7 +- src/square/types/timecard_wage.py | 5 +- src/square/types/timecard_workday.py | 7 +- src/square/types/tip_settings.py | 3 +- src/square/types/transaction.py | 9 +- src/square/types/transfer_order.py | 142 -- .../types/transfer_order_created_event.py | 48 - .../transfer_order_created_event_data.py | 34 - .../transfer_order_created_event_object.py | 24 - .../types/transfer_order_deleted_event.py | 48 - .../transfer_order_deleted_event_data.py | 33 - src/square/types/transfer_order_filter.py | 39 - .../types/transfer_order_goods_receipt.py | 55 - .../transfer_order_goods_receipt_line_item.py | 44 - src/square/types/transfer_order_line.py | 70 - src/square/types/transfer_order_query.py | 34 - src/square/types/transfer_order_sort.py | 36 - src/square/types/transfer_order_sort_field.py | 5 - src/square/types/transfer_order_status.py | 7 - .../types/transfer_order_updated_event.py | 48 - .../transfer_order_updated_event_data.py | 34 - .../transfer_order_updated_event_object.py | 24 - ...unlink_customer_from_gift_card_response.py | 7 +- ...ng_custom_attribute_definition_response.py | 7 +- src/square/types/update_booking_response.py | 7 +- .../types/update_break_type_response.py | 7 +- .../types/update_catalog_image_request.py | 5 +- .../types/update_catalog_image_response.py | 37 +- ...er_custom_attribute_definition_response.py | 7 +- .../types/update_customer_group_response.py | 7 +- src/square/types/update_customer_response.py | 7 +- src/square/types/update_invoice_response.py | 7 +- .../update_item_modifier_lists_response.py | 5 +- .../types/update_item_taxes_response.py | 5 +- src/square/types/update_job_response.py | 7 +- ...on_custom_attribute_definition_response.py | 7 +- src/square/types/update_location_response.py | 7 +- .../update_location_settings_response.py | 7 +- ...nt_custom_attribute_definition_response.py | 7 +- .../update_merchant_settings_response.py | 7 +- ...er_custom_attribute_definition_response.py | 7 +- src/square/types/update_order_response.py | 7 +- .../types/update_payment_link_response.py | 7 +- src/square/types/update_payment_response.py | 7 +- .../types/update_scheduled_shift_response.py | 7 +- src/square/types/update_shift_response.py | 7 +- .../types/update_subscription_response.py | 7 +- .../types/update_team_member_request.py | 5 +- .../types/update_team_member_response.py | 7 +- src/square/types/update_timecard_response.py | 7 +- .../types/update_transfer_order_data.py | 55 - .../types/update_transfer_order_line_data.py | 44 - .../types/update_transfer_order_response.py | 34 - src/square/types/update_vendor_request.py | 5 +- src/square/types/update_vendor_response.py | 7 +- .../types/update_wage_setting_response.py | 7 +- .../update_webhook_subscription_response.py | 7 +- ...ook_subscription_signature_key_response.py | 5 +- .../types/update_workweek_config_response.py | 7 +- ...psert_booking_custom_attribute_response.py | 7 +- .../types/upsert_catalog_object_response.py | 37 +- ...sert_customer_custom_attribute_response.py | 7 +- ...sert_location_custom_attribute_response.py | 7 +- ...sert_merchant_custom_attribute_response.py | 7 +- .../upsert_order_custom_attribute_response.py | 7 +- src/square/types/upsert_snippet_response.py | 7 +- src/square/types/v1get_payment_request.py | 2 +- src/square/types/v1get_settlement_request.py | 2 +- src/square/types/v1money.py | 5 +- src/square/types/v1order.py | 11 +- src/square/types/v1order_history_entry.py | 5 +- src/square/types/v1tender.py | 9 +- src/square/types/vendor.py | 5 +- src/square/types/vendor_contact.py | 3 +- src/square/types/vendor_created_event.py | 5 +- src/square/types/vendor_created_event_data.py | 5 +- .../types/vendor_created_event_object.py | 7 +- src/square/types/vendor_updated_event.py | 5 +- src/square/types/vendor_updated_event_data.py | 5 +- .../types/vendor_updated_event_object.py | 7 +- src/square/types/void_transaction_response.py | 5 +- src/square/types/wage_setting.py | 5 +- src/square/types/webhook_subscription.py | 3 +- src/square/types/workweek_config.py | 5 +- src/square/v1transactions/__init__.py | 2 - src/square/v1transactions/client.py | 33 +- src/square/v1transactions/raw_client.py | 41 +- src/square/vendors/__init__.py | 2 - src/square/vendors/client.py | 73 +- src/square/vendors/raw_client.py | 87 +- src/square/webhooks/__init__.py | 31 +- src/square/webhooks/client.py | 62 +- src/square/webhooks/event_types/__init__.py | 2 - src/square/webhooks/event_types/client.py | 15 +- src/square/webhooks/event_types/raw_client.py | 21 +- src/square/webhooks/raw_client.py | 3 +- src/square/webhooks/subscriptions/__init__.py | 2 - src/square/webhooks/subscriptions/client.py | 156 ++- .../webhooks/subscriptions/raw_client.py | 234 +--- tests/custom/test_client.py | 2 +- tests/utils/assets/models/__init__.py | 2 +- tests/utils/assets/models/circle.py | 2 +- .../assets/models/object_with_defaults.py | 1 + .../models/object_with_optional_field.py | 9 +- tests/utils/assets/models/shape.py | 6 +- tests/utils/assets/models/square.py | 2 +- .../assets/models/undiscriminated_shape.py | 1 - tests/utils/test_query_encoding.py | 3 +- tests/utils/test_serialization.py | 6 +- 2509 files changed, 14195 insertions(+), 30992 deletions(-) delete mode 100644 .fern/metadata.json create mode 100644 changelog.md delete mode 100644 src/square/channels/__init__.py delete mode 100644 src/square/channels/client.py delete mode 100644 src/square/channels/raw_client.py delete mode 100644 src/square/core/custom_pagination.py delete mode 100644 src/square/core/force_multipart.py delete mode 100644 src/square/core/http_sse/__init__.py delete mode 100644 src/square/core/http_sse/_api.py delete mode 100644 src/square/core/http_sse/_decoders.py delete mode 100644 src/square/core/http_sse/_exceptions.py delete mode 100644 src/square/core/http_sse/_models.py delete mode 100644 src/square/requests/bulk_retrieve_channels_response.py delete mode 100644 src/square/requests/cancel_transfer_order_response.py delete mode 100644 src/square/requests/channel.py delete mode 100644 src/square/requests/create_transfer_order_data.py delete mode 100644 src/square/requests/create_transfer_order_line_data.py delete mode 100644 src/square/requests/create_transfer_order_response.py delete mode 100644 src/square/requests/delete_transfer_order_response.py delete mode 100644 src/square/requests/list_channels_response.py delete mode 100644 src/square/requests/receive_transfer_order_response.py delete mode 100644 src/square/requests/reference.py delete mode 100644 src/square/requests/retrieve_channel_response.py delete mode 100644 src/square/requests/retrieve_transfer_order_response.py delete mode 100644 src/square/requests/search_transfer_orders_response.py delete mode 100644 src/square/requests/start_transfer_order_response.py delete mode 100644 src/square/requests/transfer_order.py delete mode 100644 src/square/requests/transfer_order_created_event.py delete mode 100644 src/square/requests/transfer_order_created_event_data.py delete mode 100644 src/square/requests/transfer_order_created_event_object.py delete mode 100644 src/square/requests/transfer_order_deleted_event.py delete mode 100644 src/square/requests/transfer_order_deleted_event_data.py delete mode 100644 src/square/requests/transfer_order_filter.py delete mode 100644 src/square/requests/transfer_order_goods_receipt.py delete mode 100644 src/square/requests/transfer_order_goods_receipt_line_item.py delete mode 100644 src/square/requests/transfer_order_line.py delete mode 100644 src/square/requests/transfer_order_query.py delete mode 100644 src/square/requests/transfer_order_sort.py delete mode 100644 src/square/requests/transfer_order_updated_event.py delete mode 100644 src/square/requests/transfer_order_updated_event_data.py delete mode 100644 src/square/requests/transfer_order_updated_event_object.py delete mode 100644 src/square/requests/update_transfer_order_data.py delete mode 100644 src/square/requests/update_transfer_order_line_data.py delete mode 100644 src/square/requests/update_transfer_order_response.py delete mode 100644 src/square/transfer_orders/__init__.py delete mode 100644 src/square/transfer_orders/client.py delete mode 100644 src/square/transfer_orders/raw_client.py delete mode 100644 src/square/types/bulk_retrieve_channels_request_constants.py delete mode 100644 src/square/types/bulk_retrieve_channels_response.py delete mode 100644 src/square/types/cancel_transfer_order_response.py delete mode 100644 src/square/types/channel.py delete mode 100644 src/square/types/channel_status.py delete mode 100644 src/square/types/create_transfer_order_data.py delete mode 100644 src/square/types/create_transfer_order_line_data.py delete mode 100644 src/square/types/create_transfer_order_response.py delete mode 100644 src/square/types/delete_transfer_order_response.py delete mode 100644 src/square/types/list_channels_request_constants.py delete mode 100644 src/square/types/list_channels_response.py delete mode 100644 src/square/types/receive_transfer_order_response.py delete mode 100644 src/square/types/reference.py delete mode 100644 src/square/types/reference_type.py delete mode 100644 src/square/types/retrieve_channel_response.py delete mode 100644 src/square/types/retrieve_transfer_order_response.py delete mode 100644 src/square/types/search_transfer_orders_response.py delete mode 100644 src/square/types/start_transfer_order_response.py delete mode 100644 src/square/types/transfer_order.py delete mode 100644 src/square/types/transfer_order_created_event.py delete mode 100644 src/square/types/transfer_order_created_event_data.py delete mode 100644 src/square/types/transfer_order_created_event_object.py delete mode 100644 src/square/types/transfer_order_deleted_event.py delete mode 100644 src/square/types/transfer_order_deleted_event_data.py delete mode 100644 src/square/types/transfer_order_filter.py delete mode 100644 src/square/types/transfer_order_goods_receipt.py delete mode 100644 src/square/types/transfer_order_goods_receipt_line_item.py delete mode 100644 src/square/types/transfer_order_line.py delete mode 100644 src/square/types/transfer_order_query.py delete mode 100644 src/square/types/transfer_order_sort.py delete mode 100644 src/square/types/transfer_order_sort_field.py delete mode 100644 src/square/types/transfer_order_status.py delete mode 100644 src/square/types/transfer_order_updated_event.py delete mode 100644 src/square/types/transfer_order_updated_event_data.py delete mode 100644 src/square/types/transfer_order_updated_event_object.py delete mode 100644 src/square/types/update_transfer_order_data.py delete mode 100644 src/square/types/update_transfer_order_line_data.py delete mode 100644 src/square/types/update_transfer_order_response.py diff --git a/.fern/metadata.json b/.fern/metadata.json deleted file mode 100644 index d4b24802..00000000 --- a/.fern/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "cliVersion": "2.2.5", - "generatorName": "fernapi/fern-python-sdk", - "generatorVersion": "4.38.4", - "generatorConfig": { - "client": { - "class_name": "Square", - "filename": "client.py" - }, - "pydantic_config": { - "skip_validation": true - }, - "use_typeddict_requests": true, - "use_typeddict_requests_for_file_upload": true, - "exclude_types_from_init_exports": true - } -} \ No newline at end of file diff --git a/.fernignore b/.fernignore index 072c9072..fb6f590f 100644 --- a/.fernignore +++ b/.fernignore @@ -10,4 +10,5 @@ legacy src/square/core/api_error.py src/square/utils/webhooks_helper.py tests/integration -README.md \ No newline at end of file +README.md +changelog.md diff --git a/.gitignore b/.gitignore index d2e4ca80..0da665fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ +dist/ .mypy_cache/ -.ruff_cache/ __pycache__/ -dist/ poetry.toml +.ruff_cache/ diff --git a/LICENSE b/LICENSE index f5669d1d..878ffc14 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Square. +Copyright (c) 2026 Square. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/changelog.md b/changelog.md new file mode 100644 index 00000000..aa5a5e17 --- /dev/null +++ b/changelog.md @@ -0,0 +1,4 @@ +## 43.2.2 - 2026-01-16 +* SDK regeneration +* Unable to analyze changes with AI, incrementing PATCH version. + diff --git a/poetry.lock b/poetry.lock index 9decbf87..a2cc654c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.11.12" +version = "2026.1.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"}, - {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"}, + {file = "certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c"}, + {file = "certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120"}, ] [[package]] @@ -75,20 +75,6 @@ typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} [package.extras] test = ["pytest (>=6)"] -[[package]] -name = "execnet" -version = "2.1.2" -description = "execnet: rapid multi-Python deployment" -optional = false -python-versions = ">=3.8" -files = [ - {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"}, - {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"}, -] - -[package.extras] -testing = ["hatch", "pre-commit", "pytest", "tox"] - [[package]] name = "h11" version = "0.16.0" @@ -172,55 +158,48 @@ files = [ [[package]] name = "mypy" -version = "1.13.0" +version = "1.0.1" description = "Optional static typing for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.7" files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, + {file = "mypy-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:71a808334d3f41ef011faa5a5cd8153606df5fc0b56de5b2e89566c8093a0c9a"}, + {file = "mypy-1.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:920169f0184215eef19294fa86ea49ffd4635dedfdea2b57e45cb4ee85d5ccaf"}, + {file = "mypy-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27a0f74a298769d9fdc8498fcb4f2beb86f0564bcdb1a37b58cbbe78e55cf8c0"}, + {file = "mypy-1.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:65b122a993d9c81ea0bfde7689b3365318a88bde952e4dfa1b3a8b4ac05d168b"}, + {file = "mypy-1.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:5deb252fd42a77add936b463033a59b8e48eb2eaec2976d76b6878d031933fe4"}, + {file = "mypy-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2013226d17f20468f34feddd6aae4635a55f79626549099354ce641bc7d40262"}, + {file = "mypy-1.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:48525aec92b47baed9b3380371ab8ab6e63a5aab317347dfe9e55e02aaad22e8"}, + {file = "mypy-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c96b8a0c019fe29040d520d9257d8c8f122a7343a8307bf8d6d4a43f5c5bfcc8"}, + {file = "mypy-1.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:448de661536d270ce04f2d7dddaa49b2fdba6e3bd8a83212164d4174ff43aa65"}, + {file = "mypy-1.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:d42a98e76070a365a1d1c220fcac8aa4ada12ae0db679cb4d910fabefc88b994"}, + {file = "mypy-1.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e64f48c6176e243ad015e995de05af7f22bbe370dbb5b32bd6988438ec873919"}, + {file = "mypy-1.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fdd63e4f50e3538617887e9aee91855368d9fc1dea30da743837b0df7373bc4"}, + {file = "mypy-1.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dbeb24514c4acbc78d205f85dd0e800f34062efcc1f4a4857c57e4b4b8712bff"}, + {file = "mypy-1.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a2948c40a7dd46c1c33765718936669dc1f628f134013b02ff5ac6c7ef6942bf"}, + {file = "mypy-1.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bc8d6bd3b274dd3846597855d96d38d947aedba18776aa998a8d46fabdaed76"}, + {file = "mypy-1.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:17455cda53eeee0a4adb6371a21dd3dbf465897de82843751cf822605d152c8c"}, + {file = "mypy-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e831662208055b006eef68392a768ff83596035ffd6d846786578ba1714ba8f6"}, + {file = "mypy-1.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e60d0b09f62ae97a94605c3f73fd952395286cf3e3b9e7b97f60b01ddfbbda88"}, + {file = "mypy-1.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:0af4f0e20706aadf4e6f8f8dc5ab739089146b83fd53cb4a7e0e850ef3de0bb6"}, + {file = "mypy-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:24189f23dc66f83b839bd1cce2dfc356020dfc9a8bae03978477b15be61b062e"}, + {file = "mypy-1.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:93a85495fb13dc484251b4c1fd7a5ac370cd0d812bbfc3b39c1bafefe95275d5"}, + {file = "mypy-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f546ac34093c6ce33f6278f7c88f0f147a4849386d3bf3ae193702f4fe31407"}, + {file = "mypy-1.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c6c2ccb7af7154673c591189c3687b013122c5a891bb5651eca3db8e6c6c55bd"}, + {file = "mypy-1.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:15b5a824b58c7c822c51bc66308e759243c32631896743f030daf449fe3677f3"}, + {file = "mypy-1.0.1-py3-none-any.whl", hash = "sha256:eda5c8b9949ed411ff752b9a01adda31afe7eae1e53e946dbdf9db23865e66c4"}, + {file = "mypy-1.0.1.tar.gz", hash = "sha256:28cea5a6392bb43d266782983b5a4216c25544cd7d80be681a155ddcdafd152d"}, ] [package.dependencies] -mypy-extensions = ">=1.0.0" +mypy-extensions = ">=0.4.3" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" +typing-extensions = ">=3.10" [package.extras] dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] install-types = ["pip"] -mypyc = ["setuptools (>=50)"] +python2 = ["typed-ast (>=1.4.0,<2)"] reports = ["lxml"] [[package]] @@ -432,26 +411,6 @@ pytest = ">=7.0.0,<9" docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] -[[package]] -name = "pytest-xdist" -version = "3.6.1" -description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, - {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, -] - -[package.dependencies] -execnet = ">=2.1" -pytest = ">=7.0.0" - -[package.extras] -psutil = ["psutil (>=3.0)"] -setproctitle = ["setproctitle"] -testing = ["filelock"] - [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -468,29 +427,29 @@ six = ">=1.5" [[package]] name = "ruff" -version = "0.11.5" +version = "0.5.7" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, - {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, - {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"}, - {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"}, - {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"}, - {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"}, - {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"}, + {file = "ruff-0.5.7-py3-none-linux_armv6l.whl", hash = "sha256:548992d342fc404ee2e15a242cdbea4f8e39a52f2e7752d0e4cbe88d2d2f416a"}, + {file = "ruff-0.5.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:00cc8872331055ee017c4f1071a8a31ca0809ccc0657da1d154a1d2abac5c0be"}, + {file = "ruff-0.5.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:eaf3d86a1fdac1aec8a3417a63587d93f906c678bb9ed0b796da7b59c1114a1e"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a01c34400097b06cf8a6e61b35d6d456d5bd1ae6961542de18ec81eaf33b4cb8"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fcc8054f1a717e2213500edaddcf1dbb0abad40d98e1bd9d0ad364f75c763eea"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7f70284e73f36558ef51602254451e50dd6cc479f8b6f8413a95fcb5db4a55fc"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:a78ad870ae3c460394fc95437d43deb5c04b5c29297815a2a1de028903f19692"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9ccd078c66a8e419475174bfe60a69adb36ce04f8d4e91b006f1329d5cd44bcf"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e31c9bad4ebf8fdb77b59cae75814440731060a09a0e0077d559a556453acbb"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d796327eed8e168164346b769dd9a27a70e0298d667b4ecee6877ce8095ec8e"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4a09ea2c3f7778cc635e7f6edf57d566a8ee8f485f3c4454db7771efb692c499"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a36d8dcf55b3a3bc353270d544fb170d75d2dff41eba5df57b4e0b67a95bb64e"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9369c218f789eefbd1b8d82a8cf25017b523ac47d96b2f531eba73770971c9e5"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b88ca3db7eb377eb24fb7c82840546fb7acef75af4a74bd36e9ceb37a890257e"}, + {file = "ruff-0.5.7-py3-none-win32.whl", hash = "sha256:33d61fc0e902198a3e55719f4be6b375b28f860b09c281e4bdbf783c0566576a"}, + {file = "ruff-0.5.7-py3-none-win_amd64.whl", hash = "sha256:083bbcbe6fadb93cd86709037acc510f86eed5a314203079df174c40bbbca6b3"}, + {file = "ruff-0.5.7-py3-none-win_arm64.whl", hash = "sha256:2dca26154ff9571995107221d0aeaad0e75a77b5a682d6236cf89a58c70b76f4"}, + {file = "ruff-0.5.7.tar.gz", hash = "sha256:8dfc0a458797f5d9fb622dd0efc52d796f23f0a1493a9527f4e49a550ae9a7e5"}, ] [[package]] @@ -517,53 +476,58 @@ files = [ [[package]] name = "tomli" -version = "2.3.0" +version = "2.4.0" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, - {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"}, - {file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"}, - {file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"}, - {file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"}, - {file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"}, - {file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"}, - {file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"}, - {file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"}, - {file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"}, - {file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"}, - {file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"}, - {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, - {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, + {file = "tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867"}, + {file = "tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9"}, + {file = "tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95"}, + {file = "tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76"}, + {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d"}, + {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576"}, + {file = "tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a"}, + {file = "tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa"}, + {file = "tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614"}, + {file = "tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1"}, + {file = "tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8"}, + {file = "tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a"}, + {file = "tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1"}, + {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b"}, + {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51"}, + {file = "tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729"}, + {file = "tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da"}, + {file = "tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3"}, + {file = "tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0"}, + {file = "tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e"}, + {file = "tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4"}, + {file = "tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e"}, + {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c"}, + {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f"}, + {file = "tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86"}, + {file = "tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87"}, + {file = "tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132"}, + {file = "tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6"}, + {file = "tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc"}, + {file = "tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66"}, + {file = "tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d"}, + {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702"}, + {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8"}, + {file = "tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776"}, + {file = "tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475"}, + {file = "tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2"}, + {file = "tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9"}, + {file = "tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0"}, + {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df"}, + {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d"}, + {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f"}, + {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b"}, + {file = "tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087"}, + {file = "tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd"}, + {file = "tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4"}, + {file = "tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a"}, + {file = "tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c"}, ] [[package]] @@ -591,4 +555,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "bcf31a142c86d9e556553c8c260a93b563ac64a043076dbd48b26111d422c26e" +content-hash = "6f6c191c1028d17a97fdfa84cedfd3cef94b5d63d98b8c1d333b3398eeea9055" diff --git a/pyproject.toml b/pyproject.toml index 64fe2625..c1705b9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "squareup" [tool.poetry] name = "squareup" -version = "43.2.1.20251016" +version = "43.2.2" description = "" readme = "README.md" authors = [] @@ -31,24 +31,23 @@ packages = [ { include = "square", from = "src"} ] -[tool.poetry.urls] +[project.urls] Repository = 'https://github.com/square/square-python-sdk' [tool.poetry.dependencies] python = "^3.8" httpx = ">=0.21.2" pydantic = ">= 1.9.2" -pydantic-core = ">=2.18.2" +pydantic-core = "^2.18.2" typing_extensions = ">= 4.0.0" -[tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" +[tool.poetry.dev-dependencies] +mypy = "1.0.1" pytest = "^7.4.0" pytest-asyncio = "^0.23.5" -pytest-xdist = "^3.6.1" python-dateutil = "^2.9.0" types-python-dateutil = "^2.9.0.20240316" -ruff = "==0.11.5" +ruff = "^0.5.6" [tool.pytest.ini_options] testpaths = [ "tests" ] @@ -60,26 +59,6 @@ plugins = ["pydantic.mypy"] [tool.ruff] line-length = 120 -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "F", # pyflakes - "I", # isort -] -ignore = [ - "E402", # Module level import not at top of file - "E501", # Line too long - "E711", # Comparison to `None` should be `cond is not None` - "E712", # Avoid equality comparisons to `True`; use `if ...:` checks - "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks - "E722", # Do not use bare `except` - "E731", # Do not assign a `lambda` expression, use a `def` - "F821", # Undefined name - "F841" # Local variable ... is assigned to but never used -] - -[tool.ruff.lint.isort] -section-order = ["future", "standard-library", "third-party", "first-party"] [build-system] requires = ["poetry-core"] diff --git a/reference.md b/reference.md index d42bf0f8..48a1fc5d 100644 --- a/reference.md +++ b/reference.md @@ -2673,34 +2673,10 @@ client.catalog.batch_upsert( batches=[ { "objects": [ - { - "type": "IMAGE", - "id": "#Tea", - "present_at_all_locations": True, - }, - { - "type": "IMAGE", - "id": "#Coffee", - "present_at_all_locations": True, - }, - { - "type": "ITEM", - "id": "#Beverages", - "present_at_all_locations": True, - }, - { - "type": "TAX", - "id": "#SalesTax", - "present_at_all_locations": True, - "tax_data": { - "name": "Sales Tax", - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "inclusion_type": "ADDITIVE", - "percentage": "5.0", - "applies_to_custom_amounts": True, - "enabled": True, - }, - }, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "TAX"}, ] } ], @@ -3522,261 +3498,6 @@ At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. - - - - -## Channels -
client.channels.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -response = client.channels.list( - reference_type="UNKNOWN_TYPE", - reference_id="reference_id", - status="ACTIVE", - cursor="cursor", - limit=1, -) -for item in response: - yield item -# alternatively, you can paginate page-by-page -for page in response.iter_pages(): - yield page - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**reference_type:** `typing.Optional[ReferenceType]` — Type of reference associated to channel - -
-
- -
-
- -**reference_id:** `typing.Optional[str]` — id of reference associated to channel - -
-
- -
-
- -**status:** `typing.Optional[ChannelStatus]` — Status of channel - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Cursor to fetch the next result - -
-
- -
-
- -**limit:** `typing.Optional[int]` - -Maximum number of results to return. -When not provided the returned results will be cap at 100 channels. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.channels.bulk_retrieve(...) -
-
- -#### 📝 Description - -
-
- -
-
- - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.channels.bulk_retrieve( - channel_ids=["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**channel_ids:** `typing.Sequence[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.channels.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.channels.get( - channel_id="channel_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**channel_id:** `str` — A channel id - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- -
@@ -12409,7 +12130,7 @@ for page in response.iter_pages(): **begin_time:** `typing.Optional[str]` -Indicates the start of the time range to retrieve payments for, in RFC 3339 format. +Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `created_at` field for each Payment. Inclusive. Default: The current time minus one year. @@ -12421,7 +12142,7 @@ Inclusive. Default: The current time minus one year. **end_time:** `typing.Optional[str]` -Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The +Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `created_at` field for each Payment. Default: The current time. @@ -12660,7 +12381,7 @@ This could be a payment token generated by the Web Payments SDK for any of its [supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods), including cards, bank transfers, Afterpay or Cash App Pay. If recording a payment that the seller received outside of Square, specify either "CASH" or "EXTERNAL". -For more information, see +For more information, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). @@ -12748,10 +12469,10 @@ For more information, see [Permissions](https://developer.squareup.com/docs/paym **delay_duration:** `typing.Optional[str]` -The duration of time after the payment's creation when Square automatically -either completes or cancels the payment depending on the `delay_action` field value. -For more information, see -[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). +The duration of time after the payment's creation when Square automatically +either completes or cancels the payment depending on the `delay_action` field value. +For more information, see +[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). This parameter should be specified as a time duration, in RFC 3339 format. @@ -12772,8 +12493,8 @@ Default: **delay_action:** `typing.Optional[str]` The action to be applied to the payment when the `delay_duration` has elapsed. The action must be -CANCEL or COMPLETE. For more information, see -[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). +CANCEL or COMPLETE. For more information, see +[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). Default: CANCEL @@ -12831,7 +12552,7 @@ used. **team_member_id:** `typing.Optional[str]` -An optional [TeamMember](entity:TeamMember) ID to associate with +An optional [TeamMember](entity:TeamMember) ID to associate with this payment. @@ -12844,7 +12565,7 @@ this payment. A user-defined ID to associate with the payment. -You can use this field to associate the payment to an entity in an external system +You can use this field to associate the payment to an entity in an external system (for example, you might specify an order ID that is generated by a third-party shopping cart). @@ -13378,8 +13099,8 @@ client.payments.complete( **version_token:** `typing.Optional[str]` -Used for optimistic concurrency. This opaque token identifies the current `Payment` -version that the caller expects. If the server has a different version of the Payment, +Used for optimistic concurrency. This opaque token identifies the current `Payment` +version that the caller expects. If the server has a different version of the Payment, the update fails and a response with a VERSION_MISMATCH error is returned. @@ -14693,7 +14414,7 @@ If the cancellation date is earlier than the end date of a subscription cycle, t at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` -occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription +occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription stops through the end of the last cycle. @@ -16980,828 +16701,6 @@ client.terminal.dismiss_terminal_refund( - - - - -## TransferOrders -
client.transfer_orders.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent -to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. -The source and destination locations must be different and must belong to your Square account. - -In [DRAFT](entity:TransferOrderStatus) status, you can: -- Add or remove items -- Modify quantities -- Update shipping information -- Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - -The request requires source_location_id and destination_location_id. -Inventory levels are not affected until the order is started via -[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - -Common integration points: -- Sync with warehouse management systems -- Automate regular stock transfers -- Initialize transfers from inventory optimization systems - -Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.create( - idempotency_key="65cc0586-3e82-384s-b524-3885cffd52", - transfer_order={ - "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", - "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", - "expected_at": "2025-11-09T05:00:00Z", - "notes": "Example transfer order for inventory redistribution between locations", - "tracking_number": "TRACK123456789", - "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", - "line_items": [ - { - "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", - "quantity_ordered": "5", - }, - { - "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", - "quantity_ordered": "3", - }, - ], - }, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**idempotency_key:** `str` - -A unique string that identifies this CreateTransferOrder request. Keys can be -any valid string but must be unique for every CreateTransferOrder request. - -
-
- -
-
- -**transfer_order:** `CreateTransferOrderDataParams` — The transfer order to create - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.search(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Searches for transfer orders using filters. Returns a paginated list of matching -[TransferOrder](entity:TransferOrder)s sorted by creation date. - -Common search scenarios: -- Find orders for a source [Location](entity:Location) -- Find orders for a destination [Location](entity:Location) -- Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -response = client.transfer_orders.search( - query={ - "filter": { - "source_location_ids": ["EXAMPLE_SOURCE_LOCATION_ID_123"], - "destination_location_ids": ["EXAMPLE_DEST_LOCATION_ID_456"], - "statuses": ["STARTED", "PARTIALLY_RECEIVED"], - }, - "sort": {"field": "UPDATED_AT", "order": "DESC"}, - }, - cursor="eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit=10, -) -for item in response: - yield item -# alternatively, you can paginate page-by-page -for page in response.iter_pages(): - yield page - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**query:** `typing.Optional[TransferOrderQueryParams]` — The search query - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Pagination cursor from a previous search response - -
-
- -
-
- -**limit:** `typing.Optional[int]` — Maximum number of results to return (1-100) - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete -order details including: - -- Basic information (status, dates, notes) -- Line items with ordered and received quantities -- Source and destination [Location](entity:Location)s -- Tracking information (if available) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.get( - transfer_order_id="transfer_order_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transfer_order_id:** `str` — The ID of the transfer order to retrieve - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates an existing transfer order. This endpoint supports sparse updates, -allowing you to modify specific fields without affecting others. - -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.update( - transfer_order_id="transfer_order_id", - idempotency_key="f47ac10b-58cc-4372-a567-0e02b2c3d479", - transfer_order={ - "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_789", - "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_101", - "expected_at": "2025-11-10T08:00:00Z", - "notes": "Updated: Priority transfer due to low stock at destination", - "tracking_number": "TRACK987654321", - "line_items": [ - {"uid": "1", "quantity_ordered": "7"}, - { - "item_variation_id": "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - "quantity_ordered": "2", - }, - {"uid": "2", "remove": True}, - ], - }, - version=1753109537351, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transfer_order_id:** `str` — The ID of the transfer order to update - -
-
- -
-
- -**idempotency_key:** `str` — A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores - -
-
- -
-
- -**transfer_order:** `UpdateTransferOrderDataParams` — The transfer order updates to apply - -
-
- -
-
- -**version:** `typing.Optional[int]` — Version for optimistic concurrency - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. -Only draft orders can be deleted. Once an order is started via -[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. - -Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.delete( - transfer_order_id="transfer_order_id", - version=1000000, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transfer_order_id:** `str` — The ID of the transfer order to delete - -
-
- -
-
- -**version:** `typing.Optional[int]` — Version for optimistic concurrency - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.cancel(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or -[PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no -longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. - -Common reasons for cancellation: -- Items no longer needed at destination -- Source location needs the inventory -- Order created in error - -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.cancel( - transfer_order_id="transfer_order_id", - idempotency_key="65cc0586-3e82-4d08-b524-3885cffd52", - version=1753117449752, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transfer_order_id:** `str` — The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. - -
-
- -
-
- -**idempotency_key:** `str` - -A unique string that identifies this UpdateTransferOrder request. Keys can be -any valid string but must be unique for every UpdateTransferOrder request. - -
-
- -
-
- -**version:** `typing.Optional[int]` — Version for optimistic concurrency - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.receive(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. -This endpoint supports partial receiving - you can receive items in multiple batches. - -For each line item, you can specify: -- Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) -- Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) -- Quantity canceled (returned to source location's inventory) - -The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. -Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. -Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - -When all items are either received, damaged, or canceled, the order moves to -[COMPLETED](entity:TransferOrderStatus) status. - -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.receive( - transfer_order_id="transfer_order_id", - idempotency_key="EXAMPLE_IDEMPOTENCY_KEY_101", - receipt={ - "line_items": [ - { - "transfer_order_line_uid": "transfer_order_line_uid", - "quantity_received": "3", - "quantity_damaged": "1", - "quantity_canceled": "1", - }, - { - "transfer_order_line_uid": "transfer_order_line_uid", - "quantity_received": "2", - "quantity_canceled": "1", - }, - ] - }, - version=1753118664873, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transfer_order_id:** `str` — The ID of the transfer order to receive items for - -
-
- -
-
- -**idempotency_key:** `str` — A unique key to make this request idempotent - -
-
- -
-
- -**receipt:** `TransferOrderGoodsReceiptParams` — The receipt details - -
-
- -
-
- -**version:** `typing.Optional[int]` — Version for optimistic concurrency - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.transfer_orders.start(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. -This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - -The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. -Once started, the order can no longer be deleted, but it can be canceled via -[CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from square import Square - -client = Square( - token="YOUR_TOKEN", -) -client.transfer_orders.start( - transfer_order_id="transfer_order_id", - idempotency_key="EXAMPLE_IDEMPOTENCY_KEY_789", - version=1753109537351, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transfer_order_id:** `str` — The ID of the transfer order to start. Must be in DRAFT status. - -
-
- -
-
- -**idempotency_key:** `str` - -A unique string that identifies this UpdateTransferOrder request. Keys can be -any valid string but must be unique for every UpdateTransferOrder request. - -
-
- -
-
- -**version:** `typing.Optional[int]` — Version for optimistic concurrency - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- -
@@ -20266,7 +19165,7 @@ client = Square( ) client.catalog.object.upsert( idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae", - object={"type": "IMAGE", "id": "#Cocoa"}, + object={"id": "id", "type": "ITEM"}, ) ``` diff --git a/requirements.txt b/requirements.txt index e80f640a..f502f1b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ httpx>=0.21.2 pydantic>= 1.9.2 -pydantic-core>=2.18.2 +pydantic-core==^2.18.2 typing_extensions>= 4.0.0 diff --git a/src/square/__init__.py b/src/square/__init__.py index 944db404..33d63e6f 100644 --- a/src/square/__init__.py +++ b/src/square/__init__.py @@ -1,114 +1,43 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import ( - apple_pay, - bank_accounts, - bookings, - cards, - cash_drawers, - catalog, - channels, - checkout, - customers, - devices, - disputes, - employees, - events, - gift_cards, - inventory, - invoices, - labor, - locations, - loyalty, - merchants, - mobile, - o_auth, - orders, - payments, - payouts, - refunds, - sites, - snippets, - subscriptions, - team, - team_members, - terminal, - transfer_orders, - v1transactions, - vendors, - webhooks, - ) - from .client import AsyncSquare, Square - from .version import __version__ -_dynamic_imports: typing.Dict[str, str] = { - "AsyncSquare": ".client", - "Square": ".client", - "__version__": ".version", - "apple_pay": ".apple_pay", - "bank_accounts": ".bank_accounts", - "bookings": ".bookings", - "cards": ".cards", - "cash_drawers": ".cash_drawers", - "catalog": ".catalog", - "channels": ".channels", - "checkout": ".checkout", - "customers": ".customers", - "devices": ".devices", - "disputes": ".disputes", - "employees": ".employees", - "events": ".events", - "gift_cards": ".gift_cards", - "inventory": ".inventory", - "invoices": ".invoices", - "labor": ".labor", - "locations": ".locations", - "loyalty": ".loyalty", - "merchants": ".merchants", - "mobile": ".mobile", - "o_auth": ".o_auth", - "orders": ".orders", - "payments": ".payments", - "payouts": ".payouts", - "refunds": ".refunds", - "sites": ".sites", - "snippets": ".snippets", - "subscriptions": ".subscriptions", - "team": ".team", - "team_members": ".team_members", - "terminal": ".terminal", - "transfer_orders": ".transfer_orders", - "v1transactions": ".v1transactions", - "vendors": ".vendors", - "webhooks": ".webhooks", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import ( + apple_pay, + bank_accounts, + bookings, + cards, + cash_drawers, + catalog, + checkout, + customers, + devices, + disputes, + employees, + events, + gift_cards, + inventory, + invoices, + labor, + locations, + loyalty, + merchants, + mobile, + o_auth, + orders, + payments, + payouts, + refunds, + sites, + snippets, + subscriptions, + team, + team_members, + terminal, + v1transactions, + vendors, + webhooks, +) +from .client import AsyncSquare, Square +from .version import __version__ __all__ = [ "AsyncSquare", @@ -120,7 +49,6 @@ def __dir__(): "cards", "cash_drawers", "catalog", - "channels", "checkout", "customers", "devices", @@ -146,7 +74,6 @@ def __dir__(): "team", "team_members", "terminal", - "transfer_orders", "v1transactions", "vendors", "webhooks", diff --git a/src/square/apple_pay/__init__.py b/src/square/apple_pay/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/apple_pay/__init__.py +++ b/src/square/apple_pay/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/apple_pay/client.py b/src/square/apple_pay/client.py index 6dd11b9c..e2179ebc 100644 --- a/src/square/apple_pay/client.py +++ b/src/square/apple_pay/client.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawApplePayClient from ..core.request_options import RequestOptions from ..types.register_domain_response import RegisterDomainResponse -from .raw_client import AsyncRawApplePayClient, RawApplePayClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawApplePayClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -69,8 +70,8 @@ def register_domain( domain_name="example.com", ) """ - _response = self._raw_client.register_domain(domain_name=domain_name, request_options=request_options) - return _response.data + response = self._raw_client.register_domain(domain_name=domain_name, request_options=request_options) + return response.data class AsyncApplePayClient: @@ -139,5 +140,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.register_domain(domain_name=domain_name, request_options=request_options) - return _response.data + response = await self._raw_client.register_domain(domain_name=domain_name, request_options=request_options) + return response.data diff --git a/src/square/apple_pay/raw_client.py b/src/square/apple_pay/raw_client.py index f4192cfa..a0afefc9 100644 --- a/src/square/apple_pay/raw_client.py +++ b/src/square/apple_pay/raw_client.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.http_response import HttpResponse from ..types.register_domain_response import RegisterDomainResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -74,8 +75,8 @@ def register_domain( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawApplePayClient: @@ -138,5 +139,5 @@ async def register_domain( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/bank_accounts/__init__.py b/src/square/bank_accounts/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/bank_accounts/__init__.py +++ b/src/square/bank_accounts/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/bank_accounts/client.py b/src/square/bank_accounts/client.py index bb738b1b..dd364c8a 100644 --- a/src/square/bank_accounts/client.py +++ b/src/square/bank_accounts/client.py @@ -1,15 +1,20 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawBankAccountsClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager from ..types.bank_account import BankAccount +from ..types.list_bank_accounts_response import ListBankAccountsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.get_bank_account_by_v1id_response import GetBankAccountByV1IdResponse from ..types.get_bank_account_response import GetBankAccountResponse -from ..types.list_bank_accounts_response import ListBankAccountsResponse -from .raw_client import AsyncRawBankAccountsClient, RawBankAccountsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawBankAccountsClient +from ..core.pagination import AsyncPager class BankAccountsClient: @@ -34,7 +39,7 @@ def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[BankAccount, ListBankAccountsResponse]: + ) -> SyncPager[BankAccount]: """ Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. @@ -61,7 +66,7 @@ def list( Returns ------- - SyncPager[BankAccount, ListBankAccountsResponse] + SyncPager[BankAccount] Success Examples @@ -82,9 +87,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, limit=limit, location_id=location_id, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/bank-accounts", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + "location_id": location_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBankAccountsResponse, + construct_type( + type_=ListBankAccountsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.bank_accounts + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_by_v1id( self, v1bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -117,8 +152,8 @@ def get_by_v1id( v1bank_account_id="v1_bank_account_id", ) """ - _response = self._raw_client.get_by_v1id(v1bank_account_id, request_options=request_options) - return _response.data + response = self._raw_client.get_by_v1id(v1bank_account_id, request_options=request_options) + return response.data def get( self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -151,8 +186,8 @@ def get( bank_account_id="bank_account_id", ) """ - _response = self._raw_client.get(bank_account_id, request_options=request_options) - return _response.data + response = self._raw_client.get(bank_account_id, request_options=request_options) + return response.data class AsyncBankAccountsClient: @@ -177,7 +212,7 @@ async def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[BankAccount, ListBankAccountsResponse]: + ) -> AsyncPager[BankAccount]: """ Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. @@ -204,7 +239,7 @@ async def list( Returns ------- - AsyncPager[BankAccount, ListBankAccountsResponse] + AsyncPager[BankAccount] Success Examples @@ -226,7 +261,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -234,9 +268,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, limit=limit, location_id=location_id, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/bank-accounts", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + "location_id": location_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBankAccountsResponse, + construct_type( + type_=ListBankAccountsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.bank_accounts + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_by_v1id( self, v1bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -277,8 +341,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_by_v1id(v1bank_account_id, request_options=request_options) - return _response.data + response = await self._raw_client.get_by_v1id(v1bank_account_id, request_options=request_options) + return response.data async def get( self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -319,5 +383,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(bank_account_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(bank_account_id, request_options=request_options) + return response.data diff --git a/src/square/bank_accounts/raw_client.py b/src/square/bank_accounts/raw_client.py index 0b79ce9b..079fc0c0 100644 --- a/src/square/bank_accounts/raw_client.py +++ b/src/square/bank_accounts/raw_client.py @@ -1,96 +1,23 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type -from ..types.bank_account import BankAccount +from ..core.http_response import HttpResponse from ..types.get_bank_account_by_v1id_response import GetBankAccountByV1IdResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.get_bank_account_response import GetBankAccountResponse -from ..types.list_bank_accounts_response import ListBankAccountsResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawBankAccountsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[BankAccount, ListBankAccountsResponse]: - """ - Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. - - Parameters - ---------- - cursor : typing.Optional[str] - The pagination cursor returned by a previous call to this endpoint. - Use it in the next `ListBankAccounts` request to retrieve the next set - of results. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - limit : typing.Optional[int] - Upper limit on the number of bank accounts to return in the response. - Currently, 1000 is the largest supported limit. You can specify a limit - of up to 1000 bank accounts. This is also the default limit. - - location_id : typing.Optional[str] - Location ID. You can specify this optional filter - to retrieve only the linked bank accounts belonging to a specific location. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[BankAccount, ListBankAccountsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/bank-accounts", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBankAccountsResponse, - construct_type( - type_=ListBankAccountsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.bank_accounts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - limit=limit, - location_id=location_id, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get_by_v1id( self, v1bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetBankAccountByV1IdResponse]: @@ -128,8 +55,8 @@ def get_by_v1id( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -168,88 +95,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawBankAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[BankAccount, ListBankAccountsResponse]: - """ - Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. - - Parameters - ---------- - cursor : typing.Optional[str] - The pagination cursor returned by a previous call to this endpoint. - Use it in the next `ListBankAccounts` request to retrieve the next set - of results. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - limit : typing.Optional[int] - Upper limit on the number of bank accounts to return in the response. - Currently, 1000 is the largest supported limit. You can specify a limit - of up to 1000 bank accounts. This is also the default limit. - - location_id : typing.Optional[str] - Location ID. You can specify this optional filter - to retrieve only the linked bank accounts belonging to a specific location. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[BankAccount, ListBankAccountsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/bank-accounts", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBankAccountsResponse, - construct_type( - type_=ListBankAccountsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.bank_accounts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - limit=limit, - location_id=location_id, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get_by_v1id( self, v1bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetBankAccountByV1IdResponse]: @@ -287,8 +140,8 @@ async def get_by_v1id( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -327,5 +180,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/bookings/__init__.py b/src/square/bookings/__init__.py index 4226d9ab..1dd96f75 100644 --- a/src/square/bookings/__init__.py +++ b/src/square/bookings/__init__.py @@ -1,39 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import custom_attribute_definitions, custom_attributes, location_profiles, team_member_profiles -_dynamic_imports: typing.Dict[str, str] = { - "custom_attribute_definitions": ".custom_attribute_definitions", - "custom_attributes": ".custom_attributes", - "location_profiles": ".location_profiles", - "team_member_profiles": ".team_member_profiles", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import custom_attribute_definitions, custom_attributes, location_profiles, team_member_profiles __all__ = ["custom_attribute_definitions", "custom_attributes", "location_profiles", "team_member_profiles"] diff --git a/src/square/bookings/client.py b/src/square/bookings/client.py index 724f37a5..685747fa 100644 --- a/src/square/bookings/client.py +++ b/src/square/bookings/client.py @@ -1,35 +1,38 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawBookingsClient +from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient +from .custom_attributes.client import CustomAttributesClient +from .location_profiles.client import LocationProfilesClient +from .team_member_profiles.client import TeamMemberProfilesClient from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager +from ..types.booking import Booking +from ..types.list_bookings_response import ListBookingsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.booking import BookingParams +from ..types.create_booking_response import CreateBookingResponse from ..requests.search_availability_query import SearchAvailabilityQueryParams -from ..types.booking import Booking +from ..types.search_availability_response import SearchAvailabilityResponse from ..types.bulk_retrieve_bookings_response import BulkRetrieveBookingsResponse -from ..types.bulk_retrieve_team_member_booking_profiles_response import BulkRetrieveTeamMemberBookingProfilesResponse -from ..types.cancel_booking_response import CancelBookingResponse -from ..types.create_booking_response import CreateBookingResponse -from ..types.get_booking_response import GetBookingResponse from ..types.get_business_booking_profile_response import GetBusinessBookingProfileResponse -from ..types.list_bookings_response import ListBookingsResponse from ..types.retrieve_location_booking_profile_response import RetrieveLocationBookingProfileResponse -from ..types.search_availability_response import SearchAvailabilityResponse +from ..types.bulk_retrieve_team_member_booking_profiles_response import BulkRetrieveTeamMemberBookingProfilesResponse +from ..types.get_booking_response import GetBookingResponse from ..types.update_booking_response import UpdateBookingResponse -from .raw_client import AsyncRawBookingsClient, RawBookingsClient - -if typing.TYPE_CHECKING: - from .custom_attribute_definitions.client import ( - AsyncCustomAttributeDefinitionsClient, - CustomAttributeDefinitionsClient, - ) - from .custom_attributes.client import AsyncCustomAttributesClient, CustomAttributesClient - from .location_profiles.client import AsyncLocationProfilesClient, LocationProfilesClient - from .team_member_profiles.client import AsyncTeamMemberProfilesClient, TeamMemberProfilesClient +from ..types.cancel_booking_response import CancelBookingResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawBookingsClient +from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient +from .custom_attributes.client import AsyncCustomAttributesClient +from .location_profiles.client import AsyncLocationProfilesClient +from .team_member_profiles.client import AsyncTeamMemberProfilesClient +from ..core.pagination import AsyncPager + # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -37,11 +40,13 @@ class BookingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawBookingsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[CustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[CustomAttributesClient] = None - self._location_profiles: typing.Optional[LocationProfilesClient] = None - self._team_member_profiles: typing.Optional[TeamMemberProfilesClient] = None + self.custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = CustomAttributesClient(client_wrapper=client_wrapper) + + self.location_profiles = LocationProfilesClient(client_wrapper=client_wrapper) + + self.team_member_profiles = TeamMemberProfilesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawBookingsClient: @@ -65,7 +70,7 @@ def list( start_at_min: typing.Optional[str] = None, start_at_max: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Booking, ListBookingsResponse]: + ) -> SyncPager[Booking]: """ Retrieve a collection of bookings. @@ -100,7 +105,7 @@ def list( Returns ------- - SyncPager[Booking, ListBookingsResponse] + SyncPager[Booking] Success Examples @@ -125,16 +130,47 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - limit=limit, - cursor=cursor, - customer_id=customer_id, - team_member_id=team_member_id, - location_id=location_id, - start_at_min=start_at_min, - start_at_max=start_at_max, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "customer_id": customer_id, + "team_member_id": team_member_id, + "location_id": location_id, + "start_at_min": start_at_min, + "start_at_max": start_at_max, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBookingsResponse, + construct_type( + type_=ListBookingsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + customer_id=customer_id, + team_member_id=team_member_id, + location_id=location_id, + start_at_min=start_at_min, + start_at_max=start_at_max, + request_options=request_options, + ) + _items = _parsed_response.bookings + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -186,10 +222,10 @@ def create( booking={}, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( booking=booking, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search_availability( self, *, query: SearchAvailabilityQueryParams, request_options: typing.Optional[RequestOptions] = None @@ -224,8 +260,8 @@ def search_availability( query={"filter": {"start_at_range": {}}}, ) """ - _response = self._raw_client.search_availability(query=query, request_options=request_options) - return _response.data + response = self._raw_client.search_availability(query=query, request_options=request_options) + return response.data def bulk_retrieve_bookings( self, *, booking_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -260,8 +296,8 @@ def bulk_retrieve_bookings( booking_ids=["booking_ids"], ) """ - _response = self._raw_client.bulk_retrieve_bookings(booking_ids=booking_ids, request_options=request_options) - return _response.data + response = self._raw_client.bulk_retrieve_bookings(booking_ids=booking_ids, request_options=request_options) + return response.data def get_business_profile( self, *, request_options: typing.Optional[RequestOptions] = None @@ -288,8 +324,8 @@ def get_business_profile( ) client.bookings.get_business_profile() """ - _response = self._raw_client.get_business_profile(request_options=request_options) - return _response.data + response = self._raw_client.get_business_profile(request_options=request_options) + return response.data def retrieve_location_booking_profile( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -321,8 +357,8 @@ def retrieve_location_booking_profile( location_id="location_id", ) """ - _response = self._raw_client.retrieve_location_booking_profile(location_id, request_options=request_options) - return _response.data + response = self._raw_client.retrieve_location_booking_profile(location_id, request_options=request_options) + return response.data def bulk_retrieve_team_member_booking_profiles( self, *, team_member_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -354,10 +390,10 @@ def bulk_retrieve_team_member_booking_profiles( team_member_ids=["team_member_ids"], ) """ - _response = self._raw_client.bulk_retrieve_team_member_booking_profiles( + response = self._raw_client.bulk_retrieve_team_member_booking_profiles( team_member_ids=team_member_ids, request_options=request_options ) - return _response.data + return response.data def get(self, booking_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetBookingResponse: """ @@ -390,8 +426,8 @@ def get(self, booking_id: str, *, request_options: typing.Optional[RequestOption booking_id="booking_id", ) """ - _response = self._raw_client.get(booking_id, request_options=request_options) - return _response.data + response = self._raw_client.get(booking_id, request_options=request_options) + return response.data def update( self, @@ -441,10 +477,10 @@ def update( booking={}, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( booking_id, booking=booking, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def cancel( self, @@ -493,55 +529,25 @@ def cancel( booking_id="booking_id", ) """ - _response = self._raw_client.cancel( + response = self._raw_client.cancel( booking_id, idempotency_key=idempotency_key, booking_version=booking_version, request_options=request_options, ) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=self._client_wrapper) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import CustomAttributesClient # noqa: E402 - - self._custom_attributes = CustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes - - @property - def location_profiles(self): - if self._location_profiles is None: - from .location_profiles.client import LocationProfilesClient # noqa: E402 - - self._location_profiles = LocationProfilesClient(client_wrapper=self._client_wrapper) - return self._location_profiles - - @property - def team_member_profiles(self): - if self._team_member_profiles is None: - from .team_member_profiles.client import TeamMemberProfilesClient # noqa: E402 - - self._team_member_profiles = TeamMemberProfilesClient(client_wrapper=self._client_wrapper) - return self._team_member_profiles + return response.data class AsyncBookingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawBookingsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[AsyncCustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[AsyncCustomAttributesClient] = None - self._location_profiles: typing.Optional[AsyncLocationProfilesClient] = None - self._team_member_profiles: typing.Optional[AsyncTeamMemberProfilesClient] = None + self.custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = AsyncCustomAttributesClient(client_wrapper=client_wrapper) + + self.location_profiles = AsyncLocationProfilesClient(client_wrapper=client_wrapper) + + self.team_member_profiles = AsyncTeamMemberProfilesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawBookingsClient: @@ -565,7 +571,7 @@ async def list( start_at_min: typing.Optional[str] = None, start_at_max: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Booking, ListBookingsResponse]: + ) -> AsyncPager[Booking]: """ Retrieve a collection of bookings. @@ -600,7 +606,7 @@ async def list( Returns ------- - AsyncPager[Booking, ListBookingsResponse] + AsyncPager[Booking] Success Examples @@ -626,7 +632,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -634,16 +639,47 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - limit=limit, - cursor=cursor, - customer_id=customer_id, - team_member_id=team_member_id, - location_id=location_id, - start_at_min=start_at_min, - start_at_max=start_at_max, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "customer_id": customer_id, + "team_member_id": team_member_id, + "location_id": location_id, + "start_at_min": start_at_min, + "start_at_max": start_at_max, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBookingsResponse, + construct_type( + type_=ListBookingsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + customer_id=customer_id, + team_member_id=team_member_id, + location_id=location_id, + start_at_min=start_at_min, + start_at_max=start_at_max, + request_options=request_options, + ) + _items = _parsed_response.bookings + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -703,10 +739,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( booking=booking, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search_availability( self, *, query: SearchAvailabilityQueryParams, request_options: typing.Optional[RequestOptions] = None @@ -749,8 +785,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search_availability(query=query, request_options=request_options) - return _response.data + response = await self._raw_client.search_availability(query=query, request_options=request_options) + return response.data async def bulk_retrieve_bookings( self, *, booking_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -793,10 +829,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_retrieve_bookings( + response = await self._raw_client.bulk_retrieve_bookings( booking_ids=booking_ids, request_options=request_options ) - return _response.data + return response.data async def get_business_profile( self, *, request_options: typing.Optional[RequestOptions] = None @@ -831,8 +867,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_business_profile(request_options=request_options) - return _response.data + response = await self._raw_client.get_business_profile(request_options=request_options) + return response.data async def retrieve_location_booking_profile( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -872,10 +908,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_location_booking_profile( + response = await self._raw_client.retrieve_location_booking_profile( location_id, request_options=request_options ) - return _response.data + return response.data async def bulk_retrieve_team_member_booking_profiles( self, *, team_member_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -915,10 +951,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_retrieve_team_member_booking_profiles( + response = await self._raw_client.bulk_retrieve_team_member_booking_profiles( team_member_ids=team_member_ids, request_options=request_options ) - return _response.data + return response.data async def get( self, booking_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -961,8 +997,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(booking_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(booking_id, request_options=request_options) + return response.data async def update( self, @@ -1020,10 +1056,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( booking_id, booking=booking, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def cancel( self, @@ -1080,44 +1116,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel( + response = await self._raw_client.cancel( booking_id, idempotency_key=idempotency_key, booking_version=booking_version, request_options=request_options, ) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient( - client_wrapper=self._client_wrapper - ) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import AsyncCustomAttributesClient # noqa: E402 - - self._custom_attributes = AsyncCustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes - - @property - def location_profiles(self): - if self._location_profiles is None: - from .location_profiles.client import AsyncLocationProfilesClient # noqa: E402 - - self._location_profiles = AsyncLocationProfilesClient(client_wrapper=self._client_wrapper) - return self._location_profiles - - @property - def team_member_profiles(self): - if self._team_member_profiles is None: - from .team_member_profiles.client import AsyncTeamMemberProfilesClient # noqa: E402 - - self._team_member_profiles = AsyncTeamMemberProfilesClient(client_wrapper=self._client_wrapper) - return self._team_member_profiles + return response.data diff --git a/src/square/bookings/custom_attribute_definitions/__init__.py b/src/square/bookings/custom_attribute_definitions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/bookings/custom_attribute_definitions/__init__.py +++ b/src/square/bookings/custom_attribute_definitions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/bookings/custom_attribute_definitions/client.py b/src/square/bookings/custom_attribute_definitions/client.py index 24b27d12..f6d76c48 100644 --- a/src/square/bookings/custom_attribute_definitions/client.py +++ b/src/square/bookings/custom_attribute_definitions/client.py @@ -1,20 +1,25 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributeDefinitionsClient from ...core.request_options import RequestOptions -from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams -from ...types.create_booking_custom_attribute_definition_response import CreateBookingCustomAttributeDefinitionResponse +from ...core.pagination import SyncPager from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_booking_custom_attribute_definition_response import DeleteBookingCustomAttributeDefinitionResponse from ...types.list_booking_custom_attribute_definitions_response import ListBookingCustomAttributeDefinitionsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams +from ...types.create_booking_custom_attribute_definition_response import CreateBookingCustomAttributeDefinitionResponse from ...types.retrieve_booking_custom_attribute_definition_response import ( RetrieveBookingCustomAttributeDefinitionResponse, ) from ...types.update_booking_custom_attribute_definition_response import UpdateBookingCustomAttributeDefinitionResponse -from .raw_client import AsyncRawCustomAttributeDefinitionsClient, RawCustomAttributeDefinitionsClient +from ...types.delete_booking_custom_attribute_definition_response import DeleteBookingCustomAttributeDefinitionResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributeDefinitionsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -41,7 +46,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]: + ) -> SyncPager[CustomAttributeDefinition]: """ Get all bookings custom attribute definitions. @@ -65,7 +70,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] + SyncPager[CustomAttributeDefinition] Success Examples @@ -85,7 +90,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings/custom-attribute-definitions", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBookingCustomAttributeDefinitionsResponse, + construct_type( + type_=ListBookingCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -145,12 +180,12 @@ def create( custom_attribute_definition={}, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -193,8 +228,8 @@ def get( version=1, ) """ - _response = self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = self._raw_client.get(key, version=version, request_options=request_options) + return response.data def update( self, @@ -256,13 +291,13 @@ def update( custom_attribute_definition={}, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -300,8 +335,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(key, request_options=request_options) - return _response.data + response = self._raw_client.delete(key, request_options=request_options) + return response.data class AsyncCustomAttributeDefinitionsClient: @@ -325,7 +360,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]: + ) -> AsyncPager[CustomAttributeDefinition]: """ Get all bookings custom attribute definitions. @@ -349,7 +384,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] + AsyncPager[CustomAttributeDefinition] Success Examples @@ -370,7 +405,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -378,7 +412,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings/custom-attribute-definitions", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBookingCustomAttributeDefinitionsResponse, + construct_type( + type_=ListBookingCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -446,12 +510,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -502,8 +566,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.get(key, version=version, request_options=request_options) + return response.data async def update( self, @@ -573,13 +637,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -625,5 +689,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(key, request_options=request_options) + return response.data diff --git a/src/square/bookings/custom_attribute_definitions/raw_client.py b/src/square/bookings/custom_attribute_definitions/raw_client.py index 188bf4c2..72eb0db3 100644 --- a/src/square/bookings/custom_attribute_definitions/raw_client.py +++ b/src/square/bookings/custom_attribute_definitions/raw_client.py @@ -1,25 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_booking_custom_attribute_definition_response import CreateBookingCustomAttributeDefinitionResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams -from ...types.create_booking_custom_attribute_definition_response import CreateBookingCustomAttributeDefinitionResponse -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_booking_custom_attribute_definition_response import DeleteBookingCustomAttributeDefinitionResponse -from ...types.list_booking_custom_attribute_definitions_response import ListBookingCustomAttributeDefinitionsResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_booking_custom_attribute_definition_response import ( RetrieveBookingCustomAttributeDefinitionResponse, ) +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_booking_custom_attribute_definition_response import UpdateBookingCustomAttributeDefinitionResponse +from ...types.delete_booking_custom_attribute_definition_response import DeleteBookingCustomAttributeDefinitionResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -29,71 +27,6 @@ class RawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]: - """ - Get all bookings custom attribute definitions. - - To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/bookings/custom-attribute-definitions", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBookingCustomAttributeDefinitionsResponse, - construct_type( - type_=ListBookingCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -168,8 +101,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -220,8 +153,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -298,8 +231,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -343,82 +276,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]: - """ - Get all bookings custom attribute definitions. - - To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/bookings/custom-attribute-definitions", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBookingCustomAttributeDefinitionsResponse, - construct_type( - type_=ListBookingCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -493,8 +358,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -545,8 +410,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -623,8 +488,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -668,5 +533,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/bookings/custom_attributes/__init__.py b/src/square/bookings/custom_attributes/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/bookings/custom_attributes/__init__.py +++ b/src/square/bookings/custom_attributes/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/bookings/custom_attributes/client.py b/src/square/bookings/custom_attributes/client.py index ee66d78c..8be92eaf 100644 --- a/src/square/bookings/custom_attributes/client.py +++ b/src/square/bookings/custom_attributes/client.py @@ -1,21 +1,27 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributesClient from ...requests.booking_custom_attribute_delete_request import BookingCustomAttributeDeleteRequestParams -from ...requests.booking_custom_attribute_upsert_request import BookingCustomAttributeUpsertRequestParams -from ...requests.custom_attribute import CustomAttributeParams +from ...core.request_options import RequestOptions from ...types.bulk_delete_booking_custom_attributes_response import BulkDeleteBookingCustomAttributesResponse +from ...requests.booking_custom_attribute_upsert_request import BookingCustomAttributeUpsertRequestParams from ...types.bulk_upsert_booking_custom_attributes_response import BulkUpsertBookingCustomAttributesResponse +from ...core.pagination import SyncPager from ...types.custom_attribute import CustomAttribute -from ...types.delete_booking_custom_attribute_response import DeleteBookingCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_booking_custom_attributes_response import ListBookingCustomAttributesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_booking_custom_attribute_response import RetrieveBookingCustomAttributeResponse +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_booking_custom_attribute_response import UpsertBookingCustomAttributeResponse -from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient +from ...types.delete_booking_custom_attribute_response import DeleteBookingCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -77,8 +83,8 @@ def batch_delete( values={"key": {"booking_id": "booking_id", "key": "key"}}, ) """ - _response = self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data def batch_upsert( self, @@ -121,8 +127,8 @@ def batch_upsert( values={"key": {"booking_id": "booking_id", "custom_attribute": {}}}, ) """ - _response = self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data def list( self, @@ -132,7 +138,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: + ) -> SyncPager[CustomAttribute]: """ Lists a booking's custom attributes. @@ -164,7 +170,7 @@ def list( Returns ------- - SyncPager[CustomAttribute, ListBookingCustomAttributesResponse] + SyncPager[CustomAttribute] Success Examples @@ -186,9 +192,40 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - booking_id, limit=limit, cursor=cursor, with_definitions=with_definitions, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/bookings/{jsonable_encoder(booking_id)}/custom-attributes", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBookingCustomAttributesResponse, + construct_type( + type_=ListBookingCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + booking_id, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -248,10 +285,10 @@ def get( version=1, ) """ - _response = self._raw_client.get( + response = self._raw_client.get( booking_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data def upsert( self, @@ -316,14 +353,14 @@ def upsert( custom_attribute={}, ) """ - _response = self._raw_client.upsert( + response = self._raw_client.upsert( booking_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, booking_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -367,8 +404,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(booking_id, key, request_options=request_options) - return _response.data + response = self._raw_client.delete(booking_id, key, request_options=request_options) + return response.data class AsyncCustomAttributesClient: @@ -435,8 +472,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data async def batch_upsert( self, @@ -487,8 +524,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data async def list( self, @@ -498,7 +535,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: + ) -> AsyncPager[CustomAttribute]: """ Lists a booking's custom attributes. @@ -530,7 +567,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse] + AsyncPager[CustomAttribute] Success Examples @@ -553,7 +590,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -561,9 +597,40 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - booking_id, limit=limit, cursor=cursor, with_definitions=with_definitions, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/bookings/{jsonable_encoder(booking_id)}/custom-attributes", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBookingCustomAttributesResponse, + construct_type( + type_=ListBookingCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + booking_id, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -631,10 +698,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get( + response = await self._raw_client.get( booking_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data async def upsert( self, @@ -707,14 +774,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.upsert( + response = await self._raw_client.upsert( booking_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, booking_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -766,5 +833,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(booking_id, key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(booking_id, key, request_options=request_options) + return response.data diff --git a/src/square/bookings/custom_attributes/raw_client.py b/src/square/bookings/custom_attributes/raw_client.py index 2d5a414e..3e61fa87 100644 --- a/src/square/bookings/custom_attributes/raw_client.py +++ b/src/square/bookings/custom_attributes/raw_client.py @@ -1,26 +1,24 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.booking_custom_attribute_delete_request import BookingCustomAttributeDeleteRequestParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.bulk_delete_booking_custom_attributes_response import BulkDeleteBookingCustomAttributesResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.booking_custom_attribute_delete_request import BookingCustomAttributeDeleteRequestParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.booking_custom_attribute_upsert_request import BookingCustomAttributeUpsertRequestParams -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_booking_custom_attributes_response import BulkDeleteBookingCustomAttributesResponse from ...types.bulk_upsert_booking_custom_attributes_response import BulkUpsertBookingCustomAttributesResponse -from ...types.custom_attribute import CustomAttribute -from ...types.delete_booking_custom_attribute_response import DeleteBookingCustomAttributeResponse -from ...types.list_booking_custom_attributes_response import ListBookingCustomAttributesResponse from ...types.retrieve_booking_custom_attribute_response import RetrieveBookingCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_booking_custom_attribute_response import UpsertBookingCustomAttributeResponse +from ...types.delete_booking_custom_attribute_response import DeleteBookingCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -88,8 +86,8 @@ def batch_delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_upsert( self, @@ -149,86 +147,8 @@ def batch_upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list( - self, - booking_id: str, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: - """ - Lists a booking's custom attributes. - - To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - - Parameters - ---------- - booking_id : str - The ID of the target [booking](entity:Booking). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttribute, ListBookingCustomAttributesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/bookings/{jsonable_encoder(booking_id)}/custom-attributes", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBookingCustomAttributesResponse, - construct_type( - type_=ListBookingCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - booking_id, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -295,8 +215,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def upsert( self, @@ -375,8 +295,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, booking_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -425,8 +345,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributesClient: @@ -491,8 +411,8 @@ async def batch_delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_upsert( self, @@ -552,89 +472,8 @@ async def batch_upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list( - self, - booking_id: str, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: - """ - Lists a booking's custom attributes. - - To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - - Parameters - ---------- - booking_id : str - The ID of the target [booking](entity:Booking). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/bookings/{jsonable_encoder(booking_id)}/custom-attributes", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBookingCustomAttributesResponse, - construct_type( - type_=ListBookingCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - booking_id, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -701,8 +540,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def upsert( self, @@ -781,8 +620,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, booking_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -831,5 +670,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/bookings/location_profiles/__init__.py b/src/square/bookings/location_profiles/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/bookings/location_profiles/__init__.py +++ b/src/square/bookings/location_profiles/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/bookings/location_profiles/client.py b/src/square/bookings/location_profiles/client.py index b778bd2a..c358c5d5 100644 --- a/src/square/bookings/location_profiles/client.py +++ b/src/square/bookings/location_profiles/client.py @@ -1,13 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawLocationProfilesClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...types.list_location_booking_profiles_response import ListLocationBookingProfilesResponse +from ...core.pagination import SyncPager from ...types.location_booking_profile import LocationBookingProfile -from .raw_client import AsyncRawLocationProfilesClient, RawLocationProfilesClient +from ...types.list_location_booking_profiles_response import ListLocationBookingProfilesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawLocationProfilesClient +from ...core.pagination import AsyncPager class LocationProfilesClient: @@ -31,7 +36,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: + ) -> SyncPager[LocationBookingProfile]: """ Lists location booking profiles of a seller. @@ -48,7 +53,7 @@ def list( Returns ------- - SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] + SyncPager[LocationBookingProfile] Success Examples @@ -68,7 +73,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings/location-booking-profiles", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLocationBookingProfilesResponse, + construct_type( + type_=ListLocationBookingProfilesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.location_booking_profiles + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncLocationProfilesClient: @@ -92,7 +127,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: + ) -> AsyncPager[LocationBookingProfile]: """ Lists location booking profiles of a seller. @@ -109,7 +144,7 @@ async def list( Returns ------- - AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] + AsyncPager[LocationBookingProfile] Success Examples @@ -130,7 +165,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -138,4 +172,34 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings/location-booking-profiles", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLocationBookingProfilesResponse, + construct_type( + type_=ListLocationBookingProfilesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.location_booking_profiles + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/bookings/location_profiles/raw_client.py b/src/square/bookings/location_profiles/raw_client.py index 2810e589..58a7ab18 100644 --- a/src/square/bookings/location_profiles/raw_client.py +++ b/src/square/bookings/location_profiles/raw_client.py @@ -1,141 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type -from ...types.list_location_booking_profiles_response import ListLocationBookingProfilesResponse -from ...types.location_booking_profile import LocationBookingProfile +from ...core.client_wrapper import SyncClientWrapper +from ...core.client_wrapper import AsyncClientWrapper class RawLocationProfilesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: - """ - Lists location booking profiles of a seller. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results to return in a paged response. - - cursor : typing.Optional[str] - The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/bookings/location-booking-profiles", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLocationBookingProfilesResponse, - construct_type( - type_=ListLocationBookingProfilesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.location_booking_profiles - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - class AsyncRawLocationProfilesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - - async def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: - """ - Lists location booking profiles of a seller. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results to return in a paged response. - - cursor : typing.Optional[str] - The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/bookings/location-booking-profiles", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLocationBookingProfilesResponse, - construct_type( - type_=ListLocationBookingProfilesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.location_booking_profiles - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/square/bookings/raw_client.py b/src/square/bookings/raw_client.py index a922521d..c1cd027a 100644 --- a/src/square/bookings/raw_client.py +++ b/src/square/bookings/raw_client.py @@ -1,29 +1,27 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.booking import BookingParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_booking_response import CreateBookingResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.booking import BookingParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.search_availability_query import SearchAvailabilityQueryParams -from ..types.booking import Booking +from ..types.search_availability_response import SearchAvailabilityResponse from ..types.bulk_retrieve_bookings_response import BulkRetrieveBookingsResponse -from ..types.bulk_retrieve_team_member_booking_profiles_response import BulkRetrieveTeamMemberBookingProfilesResponse -from ..types.cancel_booking_response import CancelBookingResponse -from ..types.create_booking_response import CreateBookingResponse -from ..types.get_booking_response import GetBookingResponse from ..types.get_business_booking_profile_response import GetBusinessBookingProfileResponse -from ..types.list_bookings_response import ListBookingsResponse from ..types.retrieve_location_booking_profile_response import RetrieveLocationBookingProfileResponse -from ..types.search_availability_response import SearchAvailabilityResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..types.bulk_retrieve_team_member_booking_profiles_response import BulkRetrieveTeamMemberBookingProfilesResponse +from ..types.get_booking_response import GetBookingResponse from ..types.update_booking_response import UpdateBookingResponse +from ..types.cancel_booking_response import CancelBookingResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -33,97 +31,6 @@ class RawBookingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - team_member_id: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - start_at_min: typing.Optional[str] = None, - start_at_max: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Booking, ListBookingsResponse]: - """ - Retrieve a collection of bookings. - - To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results per page to return in a paged response. - - cursor : typing.Optional[str] - The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - - customer_id : typing.Optional[str] - The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. - - team_member_id : typing.Optional[str] - The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. - - location_id : typing.Optional[str] - The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. - - start_at_min : typing.Optional[str] - The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. - - start_at_max : typing.Optional[str] - The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Booking, ListBookingsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/bookings", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - "customer_id": customer_id, - "team_member_id": team_member_id, - "location_id": location_id, - "start_at_min": start_at_min, - "start_at_max": start_at_max, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBookingsResponse, - construct_type( - type_=ListBookingsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.bookings - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - limit=limit, - cursor=_parsed_next, - customer_id=customer_id, - team_member_id=team_member_id, - location_id=location_id, - start_at_min=start_at_min, - start_at_max=start_at_max, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -190,8 +97,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search_availability( self, *, query: SearchAvailabilityQueryParams, request_options: typing.Optional[RequestOptions] = None @@ -241,8 +148,8 @@ def search_availability( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_retrieve_bookings( self, *, booking_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -290,8 +197,8 @@ def bulk_retrieve_bookings( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_business_profile( self, *, request_options: typing.Optional[RequestOptions] = None @@ -326,8 +233,8 @@ def get_business_profile( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def retrieve_location_booking_profile( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -365,8 +272,8 @@ def retrieve_location_booking_profile( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_retrieve_team_member_booking_profiles( self, *, team_member_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -411,8 +318,8 @@ def bulk_retrieve_team_member_booking_profiles( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, booking_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -453,8 +360,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -519,8 +426,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, @@ -583,108 +490,14 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawBookingsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - team_member_id: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - start_at_min: typing.Optional[str] = None, - start_at_max: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Booking, ListBookingsResponse]: - """ - Retrieve a collection of bookings. - - To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. - To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results per page to return in a paged response. - - cursor : typing.Optional[str] - The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - - customer_id : typing.Optional[str] - The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. - - team_member_id : typing.Optional[str] - The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. - - location_id : typing.Optional[str] - The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. - - start_at_min : typing.Optional[str] - The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. - - start_at_max : typing.Optional[str] - The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Booking, ListBookingsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/bookings", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - "customer_id": customer_id, - "team_member_id": team_member_id, - "location_id": location_id, - "start_at_min": start_at_min, - "start_at_max": start_at_max, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBookingsResponse, - construct_type( - type_=ListBookingsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.bookings - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - limit=limit, - cursor=_parsed_next, - customer_id=customer_id, - team_member_id=team_member_id, - location_id=location_id, - start_at_min=start_at_min, - start_at_max=start_at_max, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -751,8 +564,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search_availability( self, *, query: SearchAvailabilityQueryParams, request_options: typing.Optional[RequestOptions] = None @@ -802,8 +615,8 @@ async def search_availability( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_retrieve_bookings( self, *, booking_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -851,8 +664,8 @@ async def bulk_retrieve_bookings( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_business_profile( self, *, request_options: typing.Optional[RequestOptions] = None @@ -887,8 +700,8 @@ async def get_business_profile( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def retrieve_location_booking_profile( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -926,8 +739,8 @@ async def retrieve_location_booking_profile( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_retrieve_team_member_booking_profiles( self, *, team_member_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -972,8 +785,8 @@ async def bulk_retrieve_team_member_booking_profiles( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, booking_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1014,8 +827,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -1080,8 +893,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, @@ -1144,5 +957,5 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/bookings/team_member_profiles/__init__.py b/src/square/bookings/team_member_profiles/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/bookings/team_member_profiles/__init__.py +++ b/src/square/bookings/team_member_profiles/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/bookings/team_member_profiles/client.py b/src/square/bookings/team_member_profiles/client.py index d32b5dbe..35ffc3ef 100644 --- a/src/square/bookings/team_member_profiles/client.py +++ b/src/square/bookings/team_member_profiles/client.py @@ -1,14 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawTeamMemberProfilesClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...types.get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse -from ...types.list_team_member_booking_profiles_response import ListTeamMemberBookingProfilesResponse +from ...core.pagination import SyncPager from ...types.team_member_booking_profile import TeamMemberBookingProfile -from .raw_client import AsyncRawTeamMemberProfilesClient, RawTeamMemberProfilesClient +from ...types.list_team_member_booking_profiles_response import ListTeamMemberBookingProfilesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawTeamMemberProfilesClient +from ...core.pagination import AsyncPager class TeamMemberProfilesClient: @@ -34,7 +39,7 @@ def list( cursor: typing.Optional[str] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: + ) -> SyncPager[TeamMemberBookingProfile]: """ Lists booking profiles for team members. @@ -57,7 +62,7 @@ def list( Returns ------- - SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] + SyncPager[TeamMemberBookingProfile] Success Examples @@ -79,13 +84,41 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - bookable_only=bookable_only, - limit=limit, - cursor=cursor, - location_id=location_id, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings/team-member-booking-profiles", + method="GET", + params={ + "bookable_only": bookable_only, + "limit": limit, + "cursor": cursor, + "location_id": location_id, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListTeamMemberBookingProfilesResponse, + construct_type( + type_=ListTeamMemberBookingProfilesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + bookable_only=bookable_only, + limit=limit, + cursor=_parsed_next, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.team_member_booking_profiles + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -117,8 +150,8 @@ def get( team_member_id="team_member_id", ) """ - _response = self._raw_client.get(team_member_id, request_options=request_options) - return _response.data + response = self._raw_client.get(team_member_id, request_options=request_options) + return response.data class AsyncTeamMemberProfilesClient: @@ -144,7 +177,7 @@ async def list( cursor: typing.Optional[str] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: + ) -> AsyncPager[TeamMemberBookingProfile]: """ Lists booking profiles for team members. @@ -167,7 +200,7 @@ async def list( Returns ------- - AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] + AsyncPager[TeamMemberBookingProfile] Success Examples @@ -190,7 +223,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -198,13 +230,41 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - bookable_only=bookable_only, - limit=limit, - cursor=cursor, - location_id=location_id, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/bookings/team-member-booking-profiles", + method="GET", + params={ + "bookable_only": bookable_only, + "limit": limit, + "cursor": cursor, + "location_id": location_id, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListTeamMemberBookingProfilesResponse, + construct_type( + type_=ListTeamMemberBookingProfilesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + bookable_only=bookable_only, + limit=limit, + cursor=_parsed_next, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.team_member_booking_profiles + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -244,5 +304,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(team_member_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(team_member_id, request_options=request_options) + return response.data diff --git a/src/square/bookings/team_member_profiles/raw_client.py b/src/square/bookings/team_member_profiles/raw_client.py index 6cef3353..5c127ca7 100644 --- a/src/square/bookings/team_member_profiles/raw_client.py +++ b/src/square/bookings/team_member_profiles/raw_client.py @@ -1,94 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type +from ...core.http_response import HttpResponse from ...types.get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse -from ...types.list_team_member_booking_profiles_response import ListTeamMemberBookingProfilesResponse -from ...types.team_member_booking_profile import TeamMemberBookingProfile +from ...core.jsonable_encoder import jsonable_encoder +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawTeamMemberProfilesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - bookable_only: typing.Optional[bool] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: - """ - Lists booking profiles for team members. - - Parameters - ---------- - bookable_only : typing.Optional[bool] - Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). - - limit : typing.Optional[int] - The maximum number of results to return in a paged response. - - cursor : typing.Optional[str] - The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - - location_id : typing.Optional[str] - Indicates whether to include only team members enabled at the given location in the returned result. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/bookings/team-member-booking-profiles", - method="GET", - params={ - "bookable_only": bookable_only, - "limit": limit, - "cursor": cursor, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListTeamMemberBookingProfilesResponse, - construct_type( - type_=ListTeamMemberBookingProfilesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.team_member_booking_profiles - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - bookable_only=bookable_only, - limit=limit, - cursor=_parsed_next, - location_id=location_id, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetTeamMemberBookingProfileResponse]: @@ -125,87 +53,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawTeamMemberProfilesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - bookable_only: typing.Optional[bool] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: - """ - Lists booking profiles for team members. - - Parameters - ---------- - bookable_only : typing.Optional[bool] - Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). - - limit : typing.Optional[int] - The maximum number of results to return in a paged response. - - cursor : typing.Optional[str] - The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - - location_id : typing.Optional[str] - Indicates whether to include only team members enabled at the given location in the returned result. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/bookings/team-member-booking-profiles", - method="GET", - params={ - "bookable_only": bookable_only, - "limit": limit, - "cursor": cursor, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListTeamMemberBookingProfilesResponse, - construct_type( - type_=ListTeamMemberBookingProfilesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.team_member_booking_profiles - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - bookable_only=bookable_only, - limit=limit, - cursor=_parsed_next, - location_id=location_id, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetTeamMemberBookingProfileResponse]: @@ -242,5 +97,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/cards/__init__.py b/src/square/cards/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/cards/__init__.py +++ b/src/square/cards/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/cards/client.py b/src/square/cards/client.py index 74c8b8e7..22dda1c3 100644 --- a/src/square/cards/client.py +++ b/src/square/cards/client.py @@ -1,18 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawCardsClient +from ..types.sort_order import SortOrder from ..core.request_options import RequestOptions -from ..requests.card import CardParams +from ..core.pagination import SyncPager from ..types.card import Card +from ..types.list_cards_response import ListCardsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..requests.card import CardParams from ..types.create_card_response import CreateCardResponse -from ..types.disable_card_response import DisableCardResponse from ..types.get_card_response import GetCardResponse -from ..types.list_cards_response import ListCardsResponse -from ..types.sort_order import SortOrder -from .raw_client import AsyncRawCardsClient, RawCardsClient +from ..types.disable_card_response import DisableCardResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCardsClient +from ..core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -42,7 +47,7 @@ def list( reference_id: typing.Optional[str] = None, sort_order: typing.Optional[SortOrder] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Card, ListCardsResponse]: + ) -> SyncPager[Card]: """ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. @@ -75,7 +80,7 @@ def list( Returns ------- - SyncPager[Card, ListCardsResponse] + SyncPager[Card] Success Examples @@ -98,14 +103,43 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, - customer_id=customer_id, - include_disabled=include_disabled, - reference_id=reference_id, - sort_order=sort_order, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/cards", + method="GET", + params={ + "cursor": cursor, + "customer_id": customer_id, + "include_disabled": include_disabled, + "reference_id": reference_id, + "sort_order": sort_order, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCardsResponse, + construct_type( + type_=ListCardsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + customer_id=customer_id, + include_disabled=include_disabled, + reference_id=reference_id, + sort_order=sort_order, + request_options=request_options, + ) + _items = _parsed_response.cards + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -175,14 +209,14 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, source_id=source_id, card=card, verification_token=verification_token, request_options=request_options, ) - return _response.data + return response.data def get(self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetCardResponse: """ @@ -212,8 +246,8 @@ def get(self, card_id: str, *, request_options: typing.Optional[RequestOptions] card_id="card_id", ) """ - _response = self._raw_client.get(card_id, request_options=request_options) - return _response.data + response = self._raw_client.get(card_id, request_options=request_options) + return response.data def disable(self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DisableCardResponse: """ @@ -244,8 +278,8 @@ def disable(self, card_id: str, *, request_options: typing.Optional[RequestOptio card_id="card_id", ) """ - _response = self._raw_client.disable(card_id, request_options=request_options) - return _response.data + response = self._raw_client.disable(card_id, request_options=request_options) + return response.data class AsyncCardsClient: @@ -272,7 +306,7 @@ async def list( reference_id: typing.Optional[str] = None, sort_order: typing.Optional[SortOrder] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Card, ListCardsResponse]: + ) -> AsyncPager[Card]: """ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. @@ -305,7 +339,7 @@ async def list( Returns ------- - AsyncPager[Card, ListCardsResponse] + AsyncPager[Card] Success Examples @@ -329,7 +363,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -337,14 +370,43 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, - customer_id=customer_id, - include_disabled=include_disabled, - reference_id=reference_id, - sort_order=sort_order, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/cards", + method="GET", + params={ + "cursor": cursor, + "customer_id": customer_id, + "include_disabled": include_disabled, + "reference_id": reference_id, + "sort_order": sort_order, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCardsResponse, + construct_type( + type_=ListCardsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + customer_id=customer_id, + include_disabled=include_disabled, + reference_id=reference_id, + sort_order=sort_order, + request_options=request_options, + ) + _items = _parsed_response.cards + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -422,14 +484,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, source_id=source_id, card=card, verification_token=verification_token, request_options=request_options, ) - return _response.data + return response.data async def get(self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetCardResponse: """ @@ -467,8 +529,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(card_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(card_id, request_options=request_options) + return response.data async def disable( self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -509,5 +571,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.disable(card_id, request_options=request_options) - return _response.data + response = await self._raw_client.disable(card_id, request_options=request_options) + return response.data diff --git a/src/square/cards/raw_client.py b/src/square/cards/raw_client.py index c60727ee..50b5ac26 100644 --- a/src/square/cards/raw_client.py +++ b/src/square/cards/raw_client.py @@ -1,23 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.card import CardParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_card_response import CreateCardResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.card import CardParams -from ..types.card import Card -from ..types.create_card_response import CreateCardResponse -from ..types.disable_card_response import DisableCardResponse +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.get_card_response import GetCardResponse -from ..types.list_cards_response import ListCardsResponse -from ..types.sort_order import SortOrder +from ..core.jsonable_encoder import jsonable_encoder +from ..types.disable_card_response import DisableCardResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -27,89 +24,6 @@ class RawCardsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - include_disabled: typing.Optional[bool] = None, - reference_id: typing.Optional[str] = None, - sort_order: typing.Optional[SortOrder] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Card, ListCardsResponse]: - """ - Retrieves a list of cards owned by the account making the request. - A max of 25 cards will be returned. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for your original query. - - See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. - - customer_id : typing.Optional[str] - Limit results to cards associated with the customer supplied. - By default, all cards owned by the merchant are returned. - - include_disabled : typing.Optional[bool] - Includes disabled cards. - By default, all enabled cards owned by the merchant are returned. - - reference_id : typing.Optional[str] - Limit results to cards associated with the reference_id supplied. - - sort_order : typing.Optional[SortOrder] - Sorts the returned list by when the card was created with the specified order. - This field defaults to ASC. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Card, ListCardsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/cards", - method="GET", - params={ - "cursor": cursor, - "customer_id": customer_id, - "include_disabled": include_disabled, - "reference_id": reference_id, - "sort_order": sort_order, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCardsResponse, - construct_type( - type_=ListCardsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.cards - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - customer_id=customer_id, - include_disabled=include_disabled, - reference_id=reference_id, - sort_order=sort_order, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -180,8 +94,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -219,8 +133,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def disable( self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -259,100 +173,14 @@ def disable( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCardsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - include_disabled: typing.Optional[bool] = None, - reference_id: typing.Optional[str] = None, - sort_order: typing.Optional[SortOrder] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Card, ListCardsResponse]: - """ - Retrieves a list of cards owned by the account making the request. - A max of 25 cards will be returned. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for your original query. - - See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. - - customer_id : typing.Optional[str] - Limit results to cards associated with the customer supplied. - By default, all cards owned by the merchant are returned. - - include_disabled : typing.Optional[bool] - Includes disabled cards. - By default, all enabled cards owned by the merchant are returned. - - reference_id : typing.Optional[str] - Limit results to cards associated with the reference_id supplied. - - sort_order : typing.Optional[SortOrder] - Sorts the returned list by when the card was created with the specified order. - This field defaults to ASC. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Card, ListCardsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/cards", - method="GET", - params={ - "cursor": cursor, - "customer_id": customer_id, - "include_disabled": include_disabled, - "reference_id": reference_id, - "sort_order": sort_order, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCardsResponse, - construct_type( - type_=ListCardsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.cards - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - customer_id=customer_id, - include_disabled=include_disabled, - reference_id=reference_id, - sort_order=sort_order, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -423,8 +251,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -462,8 +290,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def disable( self, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -502,5 +330,5 @@ async def disable( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/cash_drawers/__init__.py b/src/square/cash_drawers/__init__.py index 2fb709c3..284e922e 100644 --- a/src/square/cash_drawers/__init__.py +++ b/src/square/cash_drawers/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import shifts -_dynamic_imports: typing.Dict[str, str] = {"shifts": ".shifts"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import shifts __all__ = ["shifts"] diff --git a/src/square/cash_drawers/client.py b/src/square/cash_drawers/client.py index 45a08df9..2f057c5c 100644 --- a/src/square/cash_drawers/client.py +++ b/src/square/cash_drawers/client.py @@ -1,21 +1,17 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .raw_client import AsyncRawCashDrawersClient, RawCashDrawersClient - -if typing.TYPE_CHECKING: - from .shifts.client import AsyncShiftsClient, ShiftsClient +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawCashDrawersClient +from .shifts.client import ShiftsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCashDrawersClient +from .shifts.client import AsyncShiftsClient class CashDrawersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCashDrawersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._shifts: typing.Optional[ShiftsClient] = None + self.shifts = ShiftsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCashDrawersClient: @@ -28,20 +24,11 @@ def with_raw_response(self) -> RawCashDrawersClient: """ return self._raw_client - @property - def shifts(self): - if self._shifts is None: - from .shifts.client import ShiftsClient # noqa: E402 - - self._shifts = ShiftsClient(client_wrapper=self._client_wrapper) - return self._shifts - class AsyncCashDrawersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawCashDrawersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._shifts: typing.Optional[AsyncShiftsClient] = None + self.shifts = AsyncShiftsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCashDrawersClient: @@ -53,11 +40,3 @@ def with_raw_response(self) -> AsyncRawCashDrawersClient: AsyncRawCashDrawersClient """ return self._raw_client - - @property - def shifts(self): - if self._shifts is None: - from .shifts.client import AsyncShiftsClient # noqa: E402 - - self._shifts = AsyncShiftsClient(client_wrapper=self._client_wrapper) - return self._shifts diff --git a/src/square/cash_drawers/raw_client.py b/src/square/cash_drawers/raw_client.py index 38eebe66..04b334d5 100644 --- a/src/square/cash_drawers/raw_client.py +++ b/src/square/cash_drawers/raw_client.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from ..core.client_wrapper import AsyncClientWrapper class RawCashDrawersClient: diff --git a/src/square/cash_drawers/shifts/__init__.py b/src/square/cash_drawers/shifts/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/cash_drawers/shifts/__init__.py +++ b/src/square/cash_drawers/shifts/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/cash_drawers/shifts/client.py b/src/square/cash_drawers/shifts/client.py index bd5a8a0d..ce05806a 100644 --- a/src/square/cash_drawers/shifts/client.py +++ b/src/square/cash_drawers/shifts/client.py @@ -1,17 +1,23 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawShiftsClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...types.sort_order import SortOrder from ...core.request_options import RequestOptions -from ...types.cash_drawer_shift_event import CashDrawerShiftEvent +from ...core.pagination import SyncPager from ...types.cash_drawer_shift_summary import CashDrawerShiftSummary +from ...types.list_cash_drawer_shifts_response import ListCashDrawerShiftsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_cash_drawer_shift_response import GetCashDrawerShiftResponse +from ...types.cash_drawer_shift_event import CashDrawerShiftEvent +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_cash_drawer_shift_events_response import ListCashDrawerShiftEventsResponse -from ...types.list_cash_drawer_shifts_response import ListCashDrawerShiftsResponse -from ...types.sort_order import SortOrder -from .raw_client import AsyncRawShiftsClient, RawShiftsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawShiftsClient +from ...core.pagination import AsyncPager class ShiftsClient: @@ -39,7 +45,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: + ) -> SyncPager[CashDrawerShiftSummary]: """ Provides the details for all of the cash drawer shifts for a location in a date range. @@ -71,7 +77,7 @@ def list( Returns ------- - SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] + SyncPager[CashDrawerShiftSummary] Success Examples @@ -95,15 +101,45 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - location_id=location_id, - sort_order=sort_order, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=cursor, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/cash-drawers/shifts", + method="GET", + params={ + "location_id": location_id, + "sort_order": sort_order, + "begin_time": begin_time, + "end_time": end_time, + "limit": limit, + "cursor": cursor, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCashDrawerShiftsResponse, + construct_type( + type_=ListCashDrawerShiftsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + sort_order=sort_order, + begin_time=begin_time, + end_time=end_time, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.cash_drawer_shifts + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, shift_id: str, *, location_id: str, request_options: typing.Optional[RequestOptions] = None @@ -140,8 +176,8 @@ def get( location_id="location_id", ) """ - _response = self._raw_client.get(shift_id, location_id=location_id, request_options=request_options) - return _response.data + response = self._raw_client.get(shift_id, location_id=location_id, request_options=request_options) + return response.data def list_events( self, @@ -151,7 +187,7 @@ def list_events( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: + ) -> SyncPager[CashDrawerShiftEvent]: """ Provides a paginated list of events for a single cash drawer shift. @@ -175,7 +211,7 @@ def list_events( Returns ------- - SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] + SyncPager[CashDrawerShiftEvent] Success Examples @@ -197,9 +233,40 @@ def list_events( for page in response.iter_pages(): yield page """ - return self._raw_client.list_events( - shift_id, location_id=location_id, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/cash-drawers/shifts/{jsonable_encoder(shift_id)}/events", + method="GET", + params={ + "location_id": location_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCashDrawerShiftEventsResponse, + construct_type( + type_=ListCashDrawerShiftEventsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list_events( + shift_id, + location_id=location_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.cash_drawer_shift_events + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncShiftsClient: @@ -227,7 +294,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: + ) -> AsyncPager[CashDrawerShiftSummary]: """ Provides the details for all of the cash drawer shifts for a location in a date range. @@ -259,7 +326,7 @@ async def list( Returns ------- - AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] + AsyncPager[CashDrawerShiftSummary] Success Examples @@ -284,7 +351,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -292,15 +358,45 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - location_id=location_id, - sort_order=sort_order, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=cursor, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/cash-drawers/shifts", + method="GET", + params={ + "location_id": location_id, + "sort_order": sort_order, + "begin_time": begin_time, + "end_time": end_time, + "limit": limit, + "cursor": cursor, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCashDrawerShiftsResponse, + construct_type( + type_=ListCashDrawerShiftsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + sort_order=sort_order, + begin_time=begin_time, + end_time=end_time, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.cash_drawer_shifts + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, shift_id: str, *, location_id: str, request_options: typing.Optional[RequestOptions] = None @@ -345,8 +441,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(shift_id, location_id=location_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(shift_id, location_id=location_id, request_options=request_options) + return response.data async def list_events( self, @@ -356,7 +452,7 @@ async def list_events( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: + ) -> AsyncPager[CashDrawerShiftEvent]: """ Provides a paginated list of events for a single cash drawer shift. @@ -380,7 +476,7 @@ async def list_events( Returns ------- - AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] + AsyncPager[CashDrawerShiftEvent] Success Examples @@ -403,7 +499,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -411,6 +506,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list_events( - shift_id, location_id=location_id, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/cash-drawers/shifts/{jsonable_encoder(shift_id)}/events", + method="GET", + params={ + "location_id": location_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCashDrawerShiftEventsResponse, + construct_type( + type_=ListCashDrawerShiftEventsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list_events( + shift_id, + location_id=location_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.cash_drawer_shift_events + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/cash_drawers/shifts/raw_client.py b/src/square/cash_drawers/shifts/raw_client.py index 7819b495..82391a83 100644 --- a/src/square/cash_drawers/shifts/raw_client.py +++ b/src/square/cash_drawers/shifts/raw_client.py @@ -1,112 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type -from ...types.cash_drawer_shift_event import CashDrawerShiftEvent -from ...types.cash_drawer_shift_summary import CashDrawerShiftSummary +from ...core.http_response import HttpResponse from ...types.get_cash_drawer_shift_response import GetCashDrawerShiftResponse -from ...types.list_cash_drawer_shift_events_response import ListCashDrawerShiftEventsResponse -from ...types.list_cash_drawer_shifts_response import ListCashDrawerShiftsResponse -from ...types.sort_order import SortOrder +from ...core.jsonable_encoder import jsonable_encoder +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawShiftsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - location_id: str, - sort_order: typing.Optional[SortOrder] = None, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: - """ - Provides the details for all of the cash drawer shifts for a location - in a date range. - - Parameters - ---------- - location_id : str - The ID of the location to query for a list of cash drawer shifts. - - sort_order : typing.Optional[SortOrder] - The order in which cash drawer shifts are listed in the response, - based on their opened_at field. Default value: ASC - - begin_time : typing.Optional[str] - The inclusive start time of the query on opened_at, in ISO 8601 format. - - end_time : typing.Optional[str] - The exclusive end date of the query on opened_at, in ISO 8601 format. - - limit : typing.Optional[int] - Number of cash drawer shift events in a page of results (200 by - default, 1000 max). - - cursor : typing.Optional[str] - Opaque cursor for fetching the next page of results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/cash-drawers/shifts", - method="GET", - params={ - "location_id": location_id, - "sort_order": sort_order, - "begin_time": begin_time, - "end_time": end_time, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCashDrawerShiftsResponse, - construct_type( - type_=ListCashDrawerShiftsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.cash_drawer_shifts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - location_id=location_id, - sort_order=sort_order, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, shift_id: str, *, location_id: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetCashDrawerShiftResponse]: @@ -150,172 +60,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list_events( - self, - shift_id: str, - *, - location_id: str, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: - """ - Provides a paginated list of events for a single cash drawer shift. - - Parameters - ---------- - shift_id : str - The shift ID. - - location_id : str - The ID of the location to list cash drawer shifts for. - - limit : typing.Optional[int] - Number of resources to be returned in a page of results (200 by - default, 1000 max). - - cursor : typing.Optional[str] - Opaque cursor for fetching the next page of results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/cash-drawers/shifts/{jsonable_encoder(shift_id)}/events", - method="GET", - params={ - "location_id": location_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCashDrawerShiftEventsResponse, - construct_type( - type_=ListCashDrawerShiftEventsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.cash_drawer_shift_events - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list_events( - shift_id, - location_id=location_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawShiftsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - location_id: str, - sort_order: typing.Optional[SortOrder] = None, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: - """ - Provides the details for all of the cash drawer shifts for a location - in a date range. - - Parameters - ---------- - location_id : str - The ID of the location to query for a list of cash drawer shifts. - - sort_order : typing.Optional[SortOrder] - The order in which cash drawer shifts are listed in the response, - based on their opened_at field. Default value: ASC - - begin_time : typing.Optional[str] - The inclusive start time of the query on opened_at, in ISO 8601 format. - - end_time : typing.Optional[str] - The exclusive end date of the query on opened_at, in ISO 8601 format. - - limit : typing.Optional[int] - Number of cash drawer shift events in a page of results (200 by - default, 1000 max). - - cursor : typing.Optional[str] - Opaque cursor for fetching the next page of results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/cash-drawers/shifts", - method="GET", - params={ - "location_id": location_id, - "sort_order": sort_order, - "begin_time": begin_time, - "end_time": end_time, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCashDrawerShiftsResponse, - construct_type( - type_=ListCashDrawerShiftsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.cash_drawer_shifts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - location_id=location_id, - sort_order=sort_order, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, shift_id: str, *, location_id: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetCashDrawerShiftResponse]: @@ -359,78 +111,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list_events( - self, - shift_id: str, - *, - location_id: str, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: - """ - Provides a paginated list of events for a single cash drawer shift. - - Parameters - ---------- - shift_id : str - The shift ID. - - location_id : str - The ID of the location to list cash drawer shifts for. - - limit : typing.Optional[int] - Number of resources to be returned in a page of results (200 by - default, 1000 max). - - cursor : typing.Optional[str] - Opaque cursor for fetching the next page of results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/cash-drawers/shifts/{jsonable_encoder(shift_id)}/events", - method="GET", - params={ - "location_id": location_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCashDrawerShiftEventsResponse, - construct_type( - type_=ListCashDrawerShiftEventsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.cash_drawer_shift_events - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list_events( - shift_id, - location_id=location_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/catalog/__init__.py b/src/square/catalog/__init__.py index 74d161e1..cc665ef2 100644 --- a/src/square/catalog/__init__.py +++ b/src/square/catalog/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import images, object -_dynamic_imports: typing.Dict[str, str] = {"images": ".images", "object": ".object"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import images, object __all__ = ["images", "object"] diff --git a/src/square/catalog/client.py b/src/square/catalog/client.py index b644e1c9..5fff3740 100644 --- a/src/square/catalog/client.py +++ b/src/square/catalog/client.py @@ -1,35 +1,39 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawCatalogClient +from .images.client import ImagesClient +from .object.client import ObjectClient from ..core.request_options import RequestOptions -from ..requests.catalog_object_batch import CatalogObjectBatchParams -from ..requests.catalog_query import CatalogQueryParams -from ..requests.custom_attribute_filter import CustomAttributeFilterParams -from ..types.archived_state import ArchivedState from ..types.batch_delete_catalog_objects_response import BatchDeleteCatalogObjectsResponse from ..types.batch_get_catalog_objects_response import BatchGetCatalogObjectsResponse +from ..requests.catalog_object_batch import CatalogObjectBatchParams from ..types.batch_upsert_catalog_objects_response import BatchUpsertCatalogObjectsResponse from ..types.catalog_info_response import CatalogInfoResponse -from ..types.catalog_item_product_type import CatalogItemProductType +from ..core.pagination import SyncPager from ..types.catalog_object import CatalogObject -from ..types.catalog_object_type import CatalogObjectType from ..types.list_catalog_response import ListCatalogResponse -from ..types.search_catalog_items_request_stock_level import SearchCatalogItemsRequestStockLevel -from ..types.search_catalog_items_response import SearchCatalogItemsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.catalog_object_type import CatalogObjectType +from ..requests.catalog_query import CatalogQueryParams from ..types.search_catalog_objects_response import SearchCatalogObjectsResponse +from ..types.search_catalog_items_request_stock_level import SearchCatalogItemsRequestStockLevel from ..types.sort_order import SortOrder +from ..types.catalog_item_product_type import CatalogItemProductType +from ..requests.custom_attribute_filter import CustomAttributeFilterParams +from ..types.archived_state import ArchivedState +from ..types.search_catalog_items_response import SearchCatalogItemsResponse from ..types.update_item_modifier_lists_response import UpdateItemModifierListsResponse from ..types.update_item_taxes_response import UpdateItemTaxesResponse -from .raw_client import AsyncRawCatalogClient, RawCatalogClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCatalogClient +from .images.client import AsyncImagesClient +from .object.client import AsyncObjectClient +from ..core.pagination import AsyncPager -if typing.TYPE_CHECKING: - from .images.client import AsyncImagesClient, ImagesClient - from .object.client import AsyncObjectClient, ObjectClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -37,9 +41,9 @@ class CatalogClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCatalogClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._images: typing.Optional[ImagesClient] = None - self._object: typing.Optional[ObjectClient] = None + self.images = ImagesClient(client_wrapper=client_wrapper) + + self.object = ObjectClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCatalogClient: @@ -97,8 +101,8 @@ def batch_delete( object_ids=["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], ) """ - _response = self._raw_client.batch_delete(object_ids=object_ids, request_options=request_options) - return _response.data + response = self._raw_client.batch_delete(object_ids=object_ids, request_options=request_options) + return response.data def batch_get( self, @@ -174,7 +178,7 @@ def batch_get( include_related_objects=True, ) """ - _response = self._raw_client.batch_get( + response = self._raw_client.batch_get( object_ids=object_ids, include_related_objects=include_related_objects, catalog_version=catalog_version, @@ -182,7 +186,7 @@ def batch_get( include_category_path_to_root=include_category_path_to_root, request_options=request_options, ) - return _response.data + return response.data def batch_upsert( self, @@ -262,43 +266,19 @@ def batch_upsert( batches=[ { "objects": [ - { - "type": "IMAGE", - "id": "#Tea", - "present_at_all_locations": True, - }, - { - "type": "IMAGE", - "id": "#Coffee", - "present_at_all_locations": True, - }, - { - "type": "ITEM", - "id": "#Beverages", - "present_at_all_locations": True, - }, - { - "type": "TAX", - "id": "#SalesTax", - "present_at_all_locations": True, - "tax_data": { - "name": "Sales Tax", - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "inclusion_type": "ADDITIVE", - "percentage": "5.0", - "applies_to_custom_amounts": True, - "enabled": True, - }, - }, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "TAX"}, ] } ], ) """ - _response = self._raw_client.batch_upsert( + response = self._raw_client.batch_upsert( idempotency_key=idempotency_key, batches=batches, request_options=request_options ) - return _response.data + return response.data def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> CatalogInfoResponse: """ @@ -324,8 +304,8 @@ def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> Ca ) client.catalog.info() """ - _response = self._raw_client.info(request_options=request_options) - return _response.data + response = self._raw_client.info(request_options=request_options) + return response.data def list( self, @@ -334,7 +314,7 @@ def list( types: typing.Optional[str] = None, catalog_version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CatalogObject, ListCatalogResponse]: + ) -> SyncPager[CatalogObject]: """ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. @@ -379,7 +359,7 @@ def list( Returns ------- - SyncPager[CatalogObject, ListCatalogResponse] + SyncPager[CatalogObject] Success Examples @@ -400,9 +380,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, types=types, catalog_version=catalog_version, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/catalog/list", + method="GET", + params={ + "cursor": cursor, + "types": types, + "catalog_version": catalog_version, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCatalogResponse, + construct_type( + type_=ListCatalogResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + types=types, + catalog_version=catalog_version, + request_options=request_options, + ) + _items = _parsed_response.objects + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -509,7 +519,7 @@ def search( limit=100, ) """ - _response = self._raw_client.search( + response = self._raw_client.search( cursor=cursor, object_types=object_types, include_deleted_objects=include_deleted_objects, @@ -520,7 +530,7 @@ def search( include_category_path_to_root=include_category_path_to_root, request_options=request_options, ) - return _response.data + return response.data def search_items( self, @@ -624,7 +634,7 @@ def search_items( ], ) """ - _response = self._raw_client.search_items( + response = self._raw_client.search_items( text_filter=text_filter, category_ids=category_ids, stock_levels=stock_levels, @@ -637,7 +647,7 @@ def search_items( archived_state=archived_state, request_options=request_options, ) - return _response.data + return response.data def update_item_modifier_lists( self, @@ -689,13 +699,13 @@ def update_item_modifier_lists( modifier_lists_to_disable=["7WRC16CJZDVLSNDQ35PP6YAD"], ) """ - _response = self._raw_client.update_item_modifier_lists( + response = self._raw_client.update_item_modifier_lists( item_ids=item_ids, modifier_lists_to_enable=modifier_lists_to_enable, modifier_lists_to_disable=modifier_lists_to_disable, request_options=request_options, ) - return _response.data + return response.data def update_item_taxes( self, @@ -745,37 +755,21 @@ def update_item_taxes( taxes_to_disable=["AQCEGCEBBQONINDOHRGZISEX"], ) """ - _response = self._raw_client.update_item_taxes( + response = self._raw_client.update_item_taxes( item_ids=item_ids, taxes_to_enable=taxes_to_enable, taxes_to_disable=taxes_to_disable, request_options=request_options, ) - return _response.data - - @property - def images(self): - if self._images is None: - from .images.client import ImagesClient # noqa: E402 - - self._images = ImagesClient(client_wrapper=self._client_wrapper) - return self._images - - @property - def object(self): - if self._object is None: - from .object.client import ObjectClient # noqa: E402 - - self._object = ObjectClient(client_wrapper=self._client_wrapper) - return self._object + return response.data class AsyncCatalogClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawCatalogClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._images: typing.Optional[AsyncImagesClient] = None - self._object: typing.Optional[AsyncObjectClient] = None + self.images = AsyncImagesClient(client_wrapper=client_wrapper) + + self.object = AsyncObjectClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCatalogClient: @@ -841,8 +835,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_delete(object_ids=object_ids, request_options=request_options) - return _response.data + response = await self._raw_client.batch_delete(object_ids=object_ids, request_options=request_options) + return response.data async def batch_get( self, @@ -926,7 +920,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_get( + response = await self._raw_client.batch_get( object_ids=object_ids, include_related_objects=include_related_objects, catalog_version=catalog_version, @@ -934,7 +928,7 @@ async def main() -> None: include_category_path_to_root=include_category_path_to_root, request_options=request_options, ) - return _response.data + return response.data async def batch_upsert( self, @@ -1019,34 +1013,10 @@ async def main() -> None: batches=[ { "objects": [ - { - "type": "IMAGE", - "id": "#Tea", - "present_at_all_locations": True, - }, - { - "type": "IMAGE", - "id": "#Coffee", - "present_at_all_locations": True, - }, - { - "type": "ITEM", - "id": "#Beverages", - "present_at_all_locations": True, - }, - { - "type": "TAX", - "id": "#SalesTax", - "present_at_all_locations": True, - "tax_data": { - "name": "Sales Tax", - "calculation_phase": "TAX_SUBTOTAL_PHASE", - "inclusion_type": "ADDITIVE", - "percentage": "5.0", - "applies_to_custom_amounts": True, - "enabled": True, - }, - }, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "ITEM"}, + {"id": "id", "type": "TAX"}, ] } ], @@ -1055,10 +1025,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_upsert( + response = await self._raw_client.batch_upsert( idempotency_key=idempotency_key, batches=batches, request_options=request_options ) - return _response.data + return response.data async def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> CatalogInfoResponse: """ @@ -1092,8 +1062,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.info(request_options=request_options) - return _response.data + response = await self._raw_client.info(request_options=request_options) + return response.data async def list( self, @@ -1102,7 +1072,7 @@ async def list( types: typing.Optional[str] = None, catalog_version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CatalogObject, ListCatalogResponse]: + ) -> AsyncPager[CatalogObject]: """ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. @@ -1147,7 +1117,7 @@ async def list( Returns ------- - AsyncPager[CatalogObject, ListCatalogResponse] + AsyncPager[CatalogObject] Success Examples @@ -1169,7 +1139,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -1177,9 +1146,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, types=types, catalog_version=catalog_version, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/catalog/list", + method="GET", + params={ + "cursor": cursor, + "types": types, + "catalog_version": catalog_version, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCatalogResponse, + construct_type( + type_=ListCatalogResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + types=types, + catalog_version=catalog_version, + request_options=request_options, + ) + _items = _parsed_response.objects + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -1297,7 +1296,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( cursor=cursor, object_types=object_types, include_deleted_objects=include_deleted_objects, @@ -1308,7 +1307,7 @@ async def main() -> None: include_category_path_to_root=include_category_path_to_root, request_options=request_options, ) - return _response.data + return response.data async def search_items( self, @@ -1420,7 +1419,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search_items( + response = await self._raw_client.search_items( text_filter=text_filter, category_ids=category_ids, stock_levels=stock_levels, @@ -1433,7 +1432,7 @@ async def main() -> None: archived_state=archived_state, request_options=request_options, ) - return _response.data + return response.data async def update_item_modifier_lists( self, @@ -1493,13 +1492,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_item_modifier_lists( + response = await self._raw_client.update_item_modifier_lists( item_ids=item_ids, modifier_lists_to_enable=modifier_lists_to_enable, modifier_lists_to_disable=modifier_lists_to_disable, request_options=request_options, ) - return _response.data + return response.data async def update_item_taxes( self, @@ -1557,26 +1556,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_item_taxes( + response = await self._raw_client.update_item_taxes( item_ids=item_ids, taxes_to_enable=taxes_to_enable, taxes_to_disable=taxes_to_disable, request_options=request_options, ) - return _response.data - - @property - def images(self): - if self._images is None: - from .images.client import AsyncImagesClient # noqa: E402 - - self._images = AsyncImagesClient(client_wrapper=self._client_wrapper) - return self._images - - @property - def object(self): - if self._object is None: - from .object.client import AsyncObjectClient # noqa: E402 - - self._object = AsyncObjectClient(client_wrapper=self._client_wrapper) - return self._object + return response.data diff --git a/src/square/catalog/images/__init__.py b/src/square/catalog/images/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/catalog/images/__init__.py +++ b/src/square/catalog/images/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/catalog/images/client.py b/src/square/catalog/images/client.py index d69679d7..9f4f1d77 100644 --- a/src/square/catalog/images/client.py +++ b/src/square/catalog/images/client.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. import typing - +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawImagesClient +from ...requests.create_catalog_image_request import CreateCatalogImageRequestParams from ... import core -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions -from ...requests.create_catalog_image_request import CreateCatalogImageRequestParams -from ...requests.update_catalog_image_request import UpdateCatalogImageRequestParams from ...types.create_catalog_image_response import CreateCatalogImageResponse +from ...requests.update_catalog_image_request import UpdateCatalogImageRequestParams from ...types.update_catalog_image_response import UpdateCatalogImageResponse -from .raw_client import AsyncRawImagesClient, RawImagesClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawImagesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -69,8 +70,8 @@ def create( ) client.catalog.images.create() """ - _response = self._raw_client.create(request=request, image_file=image_file, request_options=request_options) - return _response.data + response = self._raw_client.create(request=request, image_file=image_file, request_options=request_options) + return response.data def update( self, @@ -115,10 +116,10 @@ def update( image_id="image_id", ) """ - _response = self._raw_client.update( + response = self._raw_client.update( image_id, request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data class AsyncImagesClient: @@ -183,10 +184,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data async def update( self, @@ -239,7 +240,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( image_id, request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/catalog/images/raw_client.py b/src/square/catalog/images/raw_client.py index c803f7a2..41b2bac1 100644 --- a/src/square/catalog/images/raw_client.py +++ b/src/square/catalog/images/raw_client.py @@ -1,20 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing -from json.decoder import JSONDecodeError - +from ...core.client_wrapper import SyncClientWrapper +from ...requests.create_catalog_image_request import CreateCatalogImageRequestParams from ... import core -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_catalog_image_response import CreateCatalogImageResponse +import json +from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type -from ...requests.create_catalog_image_request import CreateCatalogImageRequestParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.update_catalog_image_request import UpdateCatalogImageRequestParams -from ...types.create_catalog_image_response import CreateCatalogImageResponse from ...types.update_catalog_image_response import UpdateCatalogImageResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -72,7 +73,6 @@ def create( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -86,8 +86,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -139,7 +139,6 @@ def update( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -153,8 +152,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawImagesClient: @@ -209,7 +208,6 @@ async def create( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -223,8 +221,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -276,7 +274,6 @@ async def update( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -290,5 +287,5 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/catalog/object/__init__.py b/src/square/catalog/object/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/catalog/object/__init__.py +++ b/src/square/catalog/object/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/catalog/object/client.py b/src/square/catalog/object/client.py index 62f923fb..2a3306aa 100644 --- a/src/square/catalog/object/client.py +++ b/src/square/catalog/object/client.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawObjectClient from ...requests.catalog_object import CatalogObjectParams -from ...types.delete_catalog_object_response import DeleteCatalogObjectResponse -from ...types.get_catalog_object_response import GetCatalogObjectResponse +from ...core.request_options import RequestOptions from ...types.upsert_catalog_object_response import UpsertCatalogObjectResponse -from .raw_client import AsyncRawObjectClient, RawObjectClient +from ...types.get_catalog_object_response import GetCatalogObjectResponse +from ...types.delete_catalog_object_response import DeleteCatalogObjectResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawObjectClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -80,13 +81,13 @@ def upsert( ) client.catalog.object.upsert( idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae", - object={"type": "IMAGE", "id": "#Cocoa"}, + object={"id": "id", "type": "ITEM"}, ) """ - _response = self._raw_client.upsert( + response = self._raw_client.upsert( idempotency_key=idempotency_key, object=object, request_options=request_options ) - return _response.data + return response.data def get( self, @@ -161,14 +162,14 @@ def get( include_category_path_to_root=True, ) """ - _response = self._raw_client.get( + response = self._raw_client.get( object_id, include_related_objects=include_related_objects, catalog_version=catalog_version, include_category_path_to_root=include_category_path_to_root, request_options=request_options, ) - return _response.data + return response.data def delete( self, object_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -211,8 +212,8 @@ def delete( object_id="object_id", ) """ - _response = self._raw_client.delete(object_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(object_id, request_options=request_options) + return response.data class AsyncObjectClient: @@ -286,16 +287,16 @@ async def upsert( async def main() -> None: await client.catalog.object.upsert( idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae", - object={"type": "IMAGE", "id": "#Cocoa"}, + object={"id": "id", "type": "ITEM"}, ) asyncio.run(main()) """ - _response = await self._raw_client.upsert( + response = await self._raw_client.upsert( idempotency_key=idempotency_key, object=object, request_options=request_options ) - return _response.data + return response.data async def get( self, @@ -378,14 +379,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get( + response = await self._raw_client.get( object_id, include_related_objects=include_related_objects, catalog_version=catalog_version, include_category_path_to_root=include_category_path_to_root, request_options=request_options, ) - return _response.data + return response.data async def delete( self, object_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -436,5 +437,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(object_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(object_id, request_options=request_options) + return response.data diff --git a/src/square/catalog/object/raw_client.py b/src/square/catalog/object/raw_client.py index 507bcd98..af5011ae 100644 --- a/src/square/catalog/object/raw_client.py +++ b/src/square/catalog/object/raw_client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.catalog_object import CatalogObjectParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.upsert_catalog_object_response import UpsertCatalogObjectResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.catalog_object import CatalogObjectParams -from ...types.delete_catalog_object_response import DeleteCatalogObjectResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_catalog_object_response import GetCatalogObjectResponse -from ...types.upsert_catalog_object_response import UpsertCatalogObjectResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...types.delete_catalog_object_response import DeleteCatalogObjectResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -92,8 +93,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -176,8 +177,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, object_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -226,8 +227,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawObjectClient: @@ -303,8 +304,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -387,8 +388,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, object_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -437,5 +438,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/catalog/raw_client.py b/src/square/catalog/raw_client.py index a2fd5d89..88473d77 100644 --- a/src/square/catalog/raw_client.py +++ b/src/square/catalog/raw_client.py @@ -1,33 +1,31 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..core.unchecked_base_model import construct_type -from ..requests.catalog_object_batch import CatalogObjectBatchParams -from ..requests.catalog_query import CatalogQueryParams -from ..requests.custom_attribute_filter import CustomAttributeFilterParams -from ..types.archived_state import ArchivedState +from ..core.http_response import HttpResponse from ..types.batch_delete_catalog_objects_response import BatchDeleteCatalogObjectsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.batch_get_catalog_objects_response import BatchGetCatalogObjectsResponse +from ..requests.catalog_object_batch import CatalogObjectBatchParams from ..types.batch_upsert_catalog_objects_response import BatchUpsertCatalogObjectsResponse +from ..core.serialization import convert_and_respect_annotation_metadata from ..types.catalog_info_response import CatalogInfoResponse -from ..types.catalog_item_product_type import CatalogItemProductType -from ..types.catalog_object import CatalogObject from ..types.catalog_object_type import CatalogObjectType -from ..types.list_catalog_response import ListCatalogResponse -from ..types.search_catalog_items_request_stock_level import SearchCatalogItemsRequestStockLevel -from ..types.search_catalog_items_response import SearchCatalogItemsResponse +from ..requests.catalog_query import CatalogQueryParams from ..types.search_catalog_objects_response import SearchCatalogObjectsResponse +from ..types.search_catalog_items_request_stock_level import SearchCatalogItemsRequestStockLevel from ..types.sort_order import SortOrder +from ..types.catalog_item_product_type import CatalogItemProductType +from ..requests.custom_attribute_filter import CustomAttributeFilterParams +from ..types.archived_state import ArchivedState +from ..types.search_catalog_items_response import SearchCatalogItemsResponse from ..types.update_item_modifier_lists_response import UpdateItemModifierListsResponse from ..types.update_item_taxes_response import UpdateItemTaxesResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -95,8 +93,8 @@ def batch_delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_get( self, @@ -188,8 +186,8 @@ def batch_get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_upsert( self, @@ -284,8 +282,8 @@ def batch_upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[CatalogInfoResponse]: """ @@ -319,97 +317,8 @@ def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> Ht return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list( - self, - *, - cursor: typing.Optional[str] = None, - types: typing.Optional[str] = None, - catalog_version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CatalogObject, ListCatalogResponse]: - """ - Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. - - The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, - for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". - - __Important:__ ListCatalog does not return deleted catalog items. To retrieve - deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) - and set the `include_deleted_objects` attribute value to `true`. - - Parameters - ---------- - cursor : typing.Optional[str] - The pagination cursor returned in the previous response. Leave unset for an initial request. - The page size is currently set to be 100. - See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. - - types : typing.Optional[str] - An optional case-insensitive, comma-separated list of object types to retrieve. - - The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example, - `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, - `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. - - If this is unspecified, the operation returns objects of all the top level types at the version - of the Square API used to make the request. Object types that are nested onto other object types - are not included in the defaults. - - At the current API version the default object types are: - ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - - catalog_version : typing.Optional[int] - The specific version of the catalog objects to be included in the response. - This allows you to retrieve historical versions of objects. The specified version value is matched against - the [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will be from the - current version of the catalog. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CatalogObject, ListCatalogResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/catalog/list", - method="GET", - params={ - "cursor": cursor, - "types": types, - "catalog_version": catalog_version, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCatalogResponse, - construct_type( - type_=ListCatalogResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.objects - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - types=types, - catalog_version=catalog_version, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -534,8 +443,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search_items( self, @@ -647,8 +556,8 @@ def search_items( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_item_modifier_lists( self, @@ -710,8 +619,8 @@ def update_item_modifier_lists( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_item_taxes( self, @@ -774,8 +683,8 @@ def update_item_taxes( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCatalogClient: @@ -840,8 +749,8 @@ async def batch_delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_get( self, @@ -933,8 +842,8 @@ async def batch_get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_upsert( self, @@ -1029,8 +938,8 @@ async def batch_upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def info( self, *, request_options: typing.Optional[RequestOptions] = None @@ -1066,100 +975,8 @@ async def info( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list( - self, - *, - cursor: typing.Optional[str] = None, - types: typing.Optional[str] = None, - catalog_version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CatalogObject, ListCatalogResponse]: - """ - Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. - - The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, - for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". - - __Important:__ ListCatalog does not return deleted catalog items. To retrieve - deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) - and set the `include_deleted_objects` attribute value to `true`. - - Parameters - ---------- - cursor : typing.Optional[str] - The pagination cursor returned in the previous response. Leave unset for an initial request. - The page size is currently set to be 100. - See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. - - types : typing.Optional[str] - An optional case-insensitive, comma-separated list of object types to retrieve. - - The valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example, - `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, - `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. - - If this is unspecified, the operation returns objects of all the top level types at the version - of the Square API used to make the request. Object types that are nested onto other object types - are not included in the defaults. - - At the current API version the default object types are: - ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, - PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, - SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. - - catalog_version : typing.Optional[int] - The specific version of the catalog objects to be included in the response. - This allows you to retrieve historical versions of objects. The specified version value is matched against - the [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will be from the - current version of the catalog. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CatalogObject, ListCatalogResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/catalog/list", - method="GET", - params={ - "cursor": cursor, - "types": types, - "catalog_version": catalog_version, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCatalogResponse, - construct_type( - type_=ListCatalogResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.objects - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - types=types, - catalog_version=catalog_version, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -1284,8 +1101,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search_items( self, @@ -1397,8 +1214,8 @@ async def search_items( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_item_modifier_lists( self, @@ -1460,8 +1277,8 @@ async def update_item_modifier_lists( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_item_taxes( self, @@ -1524,5 +1341,5 @@ async def update_item_taxes( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/channels/__init__.py b/src/square/channels/__init__.py deleted file mode 100644 index 5cde0202..00000000 --- a/src/square/channels/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/src/square/channels/client.py b/src/square/channels/client.py deleted file mode 100644 index 59b5610c..00000000 --- a/src/square/channels/client.py +++ /dev/null @@ -1,340 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..types.bulk_retrieve_channels_response import BulkRetrieveChannelsResponse -from ..types.channel import Channel -from ..types.channel_status import ChannelStatus -from ..types.list_channels_response import ListChannelsResponse -from ..types.reference_type import ReferenceType -from ..types.retrieve_channel_response import RetrieveChannelResponse -from .raw_client import AsyncRawChannelsClient, RawChannelsClient - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class ChannelsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawChannelsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawChannelsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawChannelsClient - """ - return self._raw_client - - def list( - self, - *, - reference_type: typing.Optional[ReferenceType] = None, - reference_id: typing.Optional[str] = None, - status: typing.Optional[ChannelStatus] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Channel, ListChannelsResponse]: - """ - - - Parameters - ---------- - reference_type : typing.Optional[ReferenceType] - Type of reference associated to channel - - reference_id : typing.Optional[str] - id of reference associated to channel - - status : typing.Optional[ChannelStatus] - Status of channel - - cursor : typing.Optional[str] - Cursor to fetch the next result - - limit : typing.Optional[int] - Maximum number of results to return. - When not provided the returned results will be cap at 100 channels. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Channel, ListChannelsResponse] - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - response = client.channels.list( - reference_type="UNKNOWN_TYPE", - reference_id="reference_id", - status="ACTIVE", - cursor="cursor", - limit=1, - ) - for item in response: - yield item - # alternatively, you can paginate page-by-page - for page in response.iter_pages(): - yield page - """ - return self._raw_client.list( - reference_type=reference_type, - reference_id=reference_id, - status=status, - cursor=cursor, - limit=limit, - request_options=request_options, - ) - - def bulk_retrieve( - self, *, channel_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None - ) -> BulkRetrieveChannelsResponse: - """ - - - Parameters - ---------- - channel_ids : typing.Sequence[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BulkRetrieveChannelsResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.channels.bulk_retrieve( - channel_ids=["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], - ) - """ - _response = self._raw_client.bulk_retrieve(channel_ids=channel_ids, request_options=request_options) - return _response.data - - def get( - self, channel_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> RetrieveChannelResponse: - """ - - - Parameters - ---------- - channel_id : str - A channel id - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - RetrieveChannelResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.channels.get( - channel_id="channel_id", - ) - """ - _response = self._raw_client.get(channel_id, request_options=request_options) - return _response.data - - -class AsyncChannelsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawChannelsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawChannelsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawChannelsClient - """ - return self._raw_client - - async def list( - self, - *, - reference_type: typing.Optional[ReferenceType] = None, - reference_id: typing.Optional[str] = None, - status: typing.Optional[ChannelStatus] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Channel, ListChannelsResponse]: - """ - - - Parameters - ---------- - reference_type : typing.Optional[ReferenceType] - Type of reference associated to channel - - reference_id : typing.Optional[str] - id of reference associated to channel - - status : typing.Optional[ChannelStatus] - Status of channel - - cursor : typing.Optional[str] - Cursor to fetch the next result - - limit : typing.Optional[int] - Maximum number of results to return. - When not provided the returned results will be cap at 100 channels. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Channel, ListChannelsResponse] - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - response = await client.channels.list( - reference_type="UNKNOWN_TYPE", - reference_id="reference_id", - status="ACTIVE", - cursor="cursor", - limit=1, - ) - async for item in response: - yield item - - # alternatively, you can paginate page-by-page - async for page in response.iter_pages(): - yield page - - - asyncio.run(main()) - """ - return await self._raw_client.list( - reference_type=reference_type, - reference_id=reference_id, - status=status, - cursor=cursor, - limit=limit, - request_options=request_options, - ) - - async def bulk_retrieve( - self, *, channel_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None - ) -> BulkRetrieveChannelsResponse: - """ - - - Parameters - ---------- - channel_ids : typing.Sequence[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - BulkRetrieveChannelsResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.channels.bulk_retrieve( - channel_ids=["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.bulk_retrieve(channel_ids=channel_ids, request_options=request_options) - return _response.data - - async def get( - self, channel_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> RetrieveChannelResponse: - """ - - - Parameters - ---------- - channel_id : str - A channel id - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - RetrieveChannelResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.channels.get( - channel_id="channel_id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.get(channel_id, request_options=request_options) - return _response.data diff --git a/src/square/channels/raw_client.py b/src/square/channels/raw_client.py deleted file mode 100644 index 9e647c4c..00000000 --- a/src/square/channels/raw_client.py +++ /dev/null @@ -1,356 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type -from ..types.bulk_retrieve_channels_response import BulkRetrieveChannelsResponse -from ..types.channel import Channel -from ..types.channel_status import ChannelStatus -from ..types.list_channels_response import ListChannelsResponse -from ..types.reference_type import ReferenceType -from ..types.retrieve_channel_response import RetrieveChannelResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawChannelsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def list( - self, - *, - reference_type: typing.Optional[ReferenceType] = None, - reference_id: typing.Optional[str] = None, - status: typing.Optional[ChannelStatus] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Channel, ListChannelsResponse]: - """ - - - Parameters - ---------- - reference_type : typing.Optional[ReferenceType] - Type of reference associated to channel - - reference_id : typing.Optional[str] - id of reference associated to channel - - status : typing.Optional[ChannelStatus] - Status of channel - - cursor : typing.Optional[str] - Cursor to fetch the next result - - limit : typing.Optional[int] - Maximum number of results to return. - When not provided the returned results will be cap at 100 channels. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Channel, ListChannelsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/channels", - method="GET", - params={ - "reference_type": reference_type, - "reference_id": reference_id, - "status": status, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListChannelsResponse, - construct_type( - type_=ListChannelsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.channels - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - reference_type=reference_type, - reference_id=reference_id, - status=status, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def bulk_retrieve( - self, *, channel_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[BulkRetrieveChannelsResponse]: - """ - - - Parameters - ---------- - channel_ids : typing.Sequence[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[BulkRetrieveChannelsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/channels/bulk-retrieve", - method="POST", - json={ - "channel_ids": channel_ids, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - BulkRetrieveChannelsResponse, - construct_type( - type_=BulkRetrieveChannelsResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def get( - self, channel_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[RetrieveChannelResponse]: - """ - - - Parameters - ---------- - channel_id : str - A channel id - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[RetrieveChannelResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/channels/{jsonable_encoder(channel_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - RetrieveChannelResponse, - construct_type( - type_=RetrieveChannelResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawChannelsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def list( - self, - *, - reference_type: typing.Optional[ReferenceType] = None, - reference_id: typing.Optional[str] = None, - status: typing.Optional[ChannelStatus] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Channel, ListChannelsResponse]: - """ - - - Parameters - ---------- - reference_type : typing.Optional[ReferenceType] - Type of reference associated to channel - - reference_id : typing.Optional[str] - id of reference associated to channel - - status : typing.Optional[ChannelStatus] - Status of channel - - cursor : typing.Optional[str] - Cursor to fetch the next result - - limit : typing.Optional[int] - Maximum number of results to return. - When not provided the returned results will be cap at 100 channels. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Channel, ListChannelsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/channels", - method="GET", - params={ - "reference_type": reference_type, - "reference_id": reference_id, - "status": status, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListChannelsResponse, - construct_type( - type_=ListChannelsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.channels - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - reference_type=reference_type, - reference_id=reference_id, - status=status, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def bulk_retrieve( - self, *, channel_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[BulkRetrieveChannelsResponse]: - """ - - - Parameters - ---------- - channel_ids : typing.Sequence[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[BulkRetrieveChannelsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/channels/bulk-retrieve", - method="POST", - json={ - "channel_ids": channel_ids, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - BulkRetrieveChannelsResponse, - construct_type( - type_=BulkRetrieveChannelsResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def get( - self, channel_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[RetrieveChannelResponse]: - """ - - - Parameters - ---------- - channel_id : str - A channel id - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[RetrieveChannelResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/channels/{jsonable_encoder(channel_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - RetrieveChannelResponse, - construct_type( - type_=RetrieveChannelResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/square/checkout/__init__.py b/src/square/checkout/__init__.py index 602dd63f..0e857b81 100644 --- a/src/square/checkout/__init__.py +++ b/src/square/checkout/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import payment_links -_dynamic_imports: typing.Dict[str, str] = {"payment_links": ".payment_links"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import payment_links __all__ = ["payment_links"] diff --git a/src/square/checkout/client.py b/src/square/checkout/client.py index b510a017..960fe5e6 100644 --- a/src/square/checkout/client.py +++ b/src/square/checkout/client.py @@ -1,21 +1,20 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawCheckoutClient +from .payment_links.client import PaymentLinksClient from ..core.request_options import RequestOptions -from ..requests.checkout_location_settings import CheckoutLocationSettingsParams -from ..requests.checkout_merchant_settings import CheckoutMerchantSettingsParams from ..types.retrieve_location_settings_response import RetrieveLocationSettingsResponse -from ..types.retrieve_merchant_settings_response import RetrieveMerchantSettingsResponse +from ..requests.checkout_location_settings import CheckoutLocationSettingsParams from ..types.update_location_settings_response import UpdateLocationSettingsResponse +from ..types.retrieve_merchant_settings_response import RetrieveMerchantSettingsResponse +from ..requests.checkout_merchant_settings import CheckoutMerchantSettingsParams from ..types.update_merchant_settings_response import UpdateMerchantSettingsResponse -from .raw_client import AsyncRawCheckoutClient, RawCheckoutClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCheckoutClient +from .payment_links.client import AsyncPaymentLinksClient -if typing.TYPE_CHECKING: - from .payment_links.client import AsyncPaymentLinksClient, PaymentLinksClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -23,8 +22,7 @@ class CheckoutClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCheckoutClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._payment_links: typing.Optional[PaymentLinksClient] = None + self.payment_links = PaymentLinksClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCheckoutClient: @@ -67,8 +65,8 @@ def retrieve_location_settings( location_id="location_id", ) """ - _response = self._raw_client.retrieve_location_settings(location_id, request_options=request_options) - return _response.data + response = self._raw_client.retrieve_location_settings(location_id, request_options=request_options) + return response.data def update_location_settings( self, @@ -108,10 +106,10 @@ def update_location_settings( location_settings={}, ) """ - _response = self._raw_client.update_location_settings( + response = self._raw_client.update_location_settings( location_id, location_settings=location_settings, request_options=request_options ) - return _response.data + return response.data def retrieve_merchant_settings( self, *, request_options: typing.Optional[RequestOptions] = None @@ -138,8 +136,8 @@ def retrieve_merchant_settings( ) client.checkout.retrieve_merchant_settings() """ - _response = self._raw_client.retrieve_merchant_settings(request_options=request_options) - return _response.data + response = self._raw_client.retrieve_merchant_settings(request_options=request_options) + return response.data def update_merchant_settings( self, @@ -174,25 +172,16 @@ def update_merchant_settings( merchant_settings={}, ) """ - _response = self._raw_client.update_merchant_settings( + response = self._raw_client.update_merchant_settings( merchant_settings=merchant_settings, request_options=request_options ) - return _response.data - - @property - def payment_links(self): - if self._payment_links is None: - from .payment_links.client import PaymentLinksClient # noqa: E402 - - self._payment_links = PaymentLinksClient(client_wrapper=self._client_wrapper) - return self._payment_links + return response.data class AsyncCheckoutClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawCheckoutClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._payment_links: typing.Optional[AsyncPaymentLinksClient] = None + self.payment_links = AsyncPaymentLinksClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCheckoutClient: @@ -243,8 +232,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_location_settings(location_id, request_options=request_options) - return _response.data + response = await self._raw_client.retrieve_location_settings(location_id, request_options=request_options) + return response.data async def update_location_settings( self, @@ -292,10 +281,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_location_settings( + response = await self._raw_client.update_location_settings( location_id, location_settings=location_settings, request_options=request_options ) - return _response.data + return response.data async def retrieve_merchant_settings( self, *, request_options: typing.Optional[RequestOptions] = None @@ -330,8 +319,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_merchant_settings(request_options=request_options) - return _response.data + response = await self._raw_client.retrieve_merchant_settings(request_options=request_options) + return response.data async def update_merchant_settings( self, @@ -374,15 +363,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_merchant_settings( + response = await self._raw_client.update_merchant_settings( merchant_settings=merchant_settings, request_options=request_options ) - return _response.data - - @property - def payment_links(self): - if self._payment_links is None: - from .payment_links.client import AsyncPaymentLinksClient # noqa: E402 - - self._payment_links = AsyncPaymentLinksClient(client_wrapper=self._client_wrapper) - return self._payment_links + return response.data diff --git a/src/square/checkout/payment_links/__init__.py b/src/square/checkout/payment_links/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/checkout/payment_links/__init__.py +++ b/src/square/checkout/payment_links/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/checkout/payment_links/client.py b/src/square/checkout/payment_links/client.py index b1bed60b..7b5db21a 100644 --- a/src/square/checkout/payment_links/client.py +++ b/src/square/checkout/payment_links/client.py @@ -1,22 +1,27 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawPaymentLinksClient from ...core.request_options import RequestOptions -from ...requests.checkout_options import CheckoutOptionsParams +from ...core.pagination import SyncPager +from ...types.payment_link import PaymentLink +from ...types.list_payment_links_response import ListPaymentLinksResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...requests.quick_pay import QuickPayParams from ...requests.order import OrderParams -from ...requests.payment_link import PaymentLinkParams +from ...requests.checkout_options import CheckoutOptionsParams from ...requests.pre_populated_data import PrePopulatedDataParams -from ...requests.quick_pay import QuickPayParams from ...types.create_payment_link_response import CreatePaymentLinkResponse -from ...types.delete_payment_link_response import DeletePaymentLinkResponse from ...types.get_payment_link_response import GetPaymentLinkResponse -from ...types.list_payment_links_response import ListPaymentLinksResponse -from ...types.payment_link import PaymentLink +from ...requests.payment_link import PaymentLinkParams from ...types.update_payment_link_response import UpdatePaymentLinkResponse -from .raw_client import AsyncRawPaymentLinksClient, RawPaymentLinksClient +from ...types.delete_payment_link_response import DeletePaymentLinkResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawPaymentLinksClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -43,7 +48,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentLink, ListPaymentLinksResponse]: + ) -> SyncPager[PaymentLink]: """ Lists all payment links. @@ -67,7 +72,7 @@ def list( Returns ------- - SyncPager[PaymentLink, ListPaymentLinksResponse] + SyncPager[PaymentLink] Success Examples @@ -87,7 +92,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(cursor=cursor, limit=limit, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/online-checkout/payment-links", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPaymentLinksResponse, + construct_type( + type_=ListPaymentLinksResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.payment_links + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -163,7 +198,7 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, description=description, quick_pay=quick_pay, @@ -173,7 +208,7 @@ def create( payment_note=payment_note, request_options=request_options, ) - return _response.data + return response.data def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetPaymentLinkResponse: """ @@ -203,8 +238,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data def update( self, id: str, *, payment_link: PaymentLinkParams, request_options: typing.Optional[RequestOptions] = None @@ -246,8 +281,8 @@ def update( }, ) """ - _response = self._raw_client.update(id, payment_link=payment_link, request_options=request_options) - return _response.data + response = self._raw_client.update(id, payment_link=payment_link, request_options=request_options) + return response.data def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeletePaymentLinkResponse: """ @@ -277,8 +312,8 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = id="id", ) """ - _response = self._raw_client.delete(id, request_options=request_options) - return _response.data + response = self._raw_client.delete(id, request_options=request_options) + return response.data class AsyncPaymentLinksClient: @@ -302,7 +337,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentLink, ListPaymentLinksResponse]: + ) -> AsyncPager[PaymentLink]: """ Lists all payment links. @@ -326,7 +361,7 @@ async def list( Returns ------- - AsyncPager[PaymentLink, ListPaymentLinksResponse] + AsyncPager[PaymentLink] Success Examples @@ -347,7 +382,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -355,7 +389,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(cursor=cursor, limit=limit, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/online-checkout/payment-links", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPaymentLinksResponse, + construct_type( + type_=ListPaymentLinksResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.payment_links + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -439,7 +503,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, description=description, quick_pay=quick_pay, @@ -449,7 +513,7 @@ async def main() -> None: payment_note=payment_note, request_options=request_options, ) - return _response.data + return response.data async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetPaymentLinkResponse: """ @@ -487,8 +551,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data async def update( self, id: str, *, payment_link: PaymentLinkParams, request_options: typing.Optional[RequestOptions] = None @@ -538,8 +602,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update(id, payment_link=payment_link, request_options=request_options) - return _response.data + response = await self._raw_client.update(id, payment_link=payment_link, request_options=request_options) + return response.data async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -579,5 +643,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(id, request_options=request_options) + return response.data diff --git a/src/square/checkout/payment_links/raw_client.py b/src/square/checkout/payment_links/raw_client.py index a0c93ab4..bba44612 100644 --- a/src/square/checkout/payment_links/raw_client.py +++ b/src/square/checkout/payment_links/raw_client.py @@ -1,27 +1,25 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type -from ...requests.checkout_options import CheckoutOptionsParams +from ...core.client_wrapper import SyncClientWrapper +from ...requests.quick_pay import QuickPayParams from ...requests.order import OrderParams -from ...requests.payment_link import PaymentLinkParams +from ...requests.checkout_options import CheckoutOptionsParams from ...requests.pre_populated_data import PrePopulatedDataParams -from ...requests.quick_pay import QuickPayParams +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse from ...types.create_payment_link_response import CreatePaymentLinkResponse -from ...types.delete_payment_link_response import DeletePaymentLinkResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_payment_link_response import GetPaymentLinkResponse -from ...types.list_payment_links_response import ListPaymentLinksResponse -from ...types.payment_link import PaymentLink +from ...core.jsonable_encoder import jsonable_encoder +from ...requests.payment_link import PaymentLinkParams from ...types.update_payment_link_response import UpdatePaymentLinkResponse +from ...types.delete_payment_link_response import DeletePaymentLinkResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -31,71 +29,6 @@ class RawPaymentLinksClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentLink, ListPaymentLinksResponse]: - """ - Lists all payment links. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - If a cursor is not provided, the endpoint returns the first page of the results. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - A limit on the number of results to return per page. The limit is advisory and - the implementation might return more or less results. If the supplied limit is negative, zero, or - greater than the maximum limit of 1000, it is ignored. - - Default value: `100` - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[PaymentLink, ListPaymentLinksResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/online-checkout/payment-links", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPaymentLinksResponse, - construct_type( - type_=ListPaymentLinksResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payment_links - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -192,8 +125,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -231,8 +164,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, id: str, *, payment_link: PaymentLinkParams, request_options: typing.Optional[RequestOptions] = None @@ -285,8 +218,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -324,82 +257,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawPaymentLinksClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentLink, ListPaymentLinksResponse]: - """ - Lists all payment links. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - If a cursor is not provided, the endpoint returns the first page of the results. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - A limit on the number of results to return per page. The limit is advisory and - the implementation might return more or less results. If the supplied limit is negative, zero, or - greater than the maximum limit of 1000, it is ignored. - - Default value: `100` - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[PaymentLink, ListPaymentLinksResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/online-checkout/payment-links", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPaymentLinksResponse, - construct_type( - type_=ListPaymentLinksResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payment_links - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -496,8 +361,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -535,8 +400,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, id: str, *, payment_link: PaymentLinkParams, request_options: typing.Optional[RequestOptions] = None @@ -589,8 +454,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -628,5 +493,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/checkout/raw_client.py b/src/square/checkout/raw_client.py index 2a4d122e..753d0cee 100644 --- a/src/square/checkout/raw_client.py +++ b/src/square/checkout/raw_client.py @@ -1,21 +1,22 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.http_response import HttpResponse +from ..types.retrieve_location_settings_response import RetrieveLocationSettingsResponse +from ..core.jsonable_encoder import jsonable_encoder from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.checkout_location_settings import CheckoutLocationSettingsParams -from ..requests.checkout_merchant_settings import CheckoutMerchantSettingsParams -from ..types.retrieve_location_settings_response import RetrieveLocationSettingsResponse -from ..types.retrieve_merchant_settings_response import RetrieveMerchantSettingsResponse from ..types.update_location_settings_response import UpdateLocationSettingsResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from ..types.retrieve_merchant_settings_response import RetrieveMerchantSettingsResponse +from ..requests.checkout_merchant_settings import CheckoutMerchantSettingsParams from ..types.update_merchant_settings_response import UpdateMerchantSettingsResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -61,8 +62,8 @@ def retrieve_location_settings( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_location_settings( self, @@ -116,8 +117,8 @@ def update_location_settings( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def retrieve_merchant_settings( self, *, request_options: typing.Optional[RequestOptions] = None @@ -152,8 +153,8 @@ def retrieve_merchant_settings( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_merchant_settings( self, @@ -203,8 +204,8 @@ def update_merchant_settings( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCheckoutClient: @@ -247,8 +248,8 @@ async def retrieve_location_settings( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_location_settings( self, @@ -302,8 +303,8 @@ async def update_location_settings( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def retrieve_merchant_settings( self, *, request_options: typing.Optional[RequestOptions] = None @@ -338,8 +339,8 @@ async def retrieve_merchant_settings( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_merchant_settings( self, @@ -389,5 +390,5 @@ async def update_merchant_settings( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/client.py b/src/square/client.py index be23db98..d00177ed 100644 --- a/src/square/client.py +++ b/src/square/client.py @@ -1,51 +1,79 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import os import typing - -import httpx -from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .environment import SquareEnvironment - -if typing.TYPE_CHECKING: - from .apple_pay.client import ApplePayClient, AsyncApplePayClient - from .bank_accounts.client import AsyncBankAccountsClient, BankAccountsClient - from .bookings.client import AsyncBookingsClient, BookingsClient - from .cards.client import AsyncCardsClient, CardsClient - from .cash_drawers.client import AsyncCashDrawersClient, CashDrawersClient - from .catalog.client import AsyncCatalogClient, CatalogClient - from .channels.client import AsyncChannelsClient, ChannelsClient - from .checkout.client import AsyncCheckoutClient, CheckoutClient - from .customers.client import AsyncCustomersClient, CustomersClient - from .devices.client import AsyncDevicesClient, DevicesClient - from .disputes.client import AsyncDisputesClient, DisputesClient - from .employees.client import AsyncEmployeesClient, EmployeesClient - from .events.client import AsyncEventsClient, EventsClient - from .gift_cards.client import AsyncGiftCardsClient, GiftCardsClient - from .inventory.client import AsyncInventoryClient, InventoryClient - from .invoices.client import AsyncInvoicesClient, InvoicesClient - from .labor.client import AsyncLaborClient, LaborClient - from .locations.client import AsyncLocationsClient, LocationsClient - from .loyalty.client import AsyncLoyaltyClient, LoyaltyClient - from .merchants.client import AsyncMerchantsClient, MerchantsClient - from .mobile.client import AsyncMobileClient, MobileClient - from .o_auth.client import AsyncOAuthClient, OAuthClient - from .orders.client import AsyncOrdersClient, OrdersClient - from .payments.client import AsyncPaymentsClient, PaymentsClient - from .payouts.client import AsyncPayoutsClient, PayoutsClient - from .refunds.client import AsyncRefundsClient, RefundsClient - from .sites.client import AsyncSitesClient, SitesClient - from .snippets.client import AsyncSnippetsClient, SnippetsClient - from .subscriptions.client import AsyncSubscriptionsClient, SubscriptionsClient - from .team.client import AsyncTeamClient, TeamClient - from .team_members.client import AsyncTeamMembersClient, TeamMembersClient - from .terminal.client import AsyncTerminalClient, TerminalClient - from .transfer_orders.client import AsyncTransferOrdersClient, TransferOrdersClient - from .v1transactions.client import AsyncV1TransactionsClient, V1TransactionsClient - from .vendors.client import AsyncVendorsClient, VendorsClient - from .webhooks.client import AsyncWebhooksClient, WebhooksClient +import os +import httpx +from .core.client_wrapper import SyncClientWrapper +from .mobile.client import MobileClient +from .o_auth.client import OAuthClient +from .v1transactions.client import V1TransactionsClient +from .apple_pay.client import ApplePayClient +from .bank_accounts.client import BankAccountsClient +from .bookings.client import BookingsClient +from .cards.client import CardsClient +from .catalog.client import CatalogClient +from .customers.client import CustomersClient +from .devices.client import DevicesClient +from .disputes.client import DisputesClient +from .employees.client import EmployeesClient +from .events.client import EventsClient +from .gift_cards.client import GiftCardsClient +from .inventory.client import InventoryClient +from .invoices.client import InvoicesClient +from .labor.client import LaborClient +from .locations.client import LocationsClient +from .loyalty.client import LoyaltyClient +from .merchants.client import MerchantsClient +from .checkout.client import CheckoutClient +from .orders.client import OrdersClient +from .payments.client import PaymentsClient +from .payouts.client import PayoutsClient +from .refunds.client import RefundsClient +from .sites.client import SitesClient +from .snippets.client import SnippetsClient +from .subscriptions.client import SubscriptionsClient +from .team_members.client import TeamMembersClient +from .team.client import TeamClient +from .terminal.client import TerminalClient +from .vendors.client import VendorsClient +from .cash_drawers.client import CashDrawersClient +from .webhooks.client import WebhooksClient +from .core.client_wrapper import AsyncClientWrapper +from .mobile.client import AsyncMobileClient +from .o_auth.client import AsyncOAuthClient +from .v1transactions.client import AsyncV1TransactionsClient +from .apple_pay.client import AsyncApplePayClient +from .bank_accounts.client import AsyncBankAccountsClient +from .bookings.client import AsyncBookingsClient +from .cards.client import AsyncCardsClient +from .catalog.client import AsyncCatalogClient +from .customers.client import AsyncCustomersClient +from .devices.client import AsyncDevicesClient +from .disputes.client import AsyncDisputesClient +from .employees.client import AsyncEmployeesClient +from .events.client import AsyncEventsClient +from .gift_cards.client import AsyncGiftCardsClient +from .inventory.client import AsyncInventoryClient +from .invoices.client import AsyncInvoicesClient +from .labor.client import AsyncLaborClient +from .locations.client import AsyncLocationsClient +from .loyalty.client import AsyncLoyaltyClient +from .merchants.client import AsyncMerchantsClient +from .checkout.client import AsyncCheckoutClient +from .orders.client import AsyncOrdersClient +from .payments.client import AsyncPaymentsClient +from .payouts.client import AsyncPayoutsClient +from .refunds.client import AsyncRefundsClient +from .sites.client import AsyncSitesClient +from .snippets.client import AsyncSnippetsClient +from .subscriptions.client import AsyncSubscriptionsClient +from .team_members.client import AsyncTeamMembersClient +from .team.client import AsyncTeamClient +from .terminal.client import AsyncTerminalClient +from .vendors.client import AsyncVendorsClient +from .cash_drawers.client import AsyncCashDrawersClient +from .webhooks.client import AsyncWebhooksClient class Square: @@ -67,9 +95,6 @@ class Square: token : typing.Optional[typing.Union[str, typing.Callable[[], str]]] - headers : typing.Optional[typing.Dict[str, str]] - Additional headers to send with every request. - timeout : typing.Optional[float] The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. @@ -95,7 +120,6 @@ def __init__( base_url: typing.Optional[str] = None, environment: SquareEnvironment = SquareEnvironment.PRODUCTION, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("SQUARE_TOKEN"), - headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, @@ -107,7 +131,6 @@ def __init__( self._client_wrapper = SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), token=token, - headers=headers, httpx_client=httpx_client if httpx_client is not None else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) @@ -116,330 +139,40 @@ def __init__( timeout=_defaulted_timeout, version=version, ) - self._mobile: typing.Optional[MobileClient] = None - self._o_auth: typing.Optional[OAuthClient] = None - self._v1transactions: typing.Optional[V1TransactionsClient] = None - self._apple_pay: typing.Optional[ApplePayClient] = None - self._bank_accounts: typing.Optional[BankAccountsClient] = None - self._bookings: typing.Optional[BookingsClient] = None - self._cards: typing.Optional[CardsClient] = None - self._catalog: typing.Optional[CatalogClient] = None - self._channels: typing.Optional[ChannelsClient] = None - self._customers: typing.Optional[CustomersClient] = None - self._devices: typing.Optional[DevicesClient] = None - self._disputes: typing.Optional[DisputesClient] = None - self._employees: typing.Optional[EmployeesClient] = None - self._events: typing.Optional[EventsClient] = None - self._gift_cards: typing.Optional[GiftCardsClient] = None - self._inventory: typing.Optional[InventoryClient] = None - self._invoices: typing.Optional[InvoicesClient] = None - self._labor: typing.Optional[LaborClient] = None - self._locations: typing.Optional[LocationsClient] = None - self._loyalty: typing.Optional[LoyaltyClient] = None - self._merchants: typing.Optional[MerchantsClient] = None - self._checkout: typing.Optional[CheckoutClient] = None - self._orders: typing.Optional[OrdersClient] = None - self._payments: typing.Optional[PaymentsClient] = None - self._payouts: typing.Optional[PayoutsClient] = None - self._refunds: typing.Optional[RefundsClient] = None - self._sites: typing.Optional[SitesClient] = None - self._snippets: typing.Optional[SnippetsClient] = None - self._subscriptions: typing.Optional[SubscriptionsClient] = None - self._team_members: typing.Optional[TeamMembersClient] = None - self._team: typing.Optional[TeamClient] = None - self._terminal: typing.Optional[TerminalClient] = None - self._transfer_orders: typing.Optional[TransferOrdersClient] = None - self._vendors: typing.Optional[VendorsClient] = None - self._cash_drawers: typing.Optional[CashDrawersClient] = None - self._webhooks: typing.Optional[WebhooksClient] = None - - @property - def mobile(self): - if self._mobile is None: - from .mobile.client import MobileClient # noqa: E402 - - self._mobile = MobileClient(client_wrapper=self._client_wrapper) - return self._mobile - - @property - def o_auth(self): - if self._o_auth is None: - from .o_auth.client import OAuthClient # noqa: E402 - - self._o_auth = OAuthClient(client_wrapper=self._client_wrapper) - return self._o_auth - - @property - def v1transactions(self): - if self._v1transactions is None: - from .v1transactions.client import V1TransactionsClient # noqa: E402 - - self._v1transactions = V1TransactionsClient(client_wrapper=self._client_wrapper) - return self._v1transactions - - @property - def apple_pay(self): - if self._apple_pay is None: - from .apple_pay.client import ApplePayClient # noqa: E402 - - self._apple_pay = ApplePayClient(client_wrapper=self._client_wrapper) - return self._apple_pay - - @property - def bank_accounts(self): - if self._bank_accounts is None: - from .bank_accounts.client import BankAccountsClient # noqa: E402 - - self._bank_accounts = BankAccountsClient(client_wrapper=self._client_wrapper) - return self._bank_accounts - - @property - def bookings(self): - if self._bookings is None: - from .bookings.client import BookingsClient # noqa: E402 - - self._bookings = BookingsClient(client_wrapper=self._client_wrapper) - return self._bookings - - @property - def cards(self): - if self._cards is None: - from .cards.client import CardsClient # noqa: E402 - - self._cards = CardsClient(client_wrapper=self._client_wrapper) - return self._cards - - @property - def catalog(self): - if self._catalog is None: - from .catalog.client import CatalogClient # noqa: E402 - - self._catalog = CatalogClient(client_wrapper=self._client_wrapper) - return self._catalog - - @property - def channels(self): - if self._channels is None: - from .channels.client import ChannelsClient # noqa: E402 - - self._channels = ChannelsClient(client_wrapper=self._client_wrapper) - return self._channels - - @property - def customers(self): - if self._customers is None: - from .customers.client import CustomersClient # noqa: E402 - - self._customers = CustomersClient(client_wrapper=self._client_wrapper) - return self._customers - - @property - def devices(self): - if self._devices is None: - from .devices.client import DevicesClient # noqa: E402 - - self._devices = DevicesClient(client_wrapper=self._client_wrapper) - return self._devices - - @property - def disputes(self): - if self._disputes is None: - from .disputes.client import DisputesClient # noqa: E402 - - self._disputes = DisputesClient(client_wrapper=self._client_wrapper) - return self._disputes - - @property - def employees(self): - if self._employees is None: - from .employees.client import EmployeesClient # noqa: E402 - - self._employees = EmployeesClient(client_wrapper=self._client_wrapper) - return self._employees - - @property - def events(self): - if self._events is None: - from .events.client import EventsClient # noqa: E402 - - self._events = EventsClient(client_wrapper=self._client_wrapper) - return self._events - - @property - def gift_cards(self): - if self._gift_cards is None: - from .gift_cards.client import GiftCardsClient # noqa: E402 - - self._gift_cards = GiftCardsClient(client_wrapper=self._client_wrapper) - return self._gift_cards - - @property - def inventory(self): - if self._inventory is None: - from .inventory.client import InventoryClient # noqa: E402 - - self._inventory = InventoryClient(client_wrapper=self._client_wrapper) - return self._inventory - - @property - def invoices(self): - if self._invoices is None: - from .invoices.client import InvoicesClient # noqa: E402 - - self._invoices = InvoicesClient(client_wrapper=self._client_wrapper) - return self._invoices - - @property - def labor(self): - if self._labor is None: - from .labor.client import LaborClient # noqa: E402 - - self._labor = LaborClient(client_wrapper=self._client_wrapper) - return self._labor - - @property - def locations(self): - if self._locations is None: - from .locations.client import LocationsClient # noqa: E402 - - self._locations = LocationsClient(client_wrapper=self._client_wrapper) - return self._locations - - @property - def loyalty(self): - if self._loyalty is None: - from .loyalty.client import LoyaltyClient # noqa: E402 - - self._loyalty = LoyaltyClient(client_wrapper=self._client_wrapper) - return self._loyalty - - @property - def merchants(self): - if self._merchants is None: - from .merchants.client import MerchantsClient # noqa: E402 - - self._merchants = MerchantsClient(client_wrapper=self._client_wrapper) - return self._merchants - - @property - def checkout(self): - if self._checkout is None: - from .checkout.client import CheckoutClient # noqa: E402 - - self._checkout = CheckoutClient(client_wrapper=self._client_wrapper) - return self._checkout - - @property - def orders(self): - if self._orders is None: - from .orders.client import OrdersClient # noqa: E402 - - self._orders = OrdersClient(client_wrapper=self._client_wrapper) - return self._orders - - @property - def payments(self): - if self._payments is None: - from .payments.client import PaymentsClient # noqa: E402 - - self._payments = PaymentsClient(client_wrapper=self._client_wrapper) - return self._payments - - @property - def payouts(self): - if self._payouts is None: - from .payouts.client import PayoutsClient # noqa: E402 - - self._payouts = PayoutsClient(client_wrapper=self._client_wrapper) - return self._payouts - - @property - def refunds(self): - if self._refunds is None: - from .refunds.client import RefundsClient # noqa: E402 - - self._refunds = RefundsClient(client_wrapper=self._client_wrapper) - return self._refunds - - @property - def sites(self): - if self._sites is None: - from .sites.client import SitesClient # noqa: E402 - - self._sites = SitesClient(client_wrapper=self._client_wrapper) - return self._sites - - @property - def snippets(self): - if self._snippets is None: - from .snippets.client import SnippetsClient # noqa: E402 - - self._snippets = SnippetsClient(client_wrapper=self._client_wrapper) - return self._snippets - - @property - def subscriptions(self): - if self._subscriptions is None: - from .subscriptions.client import SubscriptionsClient # noqa: E402 - - self._subscriptions = SubscriptionsClient(client_wrapper=self._client_wrapper) - return self._subscriptions - - @property - def team_members(self): - if self._team_members is None: - from .team_members.client import TeamMembersClient # noqa: E402 - - self._team_members = TeamMembersClient(client_wrapper=self._client_wrapper) - return self._team_members - - @property - def team(self): - if self._team is None: - from .team.client import TeamClient # noqa: E402 - - self._team = TeamClient(client_wrapper=self._client_wrapper) - return self._team - - @property - def terminal(self): - if self._terminal is None: - from .terminal.client import TerminalClient # noqa: E402 - - self._terminal = TerminalClient(client_wrapper=self._client_wrapper) - return self._terminal - - @property - def transfer_orders(self): - if self._transfer_orders is None: - from .transfer_orders.client import TransferOrdersClient # noqa: E402 - - self._transfer_orders = TransferOrdersClient(client_wrapper=self._client_wrapper) - return self._transfer_orders - - @property - def vendors(self): - if self._vendors is None: - from .vendors.client import VendorsClient # noqa: E402 - - self._vendors = VendorsClient(client_wrapper=self._client_wrapper) - return self._vendors - - @property - def cash_drawers(self): - if self._cash_drawers is None: - from .cash_drawers.client import CashDrawersClient # noqa: E402 - - self._cash_drawers = CashDrawersClient(client_wrapper=self._client_wrapper) - return self._cash_drawers - - @property - def webhooks(self): - if self._webhooks is None: - from .webhooks.client import WebhooksClient # noqa: E402 - - self._webhooks = WebhooksClient(client_wrapper=self._client_wrapper) - return self._webhooks + self.mobile = MobileClient(client_wrapper=self._client_wrapper) + self.o_auth = OAuthClient(client_wrapper=self._client_wrapper) + self.v1transactions = V1TransactionsClient(client_wrapper=self._client_wrapper) + self.apple_pay = ApplePayClient(client_wrapper=self._client_wrapper) + self.bank_accounts = BankAccountsClient(client_wrapper=self._client_wrapper) + self.bookings = BookingsClient(client_wrapper=self._client_wrapper) + self.cards = CardsClient(client_wrapper=self._client_wrapper) + self.catalog = CatalogClient(client_wrapper=self._client_wrapper) + self.customers = CustomersClient(client_wrapper=self._client_wrapper) + self.devices = DevicesClient(client_wrapper=self._client_wrapper) + self.disputes = DisputesClient(client_wrapper=self._client_wrapper) + self.employees = EmployeesClient(client_wrapper=self._client_wrapper) + self.events = EventsClient(client_wrapper=self._client_wrapper) + self.gift_cards = GiftCardsClient(client_wrapper=self._client_wrapper) + self.inventory = InventoryClient(client_wrapper=self._client_wrapper) + self.invoices = InvoicesClient(client_wrapper=self._client_wrapper) + self.labor = LaborClient(client_wrapper=self._client_wrapper) + self.locations = LocationsClient(client_wrapper=self._client_wrapper) + self.loyalty = LoyaltyClient(client_wrapper=self._client_wrapper) + self.merchants = MerchantsClient(client_wrapper=self._client_wrapper) + self.checkout = CheckoutClient(client_wrapper=self._client_wrapper) + self.orders = OrdersClient(client_wrapper=self._client_wrapper) + self.payments = PaymentsClient(client_wrapper=self._client_wrapper) + self.payouts = PayoutsClient(client_wrapper=self._client_wrapper) + self.refunds = RefundsClient(client_wrapper=self._client_wrapper) + self.sites = SitesClient(client_wrapper=self._client_wrapper) + self.snippets = SnippetsClient(client_wrapper=self._client_wrapper) + self.subscriptions = SubscriptionsClient(client_wrapper=self._client_wrapper) + self.team_members = TeamMembersClient(client_wrapper=self._client_wrapper) + self.team = TeamClient(client_wrapper=self._client_wrapper) + self.terminal = TerminalClient(client_wrapper=self._client_wrapper) + self.vendors = VendorsClient(client_wrapper=self._client_wrapper) + self.cash_drawers = CashDrawersClient(client_wrapper=self._client_wrapper) + self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper) class AsyncSquare: @@ -461,9 +194,6 @@ class AsyncSquare: token : typing.Optional[typing.Union[str, typing.Callable[[], str]]] - headers : typing.Optional[typing.Dict[str, str]] - Additional headers to send with every request. - timeout : typing.Optional[float] The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. @@ -489,7 +219,6 @@ def __init__( base_url: typing.Optional[str] = None, environment: SquareEnvironment = SquareEnvironment.PRODUCTION, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("SQUARE_TOKEN"), - headers: typing.Optional[typing.Dict[str, str]] = None, timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, @@ -501,7 +230,6 @@ def __init__( self._client_wrapper = AsyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), token=token, - headers=headers, httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) @@ -510,330 +238,40 @@ def __init__( timeout=_defaulted_timeout, version=version, ) - self._mobile: typing.Optional[AsyncMobileClient] = None - self._o_auth: typing.Optional[AsyncOAuthClient] = None - self._v1transactions: typing.Optional[AsyncV1TransactionsClient] = None - self._apple_pay: typing.Optional[AsyncApplePayClient] = None - self._bank_accounts: typing.Optional[AsyncBankAccountsClient] = None - self._bookings: typing.Optional[AsyncBookingsClient] = None - self._cards: typing.Optional[AsyncCardsClient] = None - self._catalog: typing.Optional[AsyncCatalogClient] = None - self._channels: typing.Optional[AsyncChannelsClient] = None - self._customers: typing.Optional[AsyncCustomersClient] = None - self._devices: typing.Optional[AsyncDevicesClient] = None - self._disputes: typing.Optional[AsyncDisputesClient] = None - self._employees: typing.Optional[AsyncEmployeesClient] = None - self._events: typing.Optional[AsyncEventsClient] = None - self._gift_cards: typing.Optional[AsyncGiftCardsClient] = None - self._inventory: typing.Optional[AsyncInventoryClient] = None - self._invoices: typing.Optional[AsyncInvoicesClient] = None - self._labor: typing.Optional[AsyncLaborClient] = None - self._locations: typing.Optional[AsyncLocationsClient] = None - self._loyalty: typing.Optional[AsyncLoyaltyClient] = None - self._merchants: typing.Optional[AsyncMerchantsClient] = None - self._checkout: typing.Optional[AsyncCheckoutClient] = None - self._orders: typing.Optional[AsyncOrdersClient] = None - self._payments: typing.Optional[AsyncPaymentsClient] = None - self._payouts: typing.Optional[AsyncPayoutsClient] = None - self._refunds: typing.Optional[AsyncRefundsClient] = None - self._sites: typing.Optional[AsyncSitesClient] = None - self._snippets: typing.Optional[AsyncSnippetsClient] = None - self._subscriptions: typing.Optional[AsyncSubscriptionsClient] = None - self._team_members: typing.Optional[AsyncTeamMembersClient] = None - self._team: typing.Optional[AsyncTeamClient] = None - self._terminal: typing.Optional[AsyncTerminalClient] = None - self._transfer_orders: typing.Optional[AsyncTransferOrdersClient] = None - self._vendors: typing.Optional[AsyncVendorsClient] = None - self._cash_drawers: typing.Optional[AsyncCashDrawersClient] = None - self._webhooks: typing.Optional[AsyncWebhooksClient] = None - - @property - def mobile(self): - if self._mobile is None: - from .mobile.client import AsyncMobileClient # noqa: E402 - - self._mobile = AsyncMobileClient(client_wrapper=self._client_wrapper) - return self._mobile - - @property - def o_auth(self): - if self._o_auth is None: - from .o_auth.client import AsyncOAuthClient # noqa: E402 - - self._o_auth = AsyncOAuthClient(client_wrapper=self._client_wrapper) - return self._o_auth - - @property - def v1transactions(self): - if self._v1transactions is None: - from .v1transactions.client import AsyncV1TransactionsClient # noqa: E402 - - self._v1transactions = AsyncV1TransactionsClient(client_wrapper=self._client_wrapper) - return self._v1transactions - - @property - def apple_pay(self): - if self._apple_pay is None: - from .apple_pay.client import AsyncApplePayClient # noqa: E402 - - self._apple_pay = AsyncApplePayClient(client_wrapper=self._client_wrapper) - return self._apple_pay - - @property - def bank_accounts(self): - if self._bank_accounts is None: - from .bank_accounts.client import AsyncBankAccountsClient # noqa: E402 - - self._bank_accounts = AsyncBankAccountsClient(client_wrapper=self._client_wrapper) - return self._bank_accounts - - @property - def bookings(self): - if self._bookings is None: - from .bookings.client import AsyncBookingsClient # noqa: E402 - - self._bookings = AsyncBookingsClient(client_wrapper=self._client_wrapper) - return self._bookings - - @property - def cards(self): - if self._cards is None: - from .cards.client import AsyncCardsClient # noqa: E402 - - self._cards = AsyncCardsClient(client_wrapper=self._client_wrapper) - return self._cards - - @property - def catalog(self): - if self._catalog is None: - from .catalog.client import AsyncCatalogClient # noqa: E402 - - self._catalog = AsyncCatalogClient(client_wrapper=self._client_wrapper) - return self._catalog - - @property - def channels(self): - if self._channels is None: - from .channels.client import AsyncChannelsClient # noqa: E402 - - self._channels = AsyncChannelsClient(client_wrapper=self._client_wrapper) - return self._channels - - @property - def customers(self): - if self._customers is None: - from .customers.client import AsyncCustomersClient # noqa: E402 - - self._customers = AsyncCustomersClient(client_wrapper=self._client_wrapper) - return self._customers - - @property - def devices(self): - if self._devices is None: - from .devices.client import AsyncDevicesClient # noqa: E402 - - self._devices = AsyncDevicesClient(client_wrapper=self._client_wrapper) - return self._devices - - @property - def disputes(self): - if self._disputes is None: - from .disputes.client import AsyncDisputesClient # noqa: E402 - - self._disputes = AsyncDisputesClient(client_wrapper=self._client_wrapper) - return self._disputes - - @property - def employees(self): - if self._employees is None: - from .employees.client import AsyncEmployeesClient # noqa: E402 - - self._employees = AsyncEmployeesClient(client_wrapper=self._client_wrapper) - return self._employees - - @property - def events(self): - if self._events is None: - from .events.client import AsyncEventsClient # noqa: E402 - - self._events = AsyncEventsClient(client_wrapper=self._client_wrapper) - return self._events - - @property - def gift_cards(self): - if self._gift_cards is None: - from .gift_cards.client import AsyncGiftCardsClient # noqa: E402 - - self._gift_cards = AsyncGiftCardsClient(client_wrapper=self._client_wrapper) - return self._gift_cards - - @property - def inventory(self): - if self._inventory is None: - from .inventory.client import AsyncInventoryClient # noqa: E402 - - self._inventory = AsyncInventoryClient(client_wrapper=self._client_wrapper) - return self._inventory - - @property - def invoices(self): - if self._invoices is None: - from .invoices.client import AsyncInvoicesClient # noqa: E402 - - self._invoices = AsyncInvoicesClient(client_wrapper=self._client_wrapper) - return self._invoices - - @property - def labor(self): - if self._labor is None: - from .labor.client import AsyncLaborClient # noqa: E402 - - self._labor = AsyncLaborClient(client_wrapper=self._client_wrapper) - return self._labor - - @property - def locations(self): - if self._locations is None: - from .locations.client import AsyncLocationsClient # noqa: E402 - - self._locations = AsyncLocationsClient(client_wrapper=self._client_wrapper) - return self._locations - - @property - def loyalty(self): - if self._loyalty is None: - from .loyalty.client import AsyncLoyaltyClient # noqa: E402 - - self._loyalty = AsyncLoyaltyClient(client_wrapper=self._client_wrapper) - return self._loyalty - - @property - def merchants(self): - if self._merchants is None: - from .merchants.client import AsyncMerchantsClient # noqa: E402 - - self._merchants = AsyncMerchantsClient(client_wrapper=self._client_wrapper) - return self._merchants - - @property - def checkout(self): - if self._checkout is None: - from .checkout.client import AsyncCheckoutClient # noqa: E402 - - self._checkout = AsyncCheckoutClient(client_wrapper=self._client_wrapper) - return self._checkout - - @property - def orders(self): - if self._orders is None: - from .orders.client import AsyncOrdersClient # noqa: E402 - - self._orders = AsyncOrdersClient(client_wrapper=self._client_wrapper) - return self._orders - - @property - def payments(self): - if self._payments is None: - from .payments.client import AsyncPaymentsClient # noqa: E402 - - self._payments = AsyncPaymentsClient(client_wrapper=self._client_wrapper) - return self._payments - - @property - def payouts(self): - if self._payouts is None: - from .payouts.client import AsyncPayoutsClient # noqa: E402 - - self._payouts = AsyncPayoutsClient(client_wrapper=self._client_wrapper) - return self._payouts - - @property - def refunds(self): - if self._refunds is None: - from .refunds.client import AsyncRefundsClient # noqa: E402 - - self._refunds = AsyncRefundsClient(client_wrapper=self._client_wrapper) - return self._refunds - - @property - def sites(self): - if self._sites is None: - from .sites.client import AsyncSitesClient # noqa: E402 - - self._sites = AsyncSitesClient(client_wrapper=self._client_wrapper) - return self._sites - - @property - def snippets(self): - if self._snippets is None: - from .snippets.client import AsyncSnippetsClient # noqa: E402 - - self._snippets = AsyncSnippetsClient(client_wrapper=self._client_wrapper) - return self._snippets - - @property - def subscriptions(self): - if self._subscriptions is None: - from .subscriptions.client import AsyncSubscriptionsClient # noqa: E402 - - self._subscriptions = AsyncSubscriptionsClient(client_wrapper=self._client_wrapper) - return self._subscriptions - - @property - def team_members(self): - if self._team_members is None: - from .team_members.client import AsyncTeamMembersClient # noqa: E402 - - self._team_members = AsyncTeamMembersClient(client_wrapper=self._client_wrapper) - return self._team_members - - @property - def team(self): - if self._team is None: - from .team.client import AsyncTeamClient # noqa: E402 - - self._team = AsyncTeamClient(client_wrapper=self._client_wrapper) - return self._team - - @property - def terminal(self): - if self._terminal is None: - from .terminal.client import AsyncTerminalClient # noqa: E402 - - self._terminal = AsyncTerminalClient(client_wrapper=self._client_wrapper) - return self._terminal - - @property - def transfer_orders(self): - if self._transfer_orders is None: - from .transfer_orders.client import AsyncTransferOrdersClient # noqa: E402 - - self._transfer_orders = AsyncTransferOrdersClient(client_wrapper=self._client_wrapper) - return self._transfer_orders - - @property - def vendors(self): - if self._vendors is None: - from .vendors.client import AsyncVendorsClient # noqa: E402 - - self._vendors = AsyncVendorsClient(client_wrapper=self._client_wrapper) - return self._vendors - - @property - def cash_drawers(self): - if self._cash_drawers is None: - from .cash_drawers.client import AsyncCashDrawersClient # noqa: E402 - - self._cash_drawers = AsyncCashDrawersClient(client_wrapper=self._client_wrapper) - return self._cash_drawers - - @property - def webhooks(self): - if self._webhooks is None: - from .webhooks.client import AsyncWebhooksClient # noqa: E402 - - self._webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper) - return self._webhooks + self.mobile = AsyncMobileClient(client_wrapper=self._client_wrapper) + self.o_auth = AsyncOAuthClient(client_wrapper=self._client_wrapper) + self.v1transactions = AsyncV1TransactionsClient(client_wrapper=self._client_wrapper) + self.apple_pay = AsyncApplePayClient(client_wrapper=self._client_wrapper) + self.bank_accounts = AsyncBankAccountsClient(client_wrapper=self._client_wrapper) + self.bookings = AsyncBookingsClient(client_wrapper=self._client_wrapper) + self.cards = AsyncCardsClient(client_wrapper=self._client_wrapper) + self.catalog = AsyncCatalogClient(client_wrapper=self._client_wrapper) + self.customers = AsyncCustomersClient(client_wrapper=self._client_wrapper) + self.devices = AsyncDevicesClient(client_wrapper=self._client_wrapper) + self.disputes = AsyncDisputesClient(client_wrapper=self._client_wrapper) + self.employees = AsyncEmployeesClient(client_wrapper=self._client_wrapper) + self.events = AsyncEventsClient(client_wrapper=self._client_wrapper) + self.gift_cards = AsyncGiftCardsClient(client_wrapper=self._client_wrapper) + self.inventory = AsyncInventoryClient(client_wrapper=self._client_wrapper) + self.invoices = AsyncInvoicesClient(client_wrapper=self._client_wrapper) + self.labor = AsyncLaborClient(client_wrapper=self._client_wrapper) + self.locations = AsyncLocationsClient(client_wrapper=self._client_wrapper) + self.loyalty = AsyncLoyaltyClient(client_wrapper=self._client_wrapper) + self.merchants = AsyncMerchantsClient(client_wrapper=self._client_wrapper) + self.checkout = AsyncCheckoutClient(client_wrapper=self._client_wrapper) + self.orders = AsyncOrdersClient(client_wrapper=self._client_wrapper) + self.payments = AsyncPaymentsClient(client_wrapper=self._client_wrapper) + self.payouts = AsyncPayoutsClient(client_wrapper=self._client_wrapper) + self.refunds = AsyncRefundsClient(client_wrapper=self._client_wrapper) + self.sites = AsyncSitesClient(client_wrapper=self._client_wrapper) + self.snippets = AsyncSnippetsClient(client_wrapper=self._client_wrapper) + self.subscriptions = AsyncSubscriptionsClient(client_wrapper=self._client_wrapper) + self.team_members = AsyncTeamMembersClient(client_wrapper=self._client_wrapper) + self.team = AsyncTeamClient(client_wrapper=self._client_wrapper) + self.terminal = AsyncTerminalClient(client_wrapper=self._client_wrapper) + self.vendors = AsyncVendorsClient(client_wrapper=self._client_wrapper) + self.cash_drawers = AsyncCashDrawersClient(client_wrapper=self._client_wrapper) + self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper) def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SquareEnvironment) -> str: diff --git a/src/square/core/__init__.py b/src/square/core/__init__.py index 0fb6a372..e1f8fa4c 100644 --- a/src/square/core/__init__.py +++ b/src/square/core/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .file import File, with_content_type -_dynamic_imports: typing.Dict[str, str] = {"File": ".file", "with_content_type": ".file"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from .file import File, with_content_type __all__ = ["File", "with_content_type"] diff --git a/src/square/core/client_wrapper.py b/src/square/core/client_wrapper.py index 7f6e80d4..bf191abc 100644 --- a/src/square/core/client_wrapper.py +++ b/src/square/core/client_wrapper.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing - import httpx -from .http_client import AsyncHttpClient, HttpClient +from .http_client import HttpClient +from .http_client import AsyncHttpClient class BaseClientWrapper: @@ -11,29 +11,26 @@ def __init__( self, *, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, version: typing.Optional[str] = None, ): self._token = token - self._headers = headers self._base_url = base_url self._timeout = timeout self._version = version def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "squareup/43.2.1.20251016", + "User-Agent": "squareup/43.2.2", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "squareup", - "X-Fern-SDK-Version": "43.2.1.20251016", - **(self.get_custom_headers() or {}), + "X-Fern-SDK-Version": "43.2.2", } token = self._get_token() if token is not None: headers["Authorization"] = f"Bearer {token}" - headers["Square-Version"] = self._version if self._version is not None else "2025-10-16" + headers["Square-Version"] = self._version if self._version is not None else "2025-07-16" return headers def _get_token(self) -> typing.Optional[str]: @@ -42,9 +39,6 @@ def _get_token(self) -> typing.Optional[str]: else: return self._token() - def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: - return self._headers - def get_base_url(self) -> str: return self._base_url @@ -57,13 +51,12 @@ def __init__( self, *, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, version: typing.Optional[str] = None, httpx_client: httpx.Client, ): - super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout, version=version) + super().__init__(token=token, base_url=base_url, timeout=timeout, version=version) self.httpx_client = HttpClient( httpx_client=httpx_client, base_headers=self.get_headers, @@ -77,13 +70,12 @@ def __init__( self, *, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, version: typing.Optional[str] = None, httpx_client: httpx.AsyncClient, ): - super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout, version=version) + super().__init__(token=token, base_url=base_url, timeout=timeout, version=version) self.httpx_client = AsyncHttpClient( httpx_client=httpx_client, base_headers=self.get_headers, diff --git a/src/square/core/custom_pagination.py b/src/square/core/custom_pagination.py deleted file mode 100644 index 5de2c7a8..00000000 --- a/src/square/core/custom_pagination.py +++ /dev/null @@ -1,152 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -""" -Custom Pagination Support - -This file is designed to be modified by SDK users to implement their own -pagination logic. The generator will import SyncCustomPager and AsyncCustomPager -from this module when custom pagination is used. - -Users should: -1. Implement their custom pager (e.g., PayrocPager, MyCustomPager, etc.) -2. Create adapter classes (SyncCustomPager/AsyncCustomPager) that bridge - between the generated SDK code and their custom pager implementation -""" - -from __future__ import annotations - -from typing import Any, AsyncIterator, Generic, Iterator, TypeVar - -# Import the base utilities you'll need -# Adjust these imports based on your actual structure -try: - from .client_wrapper import AsyncClientWrapper, SyncClientWrapper -except ImportError: - # Fallback for type hints - AsyncClientWrapper = Any # type: ignore - SyncClientWrapper = Any # type: ignore - -TItem = TypeVar("TItem") -TResponse = TypeVar("TResponse") - - -class SyncCustomPager(Generic[TItem, TResponse]): - """ - Adapter for custom synchronous pagination. - - The generator will call this with: - SyncCustomPager(initial_response=response, client_wrapper=client_wrapper) - - Implement this class to extract pagination metadata from your response - and delegate to your custom pager implementation. - - Example implementation: - - class SyncCustomPager(Generic[TItem, TResponse]): - def __init__( - self, - *, - initial_response: TResponse, - client_wrapper: SyncClientWrapper, - ): - # Extract data and pagination metadata from response - data = initial_response.data # Adjust based on your response structure - links = initial_response.links - - # Initialize your custom pager - self._pager = MyCustomPager( - current_page=Page(data), - httpx_client=client_wrapper.httpx_client, - get_headers=client_wrapper.get_headers, - # ... other parameters - ) - - def __iter__(self): - return iter(self._pager) - - # Delegate other methods to your pager... - """ - - def __init__( - self, - *, - initial_response: TResponse, - client_wrapper: SyncClientWrapper, - ): - """ - Initialize the custom pager. - - Args: - initial_response: The parsed API response from the first request - client_wrapper: The client wrapper providing HTTP client and utilities - """ - raise NotImplementedError( - "SyncCustomPager must be implemented. " - "Please implement this class in core/custom_pagination.py to define your pagination logic. " - "See the class docstring for examples." - ) - - def __iter__(self) -> Iterator[TItem]: - """Iterate through all items across all pages.""" - raise NotImplementedError("Must implement __iter__ method") - - -class AsyncCustomPager(Generic[TItem, TResponse]): - """ - Adapter for custom asynchronous pagination. - - The generator will call this with: - AsyncCustomPager(initial_response=response, client_wrapper=client_wrapper) - - Implement this class to extract pagination metadata from your response - and delegate to your custom async pager implementation. - - Example implementation: - - class AsyncCustomPager(Generic[TItem, TResponse]): - def __init__( - self, - *, - initial_response: TResponse, - client_wrapper: AsyncClientWrapper, - ): - # Extract data and pagination metadata from response - data = initial_response.data # Adjust based on your response structure - links = initial_response.links - - # Initialize your custom async pager - self._pager = MyAsyncCustomPager( - current_page=Page(data), - httpx_client=client_wrapper.httpx_client, - get_headers=client_wrapper.get_headers, - # ... other parameters - ) - - async def __aiter__(self): - return self._pager.__aiter__() - - # Delegate other methods to your pager... - """ - - def __init__( - self, - *, - initial_response: TResponse, - client_wrapper: AsyncClientWrapper, - ): - """ - Initialize the custom async pager. - - Args: - initial_response: The parsed API response from the first request - client_wrapper: The client wrapper providing HTTP client and utilities - """ - raise NotImplementedError( - "AsyncCustomPager must be implemented. " - "Please implement this class in core/custom_pagination.py to define your pagination logic. " - "See the class docstring for examples." - ) - - async def __aiter__(self) -> AsyncIterator[TItem]: - """Asynchronously iterate through all items across all pages.""" - raise NotImplementedError("Must implement __aiter__ method") diff --git a/src/square/core/force_multipart.py b/src/square/core/force_multipart.py deleted file mode 100644 index 5440913f..00000000 --- a/src/square/core/force_multipart.py +++ /dev/null @@ -1,18 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict - - -class ForceMultipartDict(Dict[str, Any]): - """ - A dictionary subclass that always evaluates to True in boolean contexts. - - This is used to force multipart/form-data encoding in HTTP requests even when - the dictionary is empty, which would normally evaluate to False. - """ - - def __bool__(self) -> bool: - return True - - -FORCE_MULTIPART = ForceMultipartDict() diff --git a/src/square/core/http_client.py b/src/square/core/http_client.py index e4173f99..e7bd4f79 100644 --- a/src/square/core/http_client.py +++ b/src/square/core/http_client.py @@ -11,12 +11,10 @@ import httpx from .file import File, convert_file_dict_to_httpx_tuples -from .force_multipart import FORCE_MULTIPART from .jsonable_encoder import jsonable_encoder from .query_encoder import encode_query from .remove_none_from_dict import remove_none_from_dict from .request_options import RequestOptions -from httpx._types import RequestFiles INITIAL_RETRY_DELAY_SECONDS = 0.5 MAX_RETRY_DELAY_SECONDS = 10 @@ -180,17 +178,11 @@ def request( json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 2, omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, ) -> httpx.Response: base_url = self.get_base_url(base_url) timeout = ( @@ -201,15 +193,6 @@ def request( json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - response = self.httpx_client.request( method=method, url=urllib.parse.urljoin(f"{base_url}/", path), @@ -242,7 +225,11 @@ def request( json=json_body, data=data_body, content=content, - files=request_files, + files=( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit) + else None + ), timeout=timeout, ) @@ -277,17 +264,11 @@ def stream( json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 2, omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, ) -> typing.Iterator[httpx.Response]: base_url = self.get_base_url(base_url) timeout = ( @@ -296,15 +277,6 @@ def stream( else self.base_timeout() ) - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) with self.httpx_client.stream( @@ -339,7 +311,11 @@ def stream( json=json_body, data=data_body, content=content, - files=request_files, + files=( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit) + else None + ), timeout=timeout, ) as stream: yield stream @@ -378,17 +354,11 @@ async def request( json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 2, omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, ) -> httpx.Response: base_url = self.get_base_url(base_url) timeout = ( @@ -397,15 +367,6 @@ async def request( else self.base_timeout() ) - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) # Add the input to each of these and do None-safety checks @@ -441,7 +402,11 @@ async def request( json=json_body, data=data_body, content=content, - files=request_files, + files=( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if files is not None + else None + ), timeout=timeout, ) @@ -475,17 +440,11 @@ async def stream( json: typing.Optional[typing.Any] = None, data: typing.Optional[typing.Any] = None, content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, headers: typing.Optional[typing.Dict[str, typing.Any]] = None, request_options: typing.Optional[RequestOptions] = None, retries: int = 2, omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, ) -> typing.AsyncIterator[httpx.Response]: base_url = self.get_base_url(base_url) timeout = ( @@ -494,15 +453,6 @@ async def stream( else self.base_timeout() ) - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) async with self.httpx_client.stream( @@ -537,7 +487,11 @@ async def stream( json=json_body, data=data_body, content=content, - files=request_files, + files=( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if files is not None + else None + ), timeout=timeout, ) as stream: yield stream diff --git a/src/square/core/http_response.py b/src/square/core/http_response.py index 2479747e..c72a9130 100644 --- a/src/square/core/http_response.py +++ b/src/square/core/http_response.py @@ -4,32 +4,21 @@ import httpx -# Generic to represent the underlying type of the data wrapped by the HTTP response. T = TypeVar("T") -class BaseHttpResponse: - """Minimalist HTTP response wrapper that exposes response headers.""" - +class HttpResponse(Generic[T]): _response: httpx.Response + _data: T - def __init__(self, response: httpx.Response): + def __init__(self, response: httpx.Response, data: T): self._response = response + self._data = data @property def headers(self) -> Dict[str, str]: return dict(self._response.headers) - -class HttpResponse(Generic[T], BaseHttpResponse): - """HTTP response wrapper that exposes response headers and data.""" - - _data: T - - def __init__(self, response: httpx.Response, data: T): - super().__init__(response) - self._data = data - @property def data(self) -> T: return self._data @@ -38,15 +27,18 @@ def close(self) -> None: self._response.close() -class AsyncHttpResponse(Generic[T], BaseHttpResponse): - """HTTP response wrapper that exposes response headers and data.""" - +class AsyncHttpResponse(Generic[T]): + _response: httpx.Response _data: T def __init__(self, response: httpx.Response, data: T): - super().__init__(response) + self._response = response self._data = data + @property + def headers(self) -> Dict[str, str]: + return dict(self._response.headers) + @property def data(self) -> T: return self._data diff --git a/src/square/core/http_sse/__init__.py b/src/square/core/http_sse/__init__.py deleted file mode 100644 index 730e5a33..00000000 --- a/src/square/core/http_sse/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from ._api import EventSource, aconnect_sse, connect_sse - from ._exceptions import SSEError - from ._models import ServerSentEvent -_dynamic_imports: typing.Dict[str, str] = { - "EventSource": "._api", - "SSEError": "._exceptions", - "ServerSentEvent": "._models", - "aconnect_sse": "._api", - "connect_sse": "._api", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/src/square/core/http_sse/_api.py b/src/square/core/http_sse/_api.py deleted file mode 100644 index f900b3b6..00000000 --- a/src/square/core/http_sse/_api.py +++ /dev/null @@ -1,112 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import re -from contextlib import asynccontextmanager, contextmanager -from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast - -import httpx -from ._decoders import SSEDecoder -from ._exceptions import SSEError -from ._models import ServerSentEvent - - -class EventSource: - def __init__(self, response: httpx.Response) -> None: - self._response = response - - def _check_content_type(self) -> None: - content_type = self._response.headers.get("content-type", "").partition(";")[0] - if "text/event-stream" not in content_type: - raise SSEError( - f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" - ) - - def _get_charset(self) -> str: - """Extract charset from Content-Type header, fallback to UTF-8.""" - content_type = self._response.headers.get("content-type", "") - - # Parse charset parameter using regex - charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) - if charset_match: - charset = charset_match.group(1).strip("\"'") - # Validate that it's a known encoding - try: - # Test if the charset is valid by trying to encode/decode - "test".encode(charset).decode(charset) - return charset - except (LookupError, UnicodeError): - # If charset is invalid, fall back to UTF-8 - pass - - # Default to UTF-8 if no charset specified or invalid charset - return "utf-8" - - @property - def response(self) -> httpx.Response: - return self._response - - def iter_sse(self) -> Iterator[ServerSentEvent]: - self._check_content_type() - decoder = SSEDecoder() - charset = self._get_charset() - - buffer = "" - for chunk in self._response.iter_bytes(): - # Decode chunk using detected charset - text_chunk = chunk.decode(charset, errors="replace") - buffer += text_chunk - - # Process complete lines - while "\n" in buffer: - line, buffer = buffer.split("\n", 1) - line = line.rstrip("\r") - sse = decoder.decode(line) - # when we reach a "\n\n" => line = '' - # => decoder will attempt to return an SSE Event - if sse is not None: - yield sse - - # Process any remaining data in buffer - if buffer.strip(): - line = buffer.rstrip("\r") - sse = decoder.decode(line) - if sse is not None: - yield sse - - async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: - self._check_content_type() - decoder = SSEDecoder() - lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) - try: - async for line in lines: - line = line.rstrip("\n") - sse = decoder.decode(line) - if sse is not None: - yield sse - finally: - await lines.aclose() - - -@contextmanager -def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: - headers = kwargs.pop("headers", {}) - headers["Accept"] = "text/event-stream" - headers["Cache-Control"] = "no-store" - - with client.stream(method, url, headers=headers, **kwargs) as response: - yield EventSource(response) - - -@asynccontextmanager -async def aconnect_sse( - client: httpx.AsyncClient, - method: str, - url: str, - **kwargs: Any, -) -> AsyncIterator[EventSource]: - headers = kwargs.pop("headers", {}) - headers["Accept"] = "text/event-stream" - headers["Cache-Control"] = "no-store" - - async with client.stream(method, url, headers=headers, **kwargs) as response: - yield EventSource(response) diff --git a/src/square/core/http_sse/_decoders.py b/src/square/core/http_sse/_decoders.py deleted file mode 100644 index 339b0890..00000000 --- a/src/square/core/http_sse/_decoders.py +++ /dev/null @@ -1,61 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import List, Optional - -from ._models import ServerSentEvent - - -class SSEDecoder: - def __init__(self) -> None: - self._event = "" - self._data: List[str] = [] - self._last_event_id = "" - self._retry: Optional[int] = None - - def decode(self, line: str) -> Optional[ServerSentEvent]: - # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 - - if not line: - if not self._event and not self._data and not self._last_event_id and self._retry is None: - return None - - sse = ServerSentEvent( - event=self._event, - data="\n".join(self._data), - id=self._last_event_id, - retry=self._retry, - ) - - # NOTE: as per the SSE spec, do not reset last_event_id. - self._event = "" - self._data = [] - self._retry = None - - return sse - - if line.startswith(":"): - return None - - fieldname, _, value = line.partition(":") - - if value.startswith(" "): - value = value[1:] - - if fieldname == "event": - self._event = value - elif fieldname == "data": - self._data.append(value) - elif fieldname == "id": - if "\0" in value: - pass - else: - self._last_event_id = value - elif fieldname == "retry": - try: - self._retry = int(value) - except (TypeError, ValueError): - pass - else: - pass # Field is ignored. - - return None diff --git a/src/square/core/http_sse/_exceptions.py b/src/square/core/http_sse/_exceptions.py deleted file mode 100644 index 81605a8a..00000000 --- a/src/square/core/http_sse/_exceptions.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import httpx - - -class SSEError(httpx.TransportError): - pass diff --git a/src/square/core/http_sse/_models.py b/src/square/core/http_sse/_models.py deleted file mode 100644 index 1af57f8f..00000000 --- a/src/square/core/http_sse/_models.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -from dataclasses import dataclass -from typing import Any, Optional - - -@dataclass(frozen=True) -class ServerSentEvent: - event: str = "message" - data: str = "" - id: str = "" - retry: Optional[int] = None - - def json(self) -> Any: - """Parse the data field as JSON.""" - return json.loads(self.data) diff --git a/src/square/core/pagination.py b/src/square/core/pagination.py index 760b0899..e7e31291 100644 --- a/src/square/core/pagination.py +++ b/src/square/core/pagination.py @@ -1,14 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +import typing -from dataclasses import dataclass -from typing import AsyncIterator, Awaitable, Callable, Generic, Iterator, List, Optional, TypeVar +import pydantic +from typing_extensions import Self # Generic to represent the underlying type of the results within a page -T = TypeVar("T") -# Generic to represent the type of the API response -R = TypeVar("R") +T = typing.TypeVar("T") # SDKs implement a Page ABC per-pagination request, the endpoint then returns a pager that wraps this type @@ -20,63 +18,70 @@ # # This should be the outer function that returns the SyncPager again # get_next=lambda: list(..., cursor: response.cursor) (or list(..., offset: offset + 1)) # ) +class BasePage(pydantic.BaseModel, typing.Generic[T]): + has_next: bool + items: typing.Optional[typing.List[T]] -@dataclass(frozen=True) -class SyncPager(Generic[T, R]): - get_next: Optional[Callable[[], Optional[SyncPager[T, R]]]] - has_next: bool - items: Optional[List[T]] - response: R +class SyncPage(BasePage[T], typing.Generic[T]): + get_next: typing.Optional[typing.Callable[[], typing.Optional[Self]]] + + +class AsyncPage(BasePage[T], typing.Generic[T]): + get_next: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Optional[Self]]]] + +# ---------------------------- + + +class SyncPager(SyncPage[T], typing.Generic[T]): # Here we type ignore the iterator to avoid a mypy error # caused by the type conflict with Pydanitc's __iter__ method # brought in by extending the base model - def __iter__(self) -> Iterator[T]: # type: ignore[override] + def __iter__(self) -> typing.Iterator[T]: # type: ignore for page in self.iter_pages(): if page.items is not None: - yield from page.items - - def iter_pages(self) -> Iterator[SyncPager[T, R]]: - page: Optional[SyncPager[T, R]] = self - while page is not None: - yield page - - if not page.has_next or page.get_next is None: - return + for item in page.items: + yield item - page = page.get_next() - if page is None or page.items is None or len(page.items) == 0: + def iter_pages(self) -> typing.Iterator[SyncPage[T]]: + page: typing.Union[SyncPager[T], None] = self + while True: + if page is not None: + yield page + if page.has_next and page.get_next is not None: + page = page.get_next() + if page is None or page.items is None or len(page.items) == 0: + return + else: + return + else: return - def next_page(self) -> Optional[SyncPager[T, R]]: + def next_page(self) -> typing.Optional[SyncPage[T]]: return self.get_next() if self.get_next is not None else None -@dataclass(frozen=True) -class AsyncPager(Generic[T, R]): - get_next: Optional[Callable[[], Awaitable[Optional[AsyncPager[T, R]]]]] - has_next: bool - items: Optional[List[T]] - response: R - - async def __aiter__(self) -> AsyncIterator[T]: +class AsyncPager(AsyncPage[T], typing.Generic[T]): + async def __aiter__(self) -> typing.AsyncIterator[T]: # type: ignore async for page in self.iter_pages(): if page.items is not None: for item in page.items: yield item - async def iter_pages(self) -> AsyncIterator[AsyncPager[T, R]]: - page: Optional[AsyncPager[T, R]] = self - while page is not None: - yield page - - if not page.has_next or page.get_next is None: - return - - page = await page.get_next() - if page is None or page.items is None or len(page.items) == 0: + async def iter_pages(self) -> typing.AsyncIterator[AsyncPage[T]]: + page: typing.Union[AsyncPager[T], None] = self + while True: + if page is not None: + yield page + if page is not None and page.has_next and page.get_next is not None: + page = await page.get_next() + if page is None or page.items is None or len(page.items) == 0: + return + else: + return + else: return - async def next_page(self) -> Optional[AsyncPager[T, R]]: + async def next_page(self) -> typing.Optional[AsyncPage[T]]: return await self.get_next() if self.get_next is not None else None diff --git a/src/square/core/pydantic_utilities.py b/src/square/core/pydantic_utilities.py index 185e5c4f..f7467bcc 100644 --- a/src/square/core/pydantic_utilities.py +++ b/src/square/core/pydantic_utilities.py @@ -2,66 +2,88 @@ # nopycln: file import datetime as dt +import typing from collections import defaultdict -from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast import pydantic +import typing_extensions +from .datetime_utils import serialize_datetime +from .serialization import convert_and_respect_annotation_metadata IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") if IS_PYDANTIC_V2: - from pydantic.v1.datetime_parse import parse_date as parse_date - from pydantic.v1.datetime_parse import parse_datetime as parse_datetime - from pydantic.v1.fields import ModelField as ModelField - from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] - from pydantic.v1.typing import get_args as get_args - from pydantic.v1.typing import get_origin as get_origin - from pydantic.v1.typing import is_literal_type as is_literal_type - from pydantic.v1.typing import is_union as is_union + # isort will try to reformat the comments on these imports, which breaks mypy + # isort: off + from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + parse_date as parse_date, + ) + from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + parse_datetime as parse_datetime, + ) + from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + ENCODERS_BY_TYPE as encoders_by_type, + ) + from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + get_args as get_args, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + get_origin as get_origin, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + is_literal_type as is_literal_type, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + is_union as is_union, + ) + from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 else: - from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] - from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] - from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef] - from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef] - from pydantic.typing import get_args as get_args # type: ignore[no-redef] - from pydantic.typing import get_origin as get_origin # type: ignore[no-redef] - from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef] - from pydantic.typing import is_union as is_union # type: ignore[no-redef] + from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1 + from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1 + from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1 + from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1 + from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1 + from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1 + from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1 + from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1 + + # isort: on -from .datetime_utils import serialize_datetime -from .serialization import convert_and_respect_annotation_metadata -from typing_extensions import TypeAlias -T = TypeVar("T") -Model = TypeVar("Model", bound=pydantic.BaseModel) +T = typing.TypeVar("T") +Model = typing.TypeVar("Model", bound=pydantic.BaseModel) -def parse_obj_as(type_: Type[T], object_: Any) -> T: +def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] + adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2 return adapter.validate_python(dealiased_object) - return pydantic.parse_obj_as(type_, dealiased_object) + else: + return pydantic.parse_obj_as(type_, dealiased_object) -def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any: +def to_jsonable_with_fallback( + obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any] +) -> typing.Any: if IS_PYDANTIC_V2: from pydantic_core import to_jsonable_python return to_jsonable_python(obj, fallback=fallback_serializer) - return fallback_serializer(obj) + else: + return fallback_serializer(obj) class UniversalBaseModel(pydantic.BaseModel): if IS_PYDANTIC_V2: - model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key] + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # Allow fields beginning with `model_` to be used in the model protected_namespaces=(), - ) + ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] - def serialize_model(self) -> Any: # type: ignore[name-defined] - serialized = self.dict() # type: ignore[attr-defined] + @pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2 + def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2 + serialized = handler(self) data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} return data @@ -72,28 +94,34 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} @classmethod - def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": + def model_construct( + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") return cls.construct(_fields_set, **dealiased_object) @classmethod - def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": + def construct( + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") if IS_PYDANTIC_V2: - return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc] - return super().construct(_fields_set, **dealiased_object) + return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2 + else: + return super().construct(_fields_set, **dealiased_object) - def json(self, **kwargs: Any) -> str: - kwargs_with_defaults = { + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } if IS_PYDANTIC_V2: - return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc] - return super().json(**kwargs_with_defaults) + return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2 + else: + return super().json(**kwargs_with_defaults) - def dict(self, **kwargs: Any) -> Dict[str, Any]: + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: """ Override the default dict method to `exclude_unset` by default. This function patches `exclude_unset` to work include fields within non-None default values. @@ -104,21 +132,21 @@ def dict(self, **kwargs: Any) -> Dict[str, Any]: # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models # that we have less control over, and this is less intrusive than custom serializers for now. if IS_PYDANTIC_V2: - kwargs_with_defaults_exclude_unset = { + kwargs_with_defaults_exclude_unset: typing.Any = { **kwargs, "by_alias": True, "exclude_unset": True, "exclude_none": False, } - kwargs_with_defaults_exclude_none = { + kwargs_with_defaults_exclude_none: typing.Any = { **kwargs, "by_alias": True, "exclude_none": True, "exclude_unset": False, } dict_dump = deep_union_pydantic_dicts( - super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc] - super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc] + super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2 + super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 ) else: @@ -138,7 +166,7 @@ def dict(self, **kwargs: Any) -> Dict[str, Any]: if default is not None: self.__fields_set__.add(name) - kwargs_with_defaults_exclude_unset_include_fields = { + kwargs_with_defaults_exclude_unset_include_fields: typing.Any = { "by_alias": True, "exclude_unset": True, "include": _fields_set, @@ -147,16 +175,15 @@ def dict(self, **kwargs: Any) -> Dict[str, Any]: dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - return cast( - Dict[str, Any], - convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), - ) + return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") -def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: - converted_list: List[Any] = [] +def _union_list_of_pydantic_dicts( + source: typing.List[typing.Any], destination: typing.List[typing.Any] +) -> typing.List[typing.Any]: + converted_list: typing.List[typing.Any] = [] for i, item in enumerate(source): - destination_value = destination[i] + destination_value = destination[i] # type: ignore if isinstance(item, dict): converted_list.append(deep_union_pydantic_dicts(item, destination_value)) elif isinstance(item, list): @@ -166,7 +193,9 @@ def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> return converted_list -def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]: +def deep_union_pydantic_dicts( + source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] +) -> typing.Dict[str, typing.Any]: for key, value in source.items(): node = destination.setdefault(key, {}) if isinstance(value, dict): @@ -184,16 +213,18 @@ def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any if IS_PYDANTIC_V2: - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] + class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2 pass - UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] + UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore else: - UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef] + UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore -def encode_by_type(o: Any) -> Any: - encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) +def encode_by_type(o: typing.Any) -> typing.Any: + encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = ( + defaultdict(tuple) + ) for type_, encoder in encoders_by_type.items(): encoders_by_class_tuples[encoder] += (type_,) @@ -204,51 +235,54 @@ def encode_by_type(o: Any) -> Any: return encoder(o) -def update_forward_refs(model: Type["Model"], **localns: Any) -> None: +def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None: if IS_PYDANTIC_V2: - model.model_rebuild(raise_errors=False) # type: ignore[attr-defined] + model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2 else: model.update_forward_refs(**localns) # Mirrors Pydantic's internal typing -AnyCallable = Callable[..., Any] +AnyCallable = typing.Callable[..., typing.Any] def universal_root_validator( pre: bool = False, -) -> Callable[[AnyCallable], AnyCallable]: +) -> typing.Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: if IS_PYDANTIC_V2: - # In Pydantic v2, for RootModel we always use "before" mode - # The custom validators transform the input value before the model is created - return cast(AnyCallable, pydantic.model_validator(mode="before")(func)) # type: ignore[attr-defined] - return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] + return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 + else: + return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 return decorator -def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]: +def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: if IS_PYDANTIC_V2: - return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined] - return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func)) + return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 + else: + return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 return decorator -PydanticField = Union[ModelField, pydantic.fields.FieldInfo] +PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo] -def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]: +def _get_model_fields( + model: typing.Type["Model"], +) -> typing.Mapping[str, PydanticField]: if IS_PYDANTIC_V2: - return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined] - return cast(Mapping[str, PydanticField], model.__fields__) + return model.model_fields # type: ignore # Pydantic v2 + else: + return model.__fields__ # type: ignore # Pydantic v1 -def _get_field_default(field: PydanticField) -> Any: +def _get_field_default(field: PydanticField) -> typing.Any: try: - value = field.get_default() # type: ignore[union-attr] + value = field.get_default() # type: ignore # Pydantic < v1.10.15 except: value = field.default if IS_PYDANTIC_V2: diff --git a/src/square/core/unchecked_base_model.py b/src/square/core/unchecked_base_model.py index 9ea71ca6..2c2d92a7 100644 --- a/src/square/core/unchecked_base_model.py +++ b/src/square/core/unchecked_base_model.py @@ -124,50 +124,12 @@ def construct( return m -def _validate_collection_items_compatible(collection: typing.Any, target_type: typing.Type[typing.Any]) -> bool: - """ - Validate that all items in a collection are compatible with the target type. - - Args: - collection: The collection to validate (list, set, or dict values) - target_type: The target type to validate against - - Returns: - True if all items are compatible, False otherwise - """ - if inspect.isclass(target_type) and issubclass(target_type, pydantic.BaseModel): - for item in collection: - try: - # Try to validate the item against the target type - if isinstance(item, dict): - parse_obj_as(target_type, item) - else: - # If it's not a dict, it might already be the right type - if not isinstance(item, target_type): - return False - except Exception: - return False - return True - - def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: inner_types = get_args(union_type) if typing.Any in inner_types: return object_ for inner_type in inner_types: - # Handle lists of objects that need parsing - if get_origin(inner_type) is list and isinstance(object_, list): - list_inner_type = get_args(inner_type)[0] - try: - if inspect.isclass(list_inner_type) and issubclass(list_inner_type, pydantic.BaseModel): - # Validate that all items in the list are compatible with the target type - if _validate_collection_items_compatible(object_, list_inner_type): - parsed_list = [parse_obj_as(object_=item, type_=list_inner_type) for item in object_] - return parsed_list - except Exception: - pass - try: if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): # Attempt a validated parse until one works @@ -175,42 +137,7 @@ def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], obj except Exception: continue - # If none of the types work, try matching literal fields first, then fall back - # First pass: try types where all literal fields match the object's values - for inner_type in inner_types: - if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): - fields = _get_model_fields(inner_type) - literal_fields_match = True - - for field_name, field in fields.items(): - # Check if this field has a Literal type - if IS_PYDANTIC_V2: - field_type = field.annotation # type: ignore # Pydantic v2 - else: - field_type = field.outer_type_ # type: ignore # Pydantic v1 - - if is_literal_type(field_type): # type: ignore[arg-type] - field_default = _get_field_default(field) - name_or_alias = get_field_to_alias_mapping(inner_type).get(field_name, field_name) - # Get the value from the object - if isinstance(object_, dict): - object_value = object_.get(name_or_alias) - else: - object_value = getattr(object_, name_or_alias, None) - - # If the literal field value doesn't match, this type is not a match - if object_value is not None and field_default != object_value: - literal_fields_match = False - break - - # If all literal fields match, try to construct this type - if literal_fields_match: - try: - return construct_type(object_=object_, type_=inner_type) - except Exception: - continue - - # Second pass: if no literal matches, just return the first successful cast + # If none of the types work, just return the first successful cast for inner_type in inner_types: try: return construct_type(object_=object_, type_=inner_type) @@ -221,7 +148,7 @@ def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], obj def _convert_union_type(type_: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: base_type = get_origin(type_) or type_ union_type = type_ - if base_type == typing_extensions.Annotated: # type: ignore[comparison-overlap] + if base_type == typing_extensions.Annotated: union_type = get_args(type_)[0] annotated_metadata = get_args(type_)[1:] for metadata in annotated_metadata: @@ -252,11 +179,11 @@ def construct_type(*, type_: typing.Type[typing.Any], object_: typing.Any) -> ty return None base_type = get_origin(type_) or type_ - is_annotated = base_type == typing_extensions.Annotated # type: ignore[comparison-overlap] + is_annotated = base_type == typing_extensions.Annotated maybe_annotation_members = get_args(type_) is_annotated_union = is_annotated and is_union(get_origin(maybe_annotation_members[0])) - if base_type == typing.Any: # type: ignore[comparison-overlap] + if base_type == typing.Any: return object_ if base_type == dict: diff --git a/src/square/customers/__init__.py b/src/square/customers/__init__.py index 90daab04..6b3e506c 100644 --- a/src/square/customers/__init__.py +++ b/src/square/customers/__init__.py @@ -1,40 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import cards, custom_attribute_definitions, custom_attributes, groups, segments -_dynamic_imports: typing.Dict[str, str] = { - "cards": ".cards", - "custom_attribute_definitions": ".custom_attribute_definitions", - "custom_attributes": ".custom_attributes", - "groups": ".groups", - "segments": ".segments", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import cards, custom_attribute_definitions, custom_attributes, groups, segments __all__ = ["cards", "custom_attribute_definitions", "custom_attributes", "groups", "segments"] diff --git a/src/square/customers/cards/__init__.py b/src/square/customers/cards/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/customers/cards/__init__.py +++ b/src/square/customers/cards/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/customers/cards/client.py b/src/square/customers/cards/client.py index 7e121427..90364144 100644 --- a/src/square/customers/cards/client.py +++ b/src/square/customers/cards/client.py @@ -1,13 +1,14 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCardsClient from ...requests.address import AddressParams +from ...core.request_options import RequestOptions from ...types.create_customer_card_response import CreateCustomerCardResponse from ...types.delete_customer_card_response import DeleteCustomerCardResponse -from .raw_client import AsyncRawCardsClient, RawCardsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCardsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -104,7 +105,7 @@ def create( cardholder_name="Amelia Earhart", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( customer_id, card_nonce=card_nonce, billing_address=billing_address, @@ -112,7 +113,7 @@ def create( verification_token=verification_token, request_options=request_options, ) - return _response.data + return response.data def delete( self, customer_id: str, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -148,8 +149,8 @@ def delete( card_id="card_id", ) """ - _response = self._raw_client.delete(customer_id, card_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(customer_id, card_id, request_options=request_options) + return response.data class AsyncCardsClient: @@ -251,7 +252,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( customer_id, card_nonce=card_nonce, billing_address=billing_address, @@ -259,7 +260,7 @@ async def main() -> None: verification_token=verification_token, request_options=request_options, ) - return _response.data + return response.data async def delete( self, customer_id: str, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -303,5 +304,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(customer_id, card_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(customer_id, card_id, request_options=request_options) + return response.data diff --git a/src/square/customers/cards/raw_client.py b/src/square/customers/cards/raw_client.py index 7de85233..e83cc619 100644 --- a/src/square/customers/cards/raw_client.py +++ b/src/square/customers/cards/raw_client.py @@ -1,18 +1,19 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.address import AddressParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_customer_card_response import CreateCustomerCardResponse +from ...core.jsonable_encoder import jsonable_encoder from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.address import AddressParams -from ...types.create_customer_card_response import CreateCustomerCardResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.delete_customer_card_response import DeleteCustomerCardResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -106,8 +107,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, customer_id: str, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -148,8 +149,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCardsClient: @@ -240,8 +241,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, customer_id: str, card_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -282,5 +283,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/customers/client.py b/src/square/customers/client.py index 3ae9e1be..89570583 100644 --- a/src/square/customers/client.py +++ b/src/square/customers/client.py @@ -1,41 +1,45 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomersClient +from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient +from .groups.client import GroupsClient +from .segments.client import SegmentsClient +from .cards.client import CardsClient +from .custom_attributes.client import CustomAttributesClient +from ..types.customer_sort_field import CustomerSortField +from ..types.sort_order import SortOrder from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager +from ..types.customer import Customer +from ..types.list_customers_response import ListCustomersResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.address import AddressParams -from ..requests.bulk_create_customer_data import BulkCreateCustomerDataParams -from ..requests.bulk_update_customer_data import BulkUpdateCustomerDataParams -from ..requests.customer_query import CustomerQueryParams from ..requests.customer_tax_ids import CustomerTaxIdsParams +from ..types.create_customer_response import CreateCustomerResponse +from ..requests.bulk_create_customer_data import BulkCreateCustomerDataParams from ..types.bulk_create_customers_response import BulkCreateCustomersResponse from ..types.bulk_delete_customers_response import BulkDeleteCustomersResponse from ..types.bulk_retrieve_customers_response import BulkRetrieveCustomersResponse +from ..requests.bulk_update_customer_data import BulkUpdateCustomerDataParams from ..types.bulk_update_customers_response import BulkUpdateCustomersResponse -from ..types.create_customer_response import CreateCustomerResponse -from ..types.customer import Customer -from ..types.customer_sort_field import CustomerSortField -from ..types.delete_customer_response import DeleteCustomerResponse -from ..types.get_customer_response import GetCustomerResponse -from ..types.list_customers_response import ListCustomersResponse +from ..requests.customer_query import CustomerQueryParams from ..types.search_customers_response import SearchCustomersResponse -from ..types.sort_order import SortOrder +from ..types.get_customer_response import GetCustomerResponse from ..types.update_customer_response import UpdateCustomerResponse -from .raw_client import AsyncRawCustomersClient, RawCustomersClient - -if typing.TYPE_CHECKING: - from .cards.client import AsyncCardsClient, CardsClient - from .custom_attribute_definitions.client import ( - AsyncCustomAttributeDefinitionsClient, - CustomAttributeDefinitionsClient, - ) - from .custom_attributes.client import AsyncCustomAttributesClient, CustomAttributesClient - from .groups.client import AsyncGroupsClient, GroupsClient - from .segments.client import AsyncSegmentsClient, SegmentsClient +from ..types.delete_customer_response import DeleteCustomerResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomersClient +from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient +from .groups.client import AsyncGroupsClient +from .segments.client import AsyncSegmentsClient +from .cards.client import AsyncCardsClient +from .custom_attributes.client import AsyncCustomAttributesClient +from ..core.pagination import AsyncPager + # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -43,12 +47,15 @@ class CustomersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawCustomersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[CustomAttributeDefinitionsClient] = None - self._groups: typing.Optional[GroupsClient] = None - self._segments: typing.Optional[SegmentsClient] = None - self._cards: typing.Optional[CardsClient] = None - self._custom_attributes: typing.Optional[CustomAttributesClient] = None + self.custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.groups = GroupsClient(client_wrapper=client_wrapper) + + self.segments = SegmentsClient(client_wrapper=client_wrapper) + + self.cards = CardsClient(client_wrapper=client_wrapper) + + self.custom_attributes = CustomAttributesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawCustomersClient: @@ -70,7 +77,7 @@ def list( sort_order: typing.Optional[SortOrder] = None, count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Customer, ListCustomersResponse]: + ) -> SyncPager[Customer]: """ Lists customer profiles associated with a Square account. @@ -113,7 +120,7 @@ def list( Returns ------- - SyncPager[Customer, ListCustomersResponse] + SyncPager[Customer] Success Examples @@ -136,14 +143,43 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, - limit=limit, - sort_field=sort_field, - sort_order=sort_order, - count=count, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/customers", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + "sort_field": sort_field, + "sort_order": sort_order, + "count": count, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomersResponse, + construct_type( + type_=ListCustomersResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + sort_field=sort_field, + sort_order=sort_order, + count=count, + request_options=request_options, + ) + _items = _parsed_response.customers + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -177,7 +213,7 @@ def create( Parameters ---------- idempotency_key : typing.Optional[str] - The idempotency key for the request. For more information, see + The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). given_name : typing.Optional[str] @@ -266,7 +302,7 @@ def create( note="a customer", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, given_name=given_name, family_name=family_name, @@ -281,7 +317,7 @@ def create( tax_ids=tax_ids, request_options=request_options, ) - return _response.data + return response.data def batch_create( self, @@ -364,8 +400,8 @@ def batch_create( }, ) """ - _response = self._raw_client.batch_create(customers=customers, request_options=request_options) - return _response.data + response = self._raw_client.batch_create(customers=customers, request_options=request_options) + return response.data def bulk_delete_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -403,8 +439,8 @@ def bulk_delete_customers( ], ) """ - _response = self._raw_client.bulk_delete_customers(customer_ids=customer_ids, request_options=request_options) - return _response.data + response = self._raw_client.bulk_delete_customers(customer_ids=customer_ids, request_options=request_options) + return response.data def bulk_retrieve_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -442,8 +478,8 @@ def bulk_retrieve_customers( ], ) """ - _response = self._raw_client.bulk_retrieve_customers(customer_ids=customer_ids, request_options=request_options) - return _response.data + response = self._raw_client.bulk_retrieve_customers(customer_ids=customer_ids, request_options=request_options) + return response.data def bulk_update_customers( self, @@ -498,8 +534,8 @@ def bulk_update_customers( }, ) """ - _response = self._raw_client.bulk_update_customers(customers=customers, request_options=request_options) - return _response.data + response = self._raw_client.bulk_update_customers(customers=customers, request_options=request_options) + return response.data def search( self, @@ -575,10 +611,10 @@ def search( }, ) """ - _response = self._raw_client.search( + response = self._raw_client.search( cursor=cursor, limit=limit, query=query, count=count, request_options=request_options ) - return _response.data + return response.data def get(self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetCustomerResponse: """ @@ -608,8 +644,8 @@ def get(self, customer_id: str, *, request_options: typing.Optional[RequestOptio customer_id="customer_id", ) """ - _response = self._raw_client.get(customer_id, request_options=request_options) - return _response.data + response = self._raw_client.get(customer_id, request_options=request_options) + return response.data def update( self, @@ -722,7 +758,7 @@ def update( version=2, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( customer_id, given_name=given_name, family_name=family_name, @@ -738,7 +774,7 @@ def update( tax_ids=tax_ids, request_options=request_options, ) - return _response.data + return response.data def delete( self, @@ -782,59 +818,22 @@ def delete( version=1000000, ) """ - _response = self._raw_client.delete(customer_id, version=version, request_options=request_options) - return _response.data + response = self._raw_client.delete(customer_id, version=version, request_options=request_options) + return response.data - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=self._client_wrapper) - return self._custom_attribute_definitions - - @property - def groups(self): - if self._groups is None: - from .groups.client import GroupsClient # noqa: E402 - self._groups = GroupsClient(client_wrapper=self._client_wrapper) - return self._groups - - @property - def segments(self): - if self._segments is None: - from .segments.client import SegmentsClient # noqa: E402 - - self._segments = SegmentsClient(client_wrapper=self._client_wrapper) - return self._segments - - @property - def cards(self): - if self._cards is None: - from .cards.client import CardsClient # noqa: E402 - - self._cards = CardsClient(client_wrapper=self._client_wrapper) - return self._cards +class AsyncCustomersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawCustomersClient(client_wrapper=client_wrapper) + self.custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient(client_wrapper=client_wrapper) - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import CustomAttributesClient # noqa: E402 + self.groups = AsyncGroupsClient(client_wrapper=client_wrapper) - self._custom_attributes = CustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes + self.segments = AsyncSegmentsClient(client_wrapper=client_wrapper) + self.cards = AsyncCardsClient(client_wrapper=client_wrapper) -class AsyncCustomersClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawCustomersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[AsyncCustomAttributeDefinitionsClient] = None - self._groups: typing.Optional[AsyncGroupsClient] = None - self._segments: typing.Optional[AsyncSegmentsClient] = None - self._cards: typing.Optional[AsyncCardsClient] = None - self._custom_attributes: typing.Optional[AsyncCustomAttributesClient] = None + self.custom_attributes = AsyncCustomAttributesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawCustomersClient: @@ -856,7 +855,7 @@ async def list( sort_order: typing.Optional[SortOrder] = None, count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Customer, ListCustomersResponse]: + ) -> AsyncPager[Customer]: """ Lists customer profiles associated with a Square account. @@ -899,7 +898,7 @@ async def list( Returns ------- - AsyncPager[Customer, ListCustomersResponse] + AsyncPager[Customer] Success Examples @@ -923,7 +922,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -931,14 +929,43 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, - limit=limit, - sort_field=sort_field, - sort_order=sort_order, - count=count, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/customers", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + "sort_field": sort_field, + "sort_order": sort_order, + "count": count, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomersResponse, + construct_type( + type_=ListCustomersResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + sort_field=sort_field, + sort_order=sort_order, + count=count, + request_options=request_options, + ) + _items = _parsed_response.customers + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -972,7 +999,7 @@ async def create( Parameters ---------- idempotency_key : typing.Optional[str] - The idempotency key for the request. For more information, see + The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). given_name : typing.Optional[str] @@ -1069,7 +1096,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, given_name=given_name, family_name=family_name, @@ -1084,7 +1111,7 @@ async def main() -> None: tax_ids=tax_ids, request_options=request_options, ) - return _response.data + return response.data async def batch_create( self, @@ -1175,8 +1202,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_create(customers=customers, request_options=request_options) - return _response.data + response = await self._raw_client.batch_create(customers=customers, request_options=request_options) + return response.data async def bulk_delete_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -1222,10 +1249,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_delete_customers( + response = await self._raw_client.bulk_delete_customers( customer_ids=customer_ids, request_options=request_options ) - return _response.data + return response.data async def bulk_retrieve_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -1271,10 +1298,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_retrieve_customers( + response = await self._raw_client.bulk_retrieve_customers( customer_ids=customer_ids, request_options=request_options ) - return _response.data + return response.data async def bulk_update_customers( self, @@ -1337,8 +1364,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_update_customers(customers=customers, request_options=request_options) - return _response.data + response = await self._raw_client.bulk_update_customers(customers=customers, request_options=request_options) + return response.data async def search( self, @@ -1425,10 +1452,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( cursor=cursor, limit=limit, query=query, count=count, request_options=request_options ) - return _response.data + return response.data async def get( self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1468,8 +1495,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(customer_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(customer_id, request_options=request_options) + return response.data async def update( self, @@ -1590,7 +1617,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( customer_id, given_name=given_name, family_name=family_name, @@ -1606,7 +1633,7 @@ async def main() -> None: tax_ids=tax_ids, request_options=request_options, ) - return _response.data + return response.data async def delete( self, @@ -1658,47 +1685,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(customer_id, version=version, request_options=request_options) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient( - client_wrapper=self._client_wrapper - ) - return self._custom_attribute_definitions - - @property - def groups(self): - if self._groups is None: - from .groups.client import AsyncGroupsClient # noqa: E402 - - self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) - return self._groups - - @property - def segments(self): - if self._segments is None: - from .segments.client import AsyncSegmentsClient # noqa: E402 - - self._segments = AsyncSegmentsClient(client_wrapper=self._client_wrapper) - return self._segments - - @property - def cards(self): - if self._cards is None: - from .cards.client import AsyncCardsClient # noqa: E402 - - self._cards = AsyncCardsClient(client_wrapper=self._client_wrapper) - return self._cards - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import AsyncCustomAttributesClient # noqa: E402 - - self._custom_attributes = AsyncCustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes + response = await self._raw_client.delete(customer_id, version=version, request_options=request_options) + return response.data diff --git a/src/square/customers/custom_attribute_definitions/__init__.py b/src/square/customers/custom_attribute_definitions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/customers/custom_attribute_definitions/__init__.py +++ b/src/square/customers/custom_attribute_definitions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/customers/custom_attribute_definitions/client.py b/src/square/customers/custom_attribute_definitions/client.py index 126fb37f..3435f62f 100644 --- a/src/square/customers/custom_attribute_definitions/client.py +++ b/src/square/customers/custom_attribute_definitions/client.py @@ -1,28 +1,33 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributeDefinitionsClient from ...core.request_options import RequestOptions -from ...requests.batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request import ( - BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestParams, -) +from ...core.pagination import SyncPager +from ...types.custom_attribute_definition import CustomAttributeDefinition +from ...types.list_customer_custom_attribute_definitions_response import ListCustomerCustomAttributeDefinitionsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams -from ...types.batch_upsert_customer_custom_attributes_response import BatchUpsertCustomerCustomAttributesResponse from ...types.create_customer_custom_attribute_definition_response import ( CreateCustomerCustomAttributeDefinitionResponse, ) -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_customer_custom_attribute_definition_response import ( - DeleteCustomerCustomAttributeDefinitionResponse, -) from ...types.get_customer_custom_attribute_definition_response import GetCustomerCustomAttributeDefinitionResponse -from ...types.list_customer_custom_attribute_definitions_response import ListCustomerCustomAttributeDefinitionsResponse from ...types.update_customer_custom_attribute_definition_response import ( UpdateCustomerCustomAttributeDefinitionResponse, ) -from .raw_client import AsyncRawCustomAttributeDefinitionsClient, RawCustomAttributeDefinitionsClient +from ...types.delete_customer_custom_attribute_definition_response import ( + DeleteCustomerCustomAttributeDefinitionResponse, +) +from ...requests.batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request import ( + BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestParams, +) +from ...types.batch_upsert_customer_custom_attributes_response import BatchUpsertCustomerCustomAttributesResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributeDefinitionsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -49,7 +54,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: + ) -> SyncPager[CustomAttributeDefinition]: """ Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -75,7 +80,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] + SyncPager[CustomAttributeDefinition] Success Examples @@ -95,7 +100,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/customers/custom-attribute-definitions", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerCustomAttributeDefinitionsResponse, + construct_type( + type_=ListCustomerCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -158,12 +193,12 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -207,8 +242,8 @@ def get( version=1, ) """ - _response = self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = self._raw_client.get(key, version=version, request_options=request_options) + return response.data def update( self, @@ -276,13 +311,13 @@ def update( }, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -319,8 +354,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(key, request_options=request_options) - return _response.data + response = self._raw_client.delete(key, request_options=request_options) + return response.data def batch_upsert( self, @@ -397,8 +432,8 @@ def batch_upsert( }, ) """ - _response = self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data class AsyncCustomAttributeDefinitionsClient: @@ -422,7 +457,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: + ) -> AsyncPager[CustomAttributeDefinition]: """ Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -448,7 +483,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] + AsyncPager[CustomAttributeDefinition] Success Examples @@ -469,7 +504,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -477,7 +511,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/customers/custom-attribute-definitions", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerCustomAttributeDefinitionsResponse, + construct_type( + type_=ListCustomerCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -548,12 +612,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -605,8 +669,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.get(key, version=version, request_options=request_options) + return response.data async def update( self, @@ -682,13 +746,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -733,8 +797,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(key, request_options=request_options) + return response.data async def batch_upsert( self, @@ -822,5 +886,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data diff --git a/src/square/customers/custom_attribute_definitions/raw_client.py b/src/square/customers/custom_attribute_definitions/raw_client.py index 69c4ff0e..1330e59e 100644 --- a/src/square/customers/custom_attribute_definitions/raw_client.py +++ b/src/square/customers/custom_attribute_definitions/raw_client.py @@ -1,33 +1,31 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type -from ...requests.batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request import ( - BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestParams, -) +from ...core.client_wrapper import SyncClientWrapper from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams -from ...types.batch_upsert_customer_custom_attributes_response import BatchUpsertCustomerCustomAttributesResponse +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse from ...types.create_customer_custom_attribute_definition_response import ( CreateCustomerCustomAttributeDefinitionResponse, ) -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_customer_custom_attribute_definition_response import ( - DeleteCustomerCustomAttributeDefinitionResponse, -) +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_customer_custom_attribute_definition_response import GetCustomerCustomAttributeDefinitionResponse -from ...types.list_customer_custom_attribute_definitions_response import ListCustomerCustomAttributeDefinitionsResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_customer_custom_attribute_definition_response import ( UpdateCustomerCustomAttributeDefinitionResponse, ) +from ...types.delete_customer_custom_attribute_definition_response import ( + DeleteCustomerCustomAttributeDefinitionResponse, +) +from ...requests.batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request import ( + BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestParams, +) +from ...types.batch_upsert_customer_custom_attributes_response import BatchUpsertCustomerCustomAttributesResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -37,73 +35,6 @@ class RawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: - """ - Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that - seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/customers/custom-attribute-definitions", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerCustomAttributeDefinitionsResponse, - construct_type( - type_=ListCustomerCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -173,8 +104,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -226,8 +157,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -307,8 +238,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -351,8 +282,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_upsert( self, @@ -421,84 +352,14 @@ def batch_upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: - """ - Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that - seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/customers/custom-attribute-definitions", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerCustomAttributeDefinitionsResponse, - construct_type( - type_=ListCustomerCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -568,8 +429,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -621,8 +482,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -702,8 +563,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -746,8 +607,8 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_upsert( self, @@ -816,5 +677,5 @@ async def batch_upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/customers/custom_attributes/__init__.py b/src/square/customers/custom_attributes/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/customers/custom_attributes/__init__.py +++ b/src/square/customers/custom_attributes/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/customers/custom_attributes/client.py b/src/square/customers/custom_attributes/client.py index e7b193b4..dbd002b3 100644 --- a/src/square/customers/custom_attributes/client.py +++ b/src/square/customers/custom_attributes/client.py @@ -1,17 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributesClient from ...core.request_options import RequestOptions -from ...requests.custom_attribute import CustomAttributeParams +from ...core.pagination import SyncPager from ...types.custom_attribute import CustomAttribute -from ...types.delete_customer_custom_attribute_response import DeleteCustomerCustomAttributeResponse -from ...types.get_customer_custom_attribute_response import GetCustomerCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_customer_custom_attributes_response import ListCustomerCustomAttributesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.get_customer_custom_attribute_response import GetCustomerCustomAttributeResponse +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_customer_custom_attribute_response import UpsertCustomerCustomAttributeResponse -from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient +from ...types.delete_customer_custom_attribute_response import DeleteCustomerCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -40,7 +46,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: + ) -> SyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. @@ -76,7 +82,7 @@ def list( Returns ------- - SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] + SyncPager[CustomAttribute] Success Examples @@ -98,9 +104,40 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - customer_id, limit=limit, cursor=cursor, with_definitions=with_definitions, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/customers/{jsonable_encoder(customer_id)}/custom-attributes", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerCustomAttributesResponse, + construct_type( + type_=ListCustomerCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + customer_id, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -164,10 +201,10 @@ def get( version=1, ) """ - _response = self._raw_client.get( + response = self._raw_client.get( customer_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data def upsert( self, @@ -234,14 +271,14 @@ def upsert( custom_attribute={"value": "Dune"}, ) """ - _response = self._raw_client.upsert( + response = self._raw_client.upsert( customer_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, customer_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -283,8 +320,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(customer_id, key, request_options=request_options) - return _response.data + response = self._raw_client.delete(customer_id, key, request_options=request_options) + return response.data class AsyncCustomAttributesClient: @@ -310,7 +347,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: + ) -> AsyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. @@ -346,7 +383,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] + AsyncPager[CustomAttribute] Success Examples @@ -369,7 +406,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -377,9 +413,40 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - customer_id, limit=limit, cursor=cursor, with_definitions=with_definitions, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/customers/{jsonable_encoder(customer_id)}/custom-attributes", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerCustomAttributesResponse, + construct_type( + type_=ListCustomerCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + customer_id, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -451,10 +518,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get( + response = await self._raw_client.get( customer_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data async def upsert( self, @@ -529,14 +596,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.upsert( + response = await self._raw_client.upsert( customer_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, customer_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -586,5 +653,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(customer_id, key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(customer_id, key, request_options=request_options) + return response.data diff --git a/src/square/customers/custom_attributes/raw_client.py b/src/square/customers/custom_attributes/raw_client.py index bd97fb7e..4b8f6fa9 100644 --- a/src/square/customers/custom_attributes/raw_client.py +++ b/src/square/customers/custom_attributes/raw_client.py @@ -1,22 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.http_response import HttpResponse +from ...types.get_customer_custom_attribute_response import GetCustomerCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.custom_attribute import CustomAttributeParams -from ...types.custom_attribute import CustomAttribute -from ...types.delete_customer_custom_attribute_response import DeleteCustomerCustomAttributeResponse -from ...types.get_customer_custom_attribute_response import GetCustomerCustomAttributeResponse -from ...types.list_customer_custom_attributes_response import ListCustomerCustomAttributesResponse from ...types.upsert_customer_custom_attribute_response import UpsertCustomerCustomAttributeResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...types.delete_customer_custom_attribute_response import DeleteCustomerCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -26,88 +24,6 @@ class RawCustomAttributesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - customer_id: str, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. - - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - customer_id : str - The ID of the target [customer profile](entity:Customer). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/customers/{jsonable_encoder(customer_id)}/custom-attributes", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerCustomAttributesResponse, - construct_type( - type_=ListCustomerCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - customer_id, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, customer_id: str, @@ -177,8 +93,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def upsert( self, @@ -259,8 +175,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, customer_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -307,99 +223,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - customer_id: str, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. - - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - customer_id : str - The ID of the target [customer profile](entity:Customer). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/customers/{jsonable_encoder(customer_id)}/custom-attributes", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerCustomAttributesResponse, - construct_type( - type_=ListCustomerCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - customer_id, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, customer_id: str, @@ -469,8 +300,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def upsert( self, @@ -551,8 +382,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, customer_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -599,5 +430,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/customers/groups/__init__.py b/src/square/customers/groups/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/customers/groups/__init__.py +++ b/src/square/customers/groups/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/customers/groups/client.py b/src/square/customers/groups/client.py index fb9efafd..c8dc2b08 100644 --- a/src/square/customers/groups/client.py +++ b/src/square/customers/groups/client.py @@ -1,20 +1,25 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawGroupsClient from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager +from ...types.customer_group import CustomerGroup +from ...types.list_customer_groups_response import ListCustomerGroupsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.customer_group import CustomerGroupParams -from ...types.add_group_to_customer_response import AddGroupToCustomerResponse from ...types.create_customer_group_response import CreateCustomerGroupResponse -from ...types.customer_group import CustomerGroup -from ...types.delete_customer_group_response import DeleteCustomerGroupResponse from ...types.get_customer_group_response import GetCustomerGroupResponse -from ...types.list_customer_groups_response import ListCustomerGroupsResponse -from ...types.remove_group_from_customer_response import RemoveGroupFromCustomerResponse from ...types.update_customer_group_response import UpdateCustomerGroupResponse -from .raw_client import AsyncRawGroupsClient, RawGroupsClient +from ...types.delete_customer_group_response import DeleteCustomerGroupResponse +from ...types.add_group_to_customer_response import AddGroupToCustomerResponse +from ...types.remove_group_from_customer_response import RemoveGroupFromCustomerResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawGroupsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -41,7 +46,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerGroup, ListCustomerGroupsResponse]: + ) -> SyncPager[CustomerGroup]: """ Retrieves the list of customer groups of a business. @@ -64,7 +69,7 @@ def list( Returns ------- - SyncPager[CustomerGroup, ListCustomerGroupsResponse] + SyncPager[CustomerGroup] Success Examples @@ -84,7 +89,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(cursor=cursor, limit=limit, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/customers/groups", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerGroupsResponse, + construct_type( + type_=ListCustomerGroupsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.groups + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -125,10 +160,10 @@ def create( group={"name": "Loyal Customers"}, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( group=group, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def get( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -160,8 +195,8 @@ def get( group_id="group_id", ) """ - _response = self._raw_client.get(group_id, request_options=request_options) - return _response.data + response = self._raw_client.get(group_id, request_options=request_options) + return response.data def update( self, group_id: str, *, group: CustomerGroupParams, request_options: typing.Optional[RequestOptions] = None @@ -197,8 +232,8 @@ def update( group={"name": "Loyal Customers"}, ) """ - _response = self._raw_client.update(group_id, group=group, request_options=request_options) - return _response.data + response = self._raw_client.update(group_id, group=group, request_options=request_options) + return response.data def delete( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -230,8 +265,8 @@ def delete( group_id="group_id", ) """ - _response = self._raw_client.delete(group_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(group_id, request_options=request_options) + return response.data def add( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -270,8 +305,8 @@ def add( group_id="group_id", ) """ - _response = self._raw_client.add(customer_id, group_id, request_options=request_options) - return _response.data + response = self._raw_client.add(customer_id, group_id, request_options=request_options) + return response.data def remove( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -310,8 +345,8 @@ def remove( group_id="group_id", ) """ - _response = self._raw_client.remove(customer_id, group_id, request_options=request_options) - return _response.data + response = self._raw_client.remove(customer_id, group_id, request_options=request_options) + return response.data class AsyncGroupsClient: @@ -335,7 +370,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerGroup, ListCustomerGroupsResponse]: + ) -> AsyncPager[CustomerGroup]: """ Retrieves the list of customer groups of a business. @@ -358,7 +393,7 @@ async def list( Returns ------- - AsyncPager[CustomerGroup, ListCustomerGroupsResponse] + AsyncPager[CustomerGroup] Success Examples @@ -379,7 +414,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -387,7 +421,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(cursor=cursor, limit=limit, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/customers/groups", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerGroupsResponse, + construct_type( + type_=ListCustomerGroupsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.groups + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -436,10 +500,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( group=group, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def get( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -479,8 +543,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(group_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(group_id, request_options=request_options) + return response.data async def update( self, group_id: str, *, group: CustomerGroupParams, request_options: typing.Optional[RequestOptions] = None @@ -524,8 +588,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update(group_id, group=group, request_options=request_options) - return _response.data + response = await self._raw_client.update(group_id, group=group, request_options=request_options) + return response.data async def delete( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -565,8 +629,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(group_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(group_id, request_options=request_options) + return response.data async def add( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -613,8 +677,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.add(customer_id, group_id, request_options=request_options) - return _response.data + response = await self._raw_client.add(customer_id, group_id, request_options=request_options) + return response.data async def remove( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -661,5 +725,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.remove(customer_id, group_id, request_options=request_options) - return _response.data + response = await self._raw_client.remove(customer_id, group_id, request_options=request_options) + return response.data diff --git a/src/square/customers/groups/raw_client.py b/src/square/customers/groups/raw_client.py index 2637aaa3..8e7ae04f 100644 --- a/src/square/customers/groups/raw_client.py +++ b/src/square/customers/groups/raw_client.py @@ -1,25 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.customer_group import CustomerGroupParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_customer_group_response import CreateCustomerGroupResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.customer_group import CustomerGroupParams -from ...types.add_group_to_customer_response import AddGroupToCustomerResponse -from ...types.create_customer_group_response import CreateCustomerGroupResponse -from ...types.customer_group import CustomerGroup -from ...types.delete_customer_group_response import DeleteCustomerGroupResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_customer_group_response import GetCustomerGroupResponse -from ...types.list_customer_groups_response import ListCustomerGroupsResponse -from ...types.remove_group_from_customer_response import RemoveGroupFromCustomerResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_customer_group_response import UpdateCustomerGroupResponse +from ...types.delete_customer_group_response import DeleteCustomerGroupResponse +from ...types.add_group_to_customer_response import AddGroupToCustomerResponse +from ...types.remove_group_from_customer_response import RemoveGroupFromCustomerResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -29,70 +27,6 @@ class RawGroupsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerGroup, ListCustomerGroupsResponse]: - """ - Retrieves the list of customer groups of a business. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. - If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomerGroup, ListCustomerGroupsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/customers/groups", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerGroupsResponse, - construct_type( - type_=ListCustomerGroupsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.groups - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -148,8 +82,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -187,8 +121,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, group_id: str, *, group: CustomerGroupParams, request_options: typing.Optional[RequestOptions] = None @@ -238,8 +172,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -277,8 +211,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def add( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -322,8 +256,8 @@ def add( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def remove( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -367,81 +301,14 @@ def remove( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawGroupsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerGroup, ListCustomerGroupsResponse]: - """ - Retrieves the list of customer groups of a business. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. - If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomerGroup, ListCustomerGroupsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/customers/groups", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerGroupsResponse, - construct_type( - type_=ListCustomerGroupsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.groups - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -497,8 +364,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -536,8 +403,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, group_id: str, *, group: CustomerGroupParams, request_options: typing.Optional[RequestOptions] = None @@ -587,8 +454,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -626,8 +493,8 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def add( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -671,8 +538,8 @@ async def add( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def remove( self, customer_id: str, group_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -716,5 +583,5 @@ async def remove( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/customers/raw_client.py b/src/square/customers/raw_client.py index ad3972c7..eb903436 100644 --- a/src/square/customers/raw_client.py +++ b/src/square/customers/raw_client.py @@ -1,34 +1,30 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.address import AddressParams +from ..requests.customer_tax_ids import CustomerTaxIdsParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_customer_response import CreateCustomerResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.address import AddressParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.bulk_create_customer_data import BulkCreateCustomerDataParams -from ..requests.bulk_update_customer_data import BulkUpdateCustomerDataParams -from ..requests.customer_query import CustomerQueryParams -from ..requests.customer_tax_ids import CustomerTaxIdsParams from ..types.bulk_create_customers_response import BulkCreateCustomersResponse from ..types.bulk_delete_customers_response import BulkDeleteCustomersResponse from ..types.bulk_retrieve_customers_response import BulkRetrieveCustomersResponse +from ..requests.bulk_update_customer_data import BulkUpdateCustomerDataParams from ..types.bulk_update_customers_response import BulkUpdateCustomersResponse -from ..types.create_customer_response import CreateCustomerResponse -from ..types.customer import Customer -from ..types.customer_sort_field import CustomerSortField -from ..types.delete_customer_response import DeleteCustomerResponse -from ..types.get_customer_response import GetCustomerResponse -from ..types.list_customers_response import ListCustomersResponse +from ..requests.customer_query import CustomerQueryParams from ..types.search_customers_response import SearchCustomersResponse -from ..types.sort_order import SortOrder +from ..types.get_customer_response import GetCustomerResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.update_customer_response import UpdateCustomerResponse +from ..types.delete_customer_response import DeleteCustomerResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -38,99 +34,6 @@ class RawCustomersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - sort_field: typing.Optional[CustomerSortField] = None, - sort_order: typing.Optional[SortOrder] = None, - count: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Customer, ListCustomersResponse]: - """ - Lists customer profiles associated with a Square account. - - Under normal operating conditions, newly created or updated customer profiles become available - for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated - profiles can take closer to one minute or longer, especially during network incidents and outages. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. - If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - sort_field : typing.Optional[CustomerSortField] - Indicates how customers should be sorted. - - The default value is `DEFAULT`. - - sort_order : typing.Optional[SortOrder] - Indicates whether customers should be sorted in ascending (`ASC`) or - descending (`DESC`) order. - - The default value is `ASC`. - - count : typing.Optional[bool] - Indicates whether to return the total count of customers in the `count` field of the response. - - The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Customer, ListCustomersResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/customers", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - "sort_field": sort_field, - "sort_order": sort_order, - "count": count, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomersResponse, - construct_type( - type_=ListCustomersResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.customers - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - limit=limit, - sort_field=sort_field, - sort_order=sort_order, - count=count, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -163,7 +66,7 @@ def create( Parameters ---------- idempotency_key : typing.Optional[str] - The idempotency key for the request. For more information, see + The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). given_name : typing.Optional[str] @@ -267,8 +170,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_create( self, @@ -333,8 +236,8 @@ def batch_create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_delete_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -381,8 +284,8 @@ def bulk_delete_customers( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_retrieve_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -429,8 +332,8 @@ def bulk_retrieve_customers( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_update_customers( self, @@ -489,8 +392,8 @@ def bulk_update_customers( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -572,8 +475,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -611,8 +514,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -750,8 +653,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, @@ -803,110 +706,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - sort_field: typing.Optional[CustomerSortField] = None, - sort_order: typing.Optional[SortOrder] = None, - count: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Customer, ListCustomersResponse]: - """ - Lists customer profiles associated with a Square account. - - Under normal operating conditions, newly created or updated customer profiles become available - for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated - profiles can take closer to one minute or longer, especially during network incidents and outages. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. - If the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - sort_field : typing.Optional[CustomerSortField] - Indicates how customers should be sorted. - - The default value is `DEFAULT`. - - sort_order : typing.Optional[SortOrder] - Indicates whether customers should be sorted in ascending (`ASC`) or - descending (`DESC`) order. - - The default value is `ASC`. - - count : typing.Optional[bool] - Indicates whether to return the total count of customers in the `count` field of the response. - - The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Customer, ListCustomersResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/customers", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - "sort_field": sort_field, - "sort_order": sort_order, - "count": count, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomersResponse, - construct_type( - type_=ListCustomersResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.customers - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - limit=limit, - sort_field=sort_field, - sort_order=sort_order, - count=count, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -939,7 +746,7 @@ async def create( Parameters ---------- idempotency_key : typing.Optional[str] - The idempotency key for the request. For more information, see + The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). given_name : typing.Optional[str] @@ -1043,8 +850,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_create( self, @@ -1109,8 +916,8 @@ async def batch_create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_delete_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -1157,8 +964,8 @@ async def bulk_delete_customers( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_retrieve_customers( self, *, customer_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None @@ -1205,8 +1012,8 @@ async def bulk_retrieve_customers( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_update_customers( self, @@ -1265,8 +1072,8 @@ async def bulk_update_customers( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -1348,8 +1155,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, customer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1387,8 +1194,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -1526,8 +1333,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, @@ -1579,5 +1386,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/customers/segments/__init__.py b/src/square/customers/segments/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/customers/segments/__init__.py +++ b/src/square/customers/segments/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/customers/segments/client.py b/src/square/customers/segments/client.py index d95eab9e..8a23d12f 100644 --- a/src/square/customers/segments/client.py +++ b/src/square/customers/segments/client.py @@ -1,14 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawSegmentsClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager from ...types.customer_segment import CustomerSegment -from ...types.get_customer_segment_response import GetCustomerSegmentResponse from ...types.list_customer_segments_response import ListCustomerSegmentsResponse -from .raw_client import AsyncRawSegmentsClient, RawSegmentsClient +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.get_customer_segment_response import GetCustomerSegmentResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawSegmentsClient +from ...core.pagination import AsyncPager class SegmentsClient: @@ -32,7 +37,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerSegment, ListCustomerSegmentsResponse]: + ) -> SyncPager[CustomerSegment]: """ Retrieves the list of customer segments of a business. @@ -55,7 +60,7 @@ def list( Returns ------- - SyncPager[CustomerSegment, ListCustomerSegmentsResponse] + SyncPager[CustomerSegment] Success Examples @@ -75,7 +80,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(cursor=cursor, limit=limit, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/customers/segments", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerSegmentsResponse, + construct_type( + type_=ListCustomerSegmentsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.segments + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -107,8 +142,8 @@ def get( segment_id="segment_id", ) """ - _response = self._raw_client.get(segment_id, request_options=request_options) - return _response.data + response = self._raw_client.get(segment_id, request_options=request_options) + return response.data class AsyncSegmentsClient: @@ -132,7 +167,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerSegment, ListCustomerSegmentsResponse]: + ) -> AsyncPager[CustomerSegment]: """ Retrieves the list of customer segments of a business. @@ -155,7 +190,7 @@ async def list( Returns ------- - AsyncPager[CustomerSegment, ListCustomerSegmentsResponse] + AsyncPager[CustomerSegment] Success Examples @@ -176,7 +211,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -184,7 +218,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(cursor=cursor, limit=limit, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/customers/segments", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListCustomerSegmentsResponse, + construct_type( + type_=ListCustomerSegmentsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.segments + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -224,5 +288,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(segment_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(segment_id, request_options=request_options) + return response.data diff --git a/src/square/customers/segments/raw_client.py b/src/square/customers/segments/raw_client.py index aead0dfe..21bf465c 100644 --- a/src/square/customers/segments/raw_client.py +++ b/src/square/customers/segments/raw_client.py @@ -1,88 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type -from ...types.customer_segment import CustomerSegment +from ...core.http_response import HttpResponse from ...types.get_customer_segment_response import GetCustomerSegmentResponse -from ...types.list_customer_segments_response import ListCustomerSegmentsResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawSegmentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerSegment, ListCustomerSegmentsResponse]: - """ - Retrieves the list of customer segments of a business. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by previous calls to `ListCustomerSegments`. - This cursor is used to retrieve the next set of query results. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. - If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomerSegment, ListCustomerSegmentsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/customers/segments", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerSegmentsResponse, - construct_type( - type_=ListCustomerSegmentsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.segments - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetCustomerSegmentResponse]: @@ -119,81 +53,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawSegmentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerSegment, ListCustomerSegmentsResponse]: - """ - Retrieves the list of customer segments of a business. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by previous calls to `ListCustomerSegments`. - This cursor is used to retrieve the next set of query results. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results. - If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomerSegment, ListCustomerSegmentsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/customers/segments", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCustomerSegmentsResponse, - construct_type( - type_=ListCustomerSegmentsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.segments - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, segment_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetCustomerSegmentResponse]: @@ -230,5 +97,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/devices/__init__.py b/src/square/devices/__init__.py index bc1c2328..56e09d86 100644 --- a/src/square/devices/__init__.py +++ b/src/square/devices/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import codes -_dynamic_imports: typing.Dict[str, str] = {"codes": ".codes"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import codes __all__ = ["codes"] diff --git a/src/square/devices/client.py b/src/square/devices/client.py index f4e42b47..6ea7f0cb 100644 --- a/src/square/devices/client.py +++ b/src/square/devices/client.py @@ -1,27 +1,28 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawDevicesClient +from .codes.client import CodesClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..types.sort_order import SortOrder from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager from ..types.device import Device -from ..types.get_device_response import GetDeviceResponse from ..types.list_devices_response import ListDevicesResponse -from ..types.sort_order import SortOrder -from .raw_client import AsyncRawDevicesClient, RawDevicesClient - -if typing.TYPE_CHECKING: - from .codes.client import AsyncCodesClient, CodesClient +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.get_device_response import GetDeviceResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawDevicesClient +from .codes.client import AsyncCodesClient +from ..core.pagination import AsyncPager class DevicesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDevicesClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._codes: typing.Optional[CodesClient] = None + self.codes = CodesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDevicesClient: @@ -42,7 +43,7 @@ def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Device, ListDevicesResponse]: + ) -> SyncPager[Device]: """ List devices associated with the merchant. Currently, only Terminal API devices are supported. @@ -70,7 +71,7 @@ def list( Returns ------- - SyncPager[Device, ListDevicesResponse] + SyncPager[Device] Success Examples @@ -92,9 +93,41 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, sort_order=sort_order, limit=limit, location_id=location_id, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/devices", + method="GET", + params={ + "cursor": cursor, + "sort_order": sort_order, + "limit": limit, + "location_id": location_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDevicesResponse, + construct_type( + type_=ListDevicesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + sort_order=sort_order, + limit=limit, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.devices + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, device_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetDeviceResponse: """ @@ -124,23 +157,14 @@ def get(self, device_id: str, *, request_options: typing.Optional[RequestOptions device_id="device_id", ) """ - _response = self._raw_client.get(device_id, request_options=request_options) - return _response.data - - @property - def codes(self): - if self._codes is None: - from .codes.client import CodesClient # noqa: E402 - - self._codes = CodesClient(client_wrapper=self._client_wrapper) - return self._codes + response = self._raw_client.get(device_id, request_options=request_options) + return response.data class AsyncDevicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDevicesClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._codes: typing.Optional[AsyncCodesClient] = None + self.codes = AsyncCodesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDevicesClient: @@ -161,7 +185,7 @@ async def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Device, ListDevicesResponse]: + ) -> AsyncPager[Device]: """ List devices associated with the merchant. Currently, only Terminal API devices are supported. @@ -189,7 +213,7 @@ async def list( Returns ------- - AsyncPager[Device, ListDevicesResponse] + AsyncPager[Device] Success Examples @@ -212,7 +236,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -220,9 +243,41 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, sort_order=sort_order, limit=limit, location_id=location_id, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/devices", + method="GET", + params={ + "cursor": cursor, + "sort_order": sort_order, + "limit": limit, + "location_id": location_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDevicesResponse, + construct_type( + type_=ListDevicesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + sort_order=sort_order, + limit=limit, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.devices + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, device_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -262,13 +317,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(device_id, request_options=request_options) - return _response.data - - @property - def codes(self): - if self._codes is None: - from .codes.client import AsyncCodesClient # noqa: E402 - - self._codes = AsyncCodesClient(client_wrapper=self._client_wrapper) - return self._codes + response = await self._raw_client.get(device_id, request_options=request_options) + return response.data diff --git a/src/square/devices/codes/__init__.py b/src/square/devices/codes/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/devices/codes/__init__.py +++ b/src/square/devices/codes/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/devices/codes/client.py b/src/square/devices/codes/client.py index 5d4c2819..c42aa134 100644 --- a/src/square/devices/codes/client.py +++ b/src/square/devices/codes/client.py @@ -1,18 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCodesClient +from ...types.product_type import ProductType +from ...types.device_code_status import DeviceCodeStatus from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager +from ...types.device_code import DeviceCode +from ...types.list_device_codes_response import ListDeviceCodesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.device_code import DeviceCodeParams from ...types.create_device_code_response import CreateDeviceCodeResponse -from ...types.device_code import DeviceCode -from ...types.device_code_status import DeviceCodeStatus from ...types.get_device_code_response import GetDeviceCodeResponse -from ...types.list_device_codes_response import ListDeviceCodesResponse -from ...types.product_type import ProductType -from .raw_client import AsyncRawCodesClient, RawCodesClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCodesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -41,7 +46,7 @@ def list( product_type: typing.Optional[ProductType] = None, status: typing.Optional[DeviceCodeStatus] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DeviceCode, ListDeviceCodesResponse]: + ) -> SyncPager[DeviceCode]: """ Lists all DeviceCodes associated with the merchant. @@ -70,7 +75,7 @@ def list( Returns ------- - SyncPager[DeviceCode, ListDeviceCodesResponse] + SyncPager[DeviceCode] Success Examples @@ -91,13 +96,41 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, - location_id=location_id, - product_type=product_type, - status=status, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/devices/codes", + method="GET", + params={ + "cursor": cursor, + "location_id": location_id, + "product_type": product_type, + "status": status, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDeviceCodesResponse, + construct_type( + type_=ListDeviceCodesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + location_id=location_id, + product_type=product_type, + status=status, + request_options=request_options, + ) + _items = _parsed_response.device_codes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -145,10 +178,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, device_code=device_code, request_options=request_options ) - return _response.data + return response.data def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetDeviceCodeResponse: """ @@ -178,8 +211,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data class AsyncCodesClient: @@ -205,7 +238,7 @@ async def list( product_type: typing.Optional[ProductType] = None, status: typing.Optional[DeviceCodeStatus] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DeviceCode, ListDeviceCodesResponse]: + ) -> AsyncPager[DeviceCode]: """ Lists all DeviceCodes associated with the merchant. @@ -234,7 +267,7 @@ async def list( Returns ------- - AsyncPager[DeviceCode, ListDeviceCodesResponse] + AsyncPager[DeviceCode] Success Examples @@ -256,7 +289,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -264,13 +296,41 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, - location_id=location_id, - product_type=product_type, - status=status, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/devices/codes", + method="GET", + params={ + "cursor": cursor, + "location_id": location_id, + "product_type": product_type, + "status": status, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDeviceCodesResponse, + construct_type( + type_=ListDeviceCodesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + location_id=location_id, + product_type=product_type, + status=status, + request_options=request_options, + ) + _items = _parsed_response.device_codes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -326,10 +386,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, device_code=device_code, request_options=request_options ) - return _response.data + return response.data async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetDeviceCodeResponse: """ @@ -367,5 +427,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data diff --git a/src/square/devices/codes/raw_client.py b/src/square/devices/codes/raw_client.py index b6aaabfb..4d99ab20 100644 --- a/src/square/devices/codes/raw_client.py +++ b/src/square/devices/codes/raw_client.py @@ -1,23 +1,19 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.device_code import DeviceCodeParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_device_code_response import CreateDeviceCodeResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.device_code import DeviceCodeParams -from ...types.create_device_code_response import CreateDeviceCodeResponse -from ...types.device_code import DeviceCode -from ...types.device_code_status import DeviceCodeStatus +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_device_code_response import GetDeviceCodeResponse -from ...types.list_device_codes_response import ListDeviceCodesResponse -from ...types.product_type import ProductType +from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -27,82 +23,6 @@ class RawCodesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - product_type: typing.Optional[ProductType] = None, - status: typing.Optional[DeviceCodeStatus] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DeviceCode, ListDeviceCodesResponse]: - """ - Lists all DeviceCodes associated with the merchant. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for your original query. - - See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. - - location_id : typing.Optional[str] - If specified, only returns DeviceCodes of the specified location. - Returns DeviceCodes of all locations if empty. - - product_type : typing.Optional[ProductType] - If specified, only returns DeviceCodes targeting the specified product type. - Returns DeviceCodes of all product types if empty. - - status : typing.Optional[DeviceCodeStatus] - If specified, returns DeviceCodes with the specified statuses. - Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[DeviceCode, ListDeviceCodesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/devices/codes", - method="GET", - params={ - "cursor": cursor, - "location_id": location_id, - "product_type": product_type, - "status": status, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDeviceCodesResponse, - construct_type( - type_=ListDeviceCodesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.device_codes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - location_id=location_id, - product_type=product_type, - status=status, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -160,8 +80,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -199,93 +119,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCodesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - product_type: typing.Optional[ProductType] = None, - status: typing.Optional[DeviceCodeStatus] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DeviceCode, ListDeviceCodesResponse]: - """ - Lists all DeviceCodes associated with the merchant. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for your original query. - - See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. - - location_id : typing.Optional[str] - If specified, only returns DeviceCodes of the specified location. - Returns DeviceCodes of all locations if empty. - - product_type : typing.Optional[ProductType] - If specified, only returns DeviceCodes targeting the specified product type. - Returns DeviceCodes of all product types if empty. - - status : typing.Optional[DeviceCodeStatus] - If specified, returns DeviceCodes with the specified statuses. - Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[DeviceCode, ListDeviceCodesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/devices/codes", - method="GET", - params={ - "cursor": cursor, - "location_id": location_id, - "product_type": product_type, - "status": status, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDeviceCodesResponse, - construct_type( - type_=ListDeviceCodesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.device_codes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - location_id=location_id, - product_type=product_type, - status=status, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -343,8 +184,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -382,5 +223,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/devices/raw_client.py b/src/square/devices/raw_client.py index 3a5b0f9b..83d78c58 100644 --- a/src/square/devices/raw_client.py +++ b/src/square/devices/raw_client.py @@ -1,100 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type -from ..types.device import Device +from ..core.http_response import HttpResponse from ..types.get_device_response import GetDeviceResponse -from ..types.list_devices_response import ListDevicesResponse -from ..types.sort_order import SortOrder +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawDevicesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - sort_order: typing.Optional[SortOrder] = None, - limit: typing.Optional[int] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Device, ListDevicesResponse]: - """ - List devices associated with the merchant. Currently, only Terminal API - devices are supported. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. - - sort_order : typing.Optional[SortOrder] - The order in which results are listed. - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - limit : typing.Optional[int] - The number of results to return in a single page. - - location_id : typing.Optional[str] - If present, only returns devices at the target location. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Device, ListDevicesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/devices", - method="GET", - params={ - "cursor": cursor, - "sort_order": sort_order, - "limit": limit, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDevicesResponse, - construct_type( - type_=ListDevicesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.devices - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - sort_order=sort_order, - limit=limit, - location_id=location_id, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, device_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetDeviceResponse]: @@ -131,92 +53,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawDevicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - sort_order: typing.Optional[SortOrder] = None, - limit: typing.Optional[int] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Device, ListDevicesResponse]: - """ - List devices associated with the merchant. Currently, only Terminal API - devices are supported. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. - - sort_order : typing.Optional[SortOrder] - The order in which results are listed. - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - limit : typing.Optional[int] - The number of results to return in a single page. - - location_id : typing.Optional[str] - If present, only returns devices at the target location. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Device, ListDevicesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/devices", - method="GET", - params={ - "cursor": cursor, - "sort_order": sort_order, - "limit": limit, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDevicesResponse, - construct_type( - type_=ListDevicesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.devices - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - sort_order=sort_order, - limit=limit, - location_id=location_id, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, device_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetDeviceResponse]: @@ -253,5 +97,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/disputes/__init__.py b/src/square/disputes/__init__.py index 94331272..899056be 100644 --- a/src/square/disputes/__init__.py +++ b/src/square/disputes/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import evidence -_dynamic_imports: typing.Dict[str, str] = {"evidence": ".evidence"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import evidence __all__ = ["evidence"] diff --git a/src/square/disputes/client.py b/src/square/disputes/client.py index 88bb04dc..1066eac9 100644 --- a/src/square/disputes/client.py +++ b/src/square/disputes/client.py @@ -1,27 +1,30 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from .. import core -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawDisputesClient +from .evidence.client import EvidenceClient +from ..types.dispute_state import DisputeState from ..core.request_options import RequestOptions -from ..requests.create_dispute_evidence_file_request import CreateDisputeEvidenceFileRequestParams +from ..core.pagination import SyncPager +from ..types.dispute import Dispute +from ..types.list_disputes_response import ListDisputesResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.get_dispute_response import GetDisputeResponse from ..types.accept_dispute_response import AcceptDisputeResponse +from ..requests.create_dispute_evidence_file_request import CreateDisputeEvidenceFileRequestParams +from .. import core from ..types.create_dispute_evidence_file_response import CreateDisputeEvidenceFileResponse -from ..types.create_dispute_evidence_text_response import CreateDisputeEvidenceTextResponse -from ..types.dispute import Dispute from ..types.dispute_evidence_type import DisputeEvidenceType -from ..types.dispute_state import DisputeState -from ..types.get_dispute_response import GetDisputeResponse -from ..types.list_disputes_response import ListDisputesResponse +from ..types.create_dispute_evidence_text_response import CreateDisputeEvidenceTextResponse from ..types.submit_evidence_response import SubmitEvidenceResponse -from .raw_client import AsyncRawDisputesClient, RawDisputesClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawDisputesClient +from .evidence.client import AsyncEvidenceClient +from ..core.pagination import AsyncPager -if typing.TYPE_CHECKING: - from .evidence.client import AsyncEvidenceClient, EvidenceClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -29,8 +32,7 @@ class DisputesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawDisputesClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._evidence: typing.Optional[EvidenceClient] = None + self.evidence = EvidenceClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawDisputesClient: @@ -50,7 +52,7 @@ def list( states: typing.Optional[DisputeState] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Dispute, ListDisputesResponse]: + ) -> SyncPager[Dispute]: """ Returns a list of disputes associated with a particular account. @@ -73,7 +75,7 @@ def list( Returns ------- - SyncPager[Dispute, ListDisputesResponse] + SyncPager[Dispute] Success Examples @@ -94,9 +96,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, states=states, location_id=location_id, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/disputes", + method="GET", + params={ + "cursor": cursor, + "states": states, + "location_id": location_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDisputesResponse, + construct_type( + type_=ListDisputesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + states=states, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.disputes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetDisputeResponse: """ @@ -126,8 +158,8 @@ def get(self, dispute_id: str, *, request_options: typing.Optional[RequestOption dispute_id="dispute_id", ) """ - _response = self._raw_client.get(dispute_id, request_options=request_options) - return _response.data + response = self._raw_client.get(dispute_id, request_options=request_options) + return response.data def accept( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -163,8 +195,8 @@ def accept( dispute_id="dispute_id", ) """ - _response = self._raw_client.accept(dispute_id, request_options=request_options) - return _response.data + response = self._raw_client.accept(dispute_id, request_options=request_options) + return response.data def create_evidence_file( self, @@ -207,10 +239,10 @@ def create_evidence_file( dispute_id="dispute_id", ) """ - _response = self._raw_client.create_evidence_file( + response = self._raw_client.create_evidence_file( dispute_id, request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data def create_evidence_text( self, @@ -261,14 +293,14 @@ def create_evidence_text( evidence_text="1Z8888888888888888", ) """ - _response = self._raw_client.create_evidence_text( + response = self._raw_client.create_evidence_text( dispute_id, idempotency_key=idempotency_key, evidence_text=evidence_text, evidence_type=evidence_type, request_options=request_options, ) - return _response.data + return response.data def submit_evidence( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -306,23 +338,14 @@ def submit_evidence( dispute_id="dispute_id", ) """ - _response = self._raw_client.submit_evidence(dispute_id, request_options=request_options) - return _response.data - - @property - def evidence(self): - if self._evidence is None: - from .evidence.client import EvidenceClient # noqa: E402 - - self._evidence = EvidenceClient(client_wrapper=self._client_wrapper) - return self._evidence + response = self._raw_client.submit_evidence(dispute_id, request_options=request_options) + return response.data class AsyncDisputesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawDisputesClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._evidence: typing.Optional[AsyncEvidenceClient] = None + self.evidence = AsyncEvidenceClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawDisputesClient: @@ -342,7 +365,7 @@ async def list( states: typing.Optional[DisputeState] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Dispute, ListDisputesResponse]: + ) -> AsyncPager[Dispute]: """ Returns a list of disputes associated with a particular account. @@ -365,7 +388,7 @@ async def list( Returns ------- - AsyncPager[Dispute, ListDisputesResponse] + AsyncPager[Dispute] Success Examples @@ -387,7 +410,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -395,9 +417,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, states=states, location_id=location_id, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/disputes", + method="GET", + params={ + "cursor": cursor, + "states": states, + "location_id": location_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDisputesResponse, + construct_type( + type_=ListDisputesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + states=states, + location_id=location_id, + request_options=request_options, + ) + _items = _parsed_response.disputes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -437,8 +489,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(dispute_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(dispute_id, request_options=request_options) + return response.data async def accept( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -482,8 +534,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.accept(dispute_id, request_options=request_options) - return _response.data + response = await self._raw_client.accept(dispute_id, request_options=request_options) + return response.data async def create_evidence_file( self, @@ -534,10 +586,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create_evidence_file( + response = await self._raw_client.create_evidence_file( dispute_id, request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data async def create_evidence_text( self, @@ -596,14 +648,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create_evidence_text( + response = await self._raw_client.create_evidence_text( dispute_id, idempotency_key=idempotency_key, evidence_text=evidence_text, evidence_type=evidence_type, request_options=request_options, ) - return _response.data + return response.data async def submit_evidence( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -649,13 +701,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.submit_evidence(dispute_id, request_options=request_options) - return _response.data - - @property - def evidence(self): - if self._evidence is None: - from .evidence.client import AsyncEvidenceClient # noqa: E402 - - self._evidence = AsyncEvidenceClient(client_wrapper=self._client_wrapper) - return self._evidence + response = await self._raw_client.submit_evidence(dispute_id, request_options=request_options) + return response.data diff --git a/src/square/disputes/evidence/__init__.py b/src/square/disputes/evidence/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/disputes/evidence/__init__.py +++ b/src/square/disputes/evidence/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/disputes/evidence/client.py b/src/square/disputes/evidence/client.py index 1f549aac..5b496179 100644 --- a/src/square/disputes/evidence/client.py +++ b/src/square/disputes/evidence/client.py @@ -1,15 +1,21 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawEvidenceClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...types.delete_dispute_evidence_response import DeleteDisputeEvidenceResponse +from ...core.pagination import SyncPager from ...types.dispute_evidence import DisputeEvidence -from ...types.get_dispute_evidence_response import GetDisputeEvidenceResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_dispute_evidence_response import ListDisputeEvidenceResponse -from .raw_client import AsyncRawEvidenceClient, RawEvidenceClient +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.get_dispute_evidence_response import GetDisputeEvidenceResponse +from ...types.delete_dispute_evidence_response import DeleteDisputeEvidenceResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawEvidenceClient +from ...core.pagination import AsyncPager class EvidenceClient: @@ -33,7 +39,7 @@ def list( *, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: + ) -> SyncPager[DisputeEvidence]: """ Returns a list of evidence associated with a dispute. @@ -52,7 +58,7 @@ def list( Returns ------- - SyncPager[DisputeEvidence, ListDisputeEvidenceResponse] + SyncPager[DisputeEvidence] Success Examples @@ -72,7 +78,36 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(dispute_id, cursor=cursor, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/disputes/{jsonable_encoder(dispute_id)}/evidence", + method="GET", + params={ + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDisputeEvidenceResponse, + construct_type( + type_=ListDisputeEvidenceResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + dispute_id, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.evidence + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -110,8 +145,8 @@ def get( evidence_id="evidence_id", ) """ - _response = self._raw_client.get(dispute_id, evidence_id, request_options=request_options) - return _response.data + response = self._raw_client.get(dispute_id, evidence_id, request_options=request_options) + return response.data def delete( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -148,8 +183,8 @@ def delete( evidence_id="evidence_id", ) """ - _response = self._raw_client.delete(dispute_id, evidence_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(dispute_id, evidence_id, request_options=request_options) + return response.data class AsyncEvidenceClient: @@ -173,7 +208,7 @@ async def list( *, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: + ) -> AsyncPager[DisputeEvidence]: """ Returns a list of evidence associated with a dispute. @@ -192,7 +227,7 @@ async def list( Returns ------- - AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse] + AsyncPager[DisputeEvidence] Success Examples @@ -213,7 +248,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -221,7 +255,36 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(dispute_id, cursor=cursor, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/disputes/{jsonable_encoder(dispute_id)}/evidence", + method="GET", + params={ + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListDisputeEvidenceResponse, + construct_type( + type_=ListDisputeEvidenceResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + dispute_id, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.evidence + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -267,8 +330,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(dispute_id, evidence_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(dispute_id, evidence_id, request_options=request_options) + return response.data async def delete( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -313,5 +376,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(dispute_id, evidence_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(dispute_id, evidence_id, request_options=request_options) + return response.data diff --git a/src/square/disputes/evidence/raw_client.py b/src/square/disputes/evidence/raw_client.py index 3f71bdeb..20879e93 100644 --- a/src/square/disputes/evidence/raw_client.py +++ b/src/square/disputes/evidence/raw_client.py @@ -1,84 +1,23 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.get_dispute_evidence_response import GetDisputeEvidenceResponse +from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.delete_dispute_evidence_response import DeleteDisputeEvidenceResponse -from ...types.dispute_evidence import DisputeEvidence -from ...types.get_dispute_evidence_response import GetDisputeEvidenceResponse -from ...types.list_dispute_evidence_response import ListDisputeEvidenceResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawEvidenceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - dispute_id: str, - *, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: - """ - Returns a list of evidence associated with a dispute. - - Parameters - ---------- - dispute_id : str - The ID of the dispute. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[DisputeEvidence, ListDisputeEvidenceResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/disputes/{jsonable_encoder(dispute_id)}/evidence", - method="GET", - params={ - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDisputeEvidenceResponse, - construct_type( - type_=ListDisputeEvidenceResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.evidence - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - dispute_id, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetDisputeEvidenceResponse]: @@ -120,8 +59,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -163,76 +102,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawEvidenceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - dispute_id: str, - *, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: - """ - Returns a list of evidence associated with a dispute. - - Parameters - ---------- - dispute_id : str - The ID of the dispute. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/disputes/{jsonable_encoder(dispute_id)}/evidence", - method="GET", - params={ - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDisputeEvidenceResponse, - construct_type( - type_=ListDisputeEvidenceResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.evidence - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - dispute_id, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetDisputeEvidenceResponse]: @@ -274,8 +151,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, dispute_id: str, evidence_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -317,5 +194,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/disputes/raw_client.py b/src/square/disputes/raw_client.py index a0dc9983..4a3b6013 100644 --- a/src/square/disputes/raw_client.py +++ b/src/square/disputes/raw_client.py @@ -1,27 +1,24 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing -from json.decoder import JSONDecodeError - -from .. import core -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.get_dispute_response import GetDisputeResponse +from ..core.jsonable_encoder import jsonable_encoder from ..core.unchecked_base_model import construct_type -from ..requests.create_dispute_evidence_file_request import CreateDisputeEvidenceFileRequestParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.accept_dispute_response import AcceptDisputeResponse +from ..requests.create_dispute_evidence_file_request import CreateDisputeEvidenceFileRequestParams +from .. import core from ..types.create_dispute_evidence_file_response import CreateDisputeEvidenceFileResponse -from ..types.create_dispute_evidence_text_response import CreateDisputeEvidenceTextResponse -from ..types.dispute import Dispute +import json from ..types.dispute_evidence_type import DisputeEvidenceType -from ..types.dispute_state import DisputeState -from ..types.get_dispute_response import GetDisputeResponse -from ..types.list_disputes_response import ListDisputesResponse +from ..types.create_dispute_evidence_text_response import CreateDisputeEvidenceTextResponse from ..types.submit_evidence_response import SubmitEvidenceResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -31,73 +28,6 @@ class RawDisputesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - states: typing.Optional[DisputeState] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Dispute, ListDisputesResponse]: - """ - Returns a list of disputes associated with a particular account. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - states : typing.Optional[DisputeState] - The dispute states used to filter the result. If not specified, the endpoint returns all disputes. - - location_id : typing.Optional[str] - The ID of the location for which to return a list of disputes. - If not specified, the endpoint returns disputes associated with all locations. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Dispute, ListDisputesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/disputes", - method="GET", - params={ - "cursor": cursor, - "states": states, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDisputesResponse, - construct_type( - type_=ListDisputesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.disputes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - states=states, - location_id=location_id, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetDisputeResponse]: @@ -134,8 +64,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def accept( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -177,8 +107,8 @@ def accept( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create_evidence_file( self, @@ -228,7 +158,6 @@ def create_evidence_file( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -242,8 +171,8 @@ def create_evidence_file( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create_evidence_text( self, @@ -306,8 +235,8 @@ def create_evidence_text( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def submit_evidence( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -351,84 +280,14 @@ def submit_evidence( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawDisputesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - states: typing.Optional[DisputeState] = None, - location_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Dispute, ListDisputesResponse]: - """ - Returns a list of disputes associated with a particular account. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - states : typing.Optional[DisputeState] - The dispute states used to filter the result. If not specified, the endpoint returns all disputes. - - location_id : typing.Optional[str] - The ID of the location for which to return a list of disputes. - If not specified, the endpoint returns disputes associated with all locations. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Dispute, ListDisputesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/disputes", - method="GET", - params={ - "cursor": cursor, - "states": states, - "location_id": location_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListDisputesResponse, - construct_type( - type_=ListDisputesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.disputes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - states=states, - location_id=location_id, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetDisputeResponse]: @@ -465,8 +324,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def accept( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -508,8 +367,8 @@ async def accept( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create_evidence_file( self, @@ -559,7 +418,6 @@ async def create_evidence_file( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -573,8 +431,8 @@ async def create_evidence_file( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create_evidence_text( self, @@ -637,8 +495,8 @@ async def create_evidence_text( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def submit_evidence( self, dispute_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -682,5 +540,5 @@ async def submit_evidence( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/employees/__init__.py b/src/square/employees/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/employees/__init__.py +++ b/src/square/employees/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/employees/client.py b/src/square/employees/client.py index 93376d9d..ff712e07 100644 --- a/src/square/employees/client.py +++ b/src/square/employees/client.py @@ -1,15 +1,20 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawEmployeesClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..types.employee_status import EmployeeStatus from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager from ..types.employee import Employee -from ..types.employee_status import EmployeeStatus -from ..types.get_employee_response import GetEmployeeResponse from ..types.list_employees_response import ListEmployeesResponse -from .raw_client import AsyncRawEmployeesClient, RawEmployeesClient +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.get_employee_response import GetEmployeeResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawEmployeesClient +from ..core.pagination import AsyncPager class EmployeesClient: @@ -35,7 +40,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Employee, ListEmployeesResponse]: + ) -> SyncPager[Employee]: """ @@ -58,7 +63,7 @@ def list( Returns ------- - SyncPager[Employee, ListEmployeesResponse] + SyncPager[Employee] Success Examples @@ -80,9 +85,41 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - location_id=location_id, status=status, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/employees", + method="GET", + params={ + "location_id": location_id, + "status": status, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListEmployeesResponse, + construct_type( + type_=ListEmployeesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + status=status, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.employees + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetEmployeeResponse: """ @@ -112,8 +149,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data class AsyncEmployeesClient: @@ -139,7 +176,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Employee, ListEmployeesResponse]: + ) -> AsyncPager[Employee]: """ @@ -162,7 +199,7 @@ async def list( Returns ------- - AsyncPager[Employee, ListEmployeesResponse] + AsyncPager[Employee] Success Examples @@ -185,7 +222,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -193,9 +229,41 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - location_id=location_id, status=status, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/employees", + method="GET", + params={ + "location_id": location_id, + "status": status, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListEmployeesResponse, + construct_type( + type_=ListEmployeesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + status=status, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.employees + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetEmployeeResponse: """ @@ -233,5 +301,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data diff --git a/src/square/employees/raw_client.py b/src/square/employees/raw_client.py index fadff481..0fc41587 100644 --- a/src/square/employees/raw_client.py +++ b/src/square/employees/raw_client.py @@ -1,95 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type -from ..types.employee import Employee -from ..types.employee_status import EmployeeStatus +from ..core.http_response import HttpResponse from ..types.get_employee_response import GetEmployeeResponse -from ..types.list_employees_response import ListEmployeesResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawEmployeesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - location_id: typing.Optional[str] = None, - status: typing.Optional[EmployeeStatus] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Employee, ListEmployeesResponse]: - """ - - - Parameters - ---------- - location_id : typing.Optional[str] - - - status : typing.Optional[EmployeeStatus] - Specifies the EmployeeStatus to filter the employee by. - - limit : typing.Optional[int] - The number of employees to be returned on each page. - - cursor : typing.Optional[str] - The token required to retrieve the specified page of results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Employee, ListEmployeesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/employees", - method="GET", - params={ - "location_id": location_id, - "status": status, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListEmployeesResponse, - construct_type( - type_=ListEmployeesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.employees - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - location_id=location_id, - status=status, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetEmployeeResponse]: @@ -126,87 +53,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawEmployeesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - location_id: typing.Optional[str] = None, - status: typing.Optional[EmployeeStatus] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Employee, ListEmployeesResponse]: - """ - - - Parameters - ---------- - location_id : typing.Optional[str] - - - status : typing.Optional[EmployeeStatus] - Specifies the EmployeeStatus to filter the employee by. - - limit : typing.Optional[int] - The number of employees to be returned on each page. - - cursor : typing.Optional[str] - The token required to retrieve the specified page of results. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Employee, ListEmployeesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/employees", - method="GET", - params={ - "location_id": location_id, - "status": status, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListEmployeesResponse, - construct_type( - type_=ListEmployeesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.employees - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - location_id=location_id, - status=status, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetEmployeeResponse]: @@ -243,5 +97,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/events/__init__.py b/src/square/events/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/events/__init__.py +++ b/src/square/events/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/events/client.py b/src/square/events/client.py index 0b33e0fa..7ea9b372 100644 --- a/src/square/events/client.py +++ b/src/square/events/client.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawEventsClient from ..requests.search_events_query import SearchEventsQueryParams +from ..core.request_options import RequestOptions +from ..types.search_events_response import SearchEventsResponse from ..types.disable_events_response import DisableEventsResponse from ..types.enable_events_response import EnableEventsResponse from ..types.list_event_types_response import ListEventTypesResponse -from ..types.search_events_response import SearchEventsResponse -from .raw_client import AsyncRawEventsClient, RawEventsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawEventsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -75,10 +76,10 @@ def search_events( ) client.events.search_events() """ - _response = self._raw_client.search_events( + response = self._raw_client.search_events( cursor=cursor, limit=limit, query=query, request_options=request_options ) - return _response.data + return response.data def disable_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> DisableEventsResponse: """ @@ -105,8 +106,8 @@ def disable_events(self, *, request_options: typing.Optional[RequestOptions] = N ) client.events.disable_events() """ - _response = self._raw_client.disable_events(request_options=request_options) - return _response.data + response = self._raw_client.disable_events(request_options=request_options) + return response.data def enable_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> EnableEventsResponse: """ @@ -131,8 +132,8 @@ def enable_events(self, *, request_options: typing.Optional[RequestOptions] = No ) client.events.enable_events() """ - _response = self._raw_client.enable_events(request_options=request_options) - return _response.data + response = self._raw_client.enable_events(request_options=request_options) + return response.data def list_event_types( self, *, api_version: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None @@ -164,8 +165,8 @@ def list_event_types( api_version="api_version", ) """ - _response = self._raw_client.list_event_types(api_version=api_version, request_options=request_options) - return _response.data + response = self._raw_client.list_event_types(api_version=api_version, request_options=request_options) + return response.data class AsyncEventsClient: @@ -236,10 +237,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search_events( + response = await self._raw_client.search_events( cursor=cursor, limit=limit, query=query, request_options=request_options ) - return _response.data + return response.data async def disable_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> DisableEventsResponse: """ @@ -274,8 +275,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.disable_events(request_options=request_options) - return _response.data + response = await self._raw_client.disable_events(request_options=request_options) + return response.data async def enable_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> EnableEventsResponse: """ @@ -308,8 +309,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.enable_events(request_options=request_options) - return _response.data + response = await self._raw_client.enable_events(request_options=request_options) + return response.data async def list_event_types( self, *, api_version: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None @@ -349,5 +350,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list_event_types(api_version=api_version, request_options=request_options) - return _response.data + response = await self._raw_client.list_event_types(api_version=api_version, request_options=request_options) + return response.data diff --git a/src/square/events/raw_client.py b/src/square/events/raw_client.py index 831b57a5..74408ed8 100644 --- a/src/square/events/raw_client.py +++ b/src/square/events/raw_client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.client_wrapper import SyncClientWrapper +from ..requests.search_events_query import SearchEventsQueryParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.search_events_response import SearchEventsResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.search_events_query import SearchEventsQueryParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.disable_events_response import DisableEventsResponse from ..types.enable_events_response import EnableEventsResponse from ..types.list_event_types_response import ListEventTypesResponse -from ..types.search_events_response import SearchEventsResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -87,8 +88,8 @@ def search_events( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def disable_events( self, *, request_options: typing.Optional[RequestOptions] = None @@ -125,8 +126,8 @@ def disable_events( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def enable_events( self, *, request_options: typing.Optional[RequestOptions] = None @@ -161,8 +162,8 @@ def enable_events( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def list_event_types( self, *, api_version: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None @@ -203,8 +204,8 @@ def list_event_types( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawEventsClient: @@ -275,8 +276,8 @@ async def search_events( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def disable_events( self, *, request_options: typing.Optional[RequestOptions] = None @@ -313,8 +314,8 @@ async def disable_events( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def enable_events( self, *, request_options: typing.Optional[RequestOptions] = None @@ -349,8 +350,8 @@ async def enable_events( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def list_event_types( self, *, api_version: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None @@ -391,5 +392,5 @@ async def list_event_types( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/gift_cards/__init__.py b/src/square/gift_cards/__init__.py index 6d7e0218..121cf796 100644 --- a/src/square/gift_cards/__init__.py +++ b/src/square/gift_cards/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import activities -_dynamic_imports: typing.Dict[str, str] = {"activities": ".activities"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import activities __all__ = ["activities"] diff --git a/src/square/gift_cards/activities/__init__.py b/src/square/gift_cards/activities/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/gift_cards/activities/__init__.py +++ b/src/square/gift_cards/activities/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/gift_cards/activities/client.py b/src/square/gift_cards/activities/client.py index 561fdab0..c8c281e7 100644 --- a/src/square/gift_cards/activities/client.py +++ b/src/square/gift_cards/activities/client.py @@ -1,15 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawActivitiesClient from ...core.request_options import RequestOptions -from ...requests.gift_card_activity import GiftCardActivityParams -from ...types.create_gift_card_activity_response import CreateGiftCardActivityResponse +from ...core.pagination import SyncPager from ...types.gift_card_activity import GiftCardActivity from ...types.list_gift_card_activities_response import ListGiftCardActivitiesResponse -from .raw_client import AsyncRawActivitiesClient, RawActivitiesClient +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...requests.gift_card_activity import GiftCardActivityParams +from ...types.create_gift_card_activity_response import CreateGiftCardActivityResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawActivitiesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -42,7 +47,7 @@ def list( cursor: typing.Optional[str] = None, sort_order: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: + ) -> SyncPager[GiftCardActivity]: """ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to @@ -93,7 +98,7 @@ def list( Returns ------- - SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] + SyncPager[GiftCardActivity] Success Examples @@ -119,17 +124,49 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - gift_card_id=gift_card_id, - type=type, - location_id=location_id, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=cursor, - sort_order=sort_order, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/gift-cards/activities", + method="GET", + params={ + "gift_card_id": gift_card_id, + "type": type, + "location_id": location_id, + "begin_time": begin_time, + "end_time": end_time, + "limit": limit, + "cursor": cursor, + "sort_order": sort_order, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListGiftCardActivitiesResponse, + construct_type( + type_=ListGiftCardActivitiesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + gift_card_id=gift_card_id, + type=type, + location_id=location_id, + begin_time=begin_time, + end_time=end_time, + limit=limit, + cursor=_parsed_next, + sort_order=sort_order, + request_options=request_options, + ) + _items = _parsed_response.gift_card_activities + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -179,10 +216,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, gift_card_activity=gift_card_activity, request_options=request_options ) - return _response.data + return response.data class AsyncActivitiesClient: @@ -212,7 +249,7 @@ async def list( cursor: typing.Optional[str] = None, sort_order: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: + ) -> AsyncPager[GiftCardActivity]: """ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to @@ -263,7 +300,7 @@ async def list( Returns ------- - AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] + AsyncPager[GiftCardActivity] Success Examples @@ -290,7 +327,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -298,17 +334,49 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - gift_card_id=gift_card_id, - type=type, - location_id=location_id, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=cursor, - sort_order=sort_order, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/gift-cards/activities", + method="GET", + params={ + "gift_card_id": gift_card_id, + "type": type, + "location_id": location_id, + "begin_time": begin_time, + "end_time": end_time, + "limit": limit, + "cursor": cursor, + "sort_order": sort_order, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListGiftCardActivitiesResponse, + construct_type( + type_=ListGiftCardActivitiesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + gift_card_id=gift_card_id, + type=type, + location_id=location_id, + begin_time=begin_time, + end_time=end_time, + limit=limit, + cursor=_parsed_next, + sort_order=sort_order, + request_options=request_options, + ) + _items = _parsed_response.gift_card_activities + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -366,7 +434,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, gift_card_activity=gift_card_activity, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/gift_cards/activities/raw_client.py b/src/square/gift_cards/activities/raw_client.py index 8f6e798d..d40c039f 100644 --- a/src/square/gift_cards/activities/raw_client.py +++ b/src/square/gift_cards/activities/raw_client.py @@ -1,19 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.gift_card_activity import GiftCardActivityParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_gift_card_activity_response import CreateGiftCardActivityResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.gift_card_activity import GiftCardActivityParams -from ...types.create_gift_card_activity_response import CreateGiftCardActivityResponse -from ...types.gift_card_activity import GiftCardActivity -from ...types.list_gift_card_activities_response import ListGiftCardActivitiesResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -23,116 +21,6 @@ class RawActivitiesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - gift_card_id: typing.Optional[str] = None, - type: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - sort_order: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: - """ - Lists gift card activities. By default, you get gift card activities for all - gift cards in the seller's account. You can optionally specify query parameters to - filter the list. For example, you can get a list of gift card activities for a gift card, - for all gift cards in a specific region, or for activities within a time window. - - Parameters - ---------- - gift_card_id : typing.Optional[str] - If a gift card ID is provided, the endpoint returns activities related - to the specified gift card. Otherwise, the endpoint returns all gift card activities for - the seller. - - type : typing.Optional[str] - If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of the specified type. - Otherwise, the endpoint returns all types of gift card activities. - - location_id : typing.Optional[str] - If a location ID is provided, the endpoint returns gift card activities for the specified location. - Otherwise, the endpoint returns gift card activities for all locations. - - begin_time : typing.Optional[str] - The timestamp for the beginning of the reporting period, in RFC 3339 format. - This start time is inclusive. The default value is the current time minus one year. - - end_time : typing.Optional[str] - The timestamp for the end of the reporting period, in RFC 3339 format. - This end time is inclusive. The default value is the current time. - - limit : typing.Optional[int] - If a limit is provided, the endpoint returns the specified number - of results (or fewer) per page. The maximum value is 100. The default value is 50. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - If a cursor is not provided, the endpoint returns the first page of the results. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - sort_order : typing.Optional[str] - The order in which the endpoint returns the activities, based on `created_at`. - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/gift-cards/activities", - method="GET", - params={ - "gift_card_id": gift_card_id, - "type": type, - "location_id": location_id, - "begin_time": begin_time, - "end_time": end_time, - "limit": limit, - "cursor": cursor, - "sort_order": sort_order, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListGiftCardActivitiesResponse, - construct_type( - type_=ListGiftCardActivitiesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.gift_card_activities - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - gift_card_id=gift_card_id, - type=type, - location_id=location_id, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=_parsed_next, - sort_order=sort_order, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -188,127 +76,14 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawActivitiesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - gift_card_id: typing.Optional[str] = None, - type: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - sort_order: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: - """ - Lists gift card activities. By default, you get gift card activities for all - gift cards in the seller's account. You can optionally specify query parameters to - filter the list. For example, you can get a list of gift card activities for a gift card, - for all gift cards in a specific region, or for activities within a time window. - - Parameters - ---------- - gift_card_id : typing.Optional[str] - If a gift card ID is provided, the endpoint returns activities related - to the specified gift card. Otherwise, the endpoint returns all gift card activities for - the seller. - - type : typing.Optional[str] - If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of the specified type. - Otherwise, the endpoint returns all types of gift card activities. - - location_id : typing.Optional[str] - If a location ID is provided, the endpoint returns gift card activities for the specified location. - Otherwise, the endpoint returns gift card activities for all locations. - - begin_time : typing.Optional[str] - The timestamp for the beginning of the reporting period, in RFC 3339 format. - This start time is inclusive. The default value is the current time minus one year. - - end_time : typing.Optional[str] - The timestamp for the end of the reporting period, in RFC 3339 format. - This end time is inclusive. The default value is the current time. - - limit : typing.Optional[int] - If a limit is provided, the endpoint returns the specified number - of results (or fewer) per page. The maximum value is 100. The default value is 50. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - If a cursor is not provided, the endpoint returns the first page of the results. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - sort_order : typing.Optional[str] - The order in which the endpoint returns the activities, based on `created_at`. - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/gift-cards/activities", - method="GET", - params={ - "gift_card_id": gift_card_id, - "type": type, - "location_id": location_id, - "begin_time": begin_time, - "end_time": end_time, - "limit": limit, - "cursor": cursor, - "sort_order": sort_order, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListGiftCardActivitiesResponse, - construct_type( - type_=ListGiftCardActivitiesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.gift_card_activities - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - gift_card_id=gift_card_id, - type=type, - location_id=location_id, - begin_time=begin_time, - end_time=end_time, - limit=limit, - cursor=_parsed_next, - sort_order=sort_order, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -364,5 +139,5 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/gift_cards/client.py b/src/square/gift_cards/client.py index 37d6e91c..824f3a7b 100644 --- a/src/square/gift_cards/client.py +++ b/src/square/gift_cards/client.py @@ -1,25 +1,28 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawGiftCardsClient +from .activities.client import ActivitiesClient from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager +from ..types.gift_card import GiftCard +from ..types.list_gift_cards_response import ListGiftCardsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.gift_card import GiftCardParams from ..types.create_gift_card_response import CreateGiftCardResponse from ..types.get_gift_card_from_gan_response import GetGiftCardFromGanResponse from ..types.get_gift_card_from_nonce_response import GetGiftCardFromNonceResponse -from ..types.get_gift_card_response import GetGiftCardResponse -from ..types.gift_card import GiftCard from ..types.link_customer_to_gift_card_response import LinkCustomerToGiftCardResponse -from ..types.list_gift_cards_response import ListGiftCardsResponse from ..types.unlink_customer_from_gift_card_response import UnlinkCustomerFromGiftCardResponse -from .raw_client import AsyncRawGiftCardsClient, RawGiftCardsClient +from ..types.get_gift_card_response import GetGiftCardResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawGiftCardsClient +from .activities.client import AsyncActivitiesClient +from ..core.pagination import AsyncPager -if typing.TYPE_CHECKING: - from .activities.client import ActivitiesClient, AsyncActivitiesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -27,8 +30,7 @@ class GiftCardsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawGiftCardsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._activities: typing.Optional[ActivitiesClient] = None + self.activities = ActivitiesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawGiftCardsClient: @@ -50,7 +52,7 @@ def list( cursor: typing.Optional[str] = None, customer_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCard, ListGiftCardsResponse]: + ) -> SyncPager[GiftCard]: """ Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. @@ -84,7 +86,7 @@ def list( Returns ------- - SyncPager[GiftCard, ListGiftCardsResponse] + SyncPager[GiftCard] Success Examples @@ -107,9 +109,43 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - type=type, state=state, limit=limit, cursor=cursor, customer_id=customer_id, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/gift-cards", + method="GET", + params={ + "type": type, + "state": state, + "limit": limit, + "cursor": cursor, + "customer_id": customer_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListGiftCardsResponse, + construct_type( + type_=ListGiftCardsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + type=type, + state=state, + limit=limit, + cursor=_parsed_next, + customer_id=customer_id, + request_options=request_options, + ) + _items = _parsed_response.gift_cards + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -175,13 +211,13 @@ def create( gift_card={"type": "DIGITAL"}, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, location_id=location_id, gift_card=gift_card, request_options=request_options, ) - return _response.data + return response.data def get_from_gan( self, *, gan: str, request_options: typing.Optional[RequestOptions] = None @@ -215,8 +251,8 @@ def get_from_gan( gan="7783320001001635", ) """ - _response = self._raw_client.get_from_gan(gan=gan, request_options=request_options) - return _response.data + response = self._raw_client.get_from_gan(gan=gan, request_options=request_options) + return response.data def get_from_nonce( self, *, nonce: str, request_options: typing.Optional[RequestOptions] = None @@ -249,8 +285,8 @@ def get_from_nonce( nonce="cnon:7783322135245171", ) """ - _response = self._raw_client.get_from_nonce(nonce=nonce, request_options=request_options) - return _response.data + response = self._raw_client.get_from_nonce(nonce=nonce, request_options=request_options) + return response.data def link_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -286,10 +322,10 @@ def link_customer( customer_id="GKY0FZ3V717AH8Q2D821PNT2ZW", ) """ - _response = self._raw_client.link_customer( + response = self._raw_client.link_customer( gift_card_id, customer_id=customer_id, request_options=request_options ) - return _response.data + return response.data def unlink_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -325,10 +361,10 @@ def unlink_customer( customer_id="GKY0FZ3V717AH8Q2D821PNT2ZW", ) """ - _response = self._raw_client.unlink_customer( + response = self._raw_client.unlink_customer( gift_card_id, customer_id=customer_id, request_options=request_options ) - return _response.data + return response.data def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetGiftCardResponse: """ @@ -358,23 +394,14 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data - - @property - def activities(self): - if self._activities is None: - from .activities.client import ActivitiesClient # noqa: E402 - - self._activities = ActivitiesClient(client_wrapper=self._client_wrapper) - return self._activities + response = self._raw_client.get(id, request_options=request_options) + return response.data class AsyncGiftCardsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawGiftCardsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._activities: typing.Optional[AsyncActivitiesClient] = None + self.activities = AsyncActivitiesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawGiftCardsClient: @@ -396,7 +423,7 @@ async def list( cursor: typing.Optional[str] = None, customer_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCard, ListGiftCardsResponse]: + ) -> AsyncPager[GiftCard]: """ Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. @@ -430,7 +457,7 @@ async def list( Returns ------- - AsyncPager[GiftCard, ListGiftCardsResponse] + AsyncPager[GiftCard] Success Examples @@ -454,7 +481,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -462,9 +488,43 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - type=type, state=state, limit=limit, cursor=cursor, customer_id=customer_id, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/gift-cards", + method="GET", + params={ + "type": type, + "state": state, + "limit": limit, + "cursor": cursor, + "customer_id": customer_id, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListGiftCardsResponse, + construct_type( + type_=ListGiftCardsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + type=type, + state=state, + limit=limit, + cursor=_parsed_next, + customer_id=customer_id, + request_options=request_options, + ) + _items = _parsed_response.gift_cards + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -538,13 +598,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, location_id=location_id, gift_card=gift_card, request_options=request_options, ) - return _response.data + return response.data async def get_from_gan( self, *, gan: str, request_options: typing.Optional[RequestOptions] = None @@ -586,8 +646,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_from_gan(gan=gan, request_options=request_options) - return _response.data + response = await self._raw_client.get_from_gan(gan=gan, request_options=request_options) + return response.data async def get_from_nonce( self, *, nonce: str, request_options: typing.Optional[RequestOptions] = None @@ -628,8 +688,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_from_nonce(nonce=nonce, request_options=request_options) - return _response.data + response = await self._raw_client.get_from_nonce(nonce=nonce, request_options=request_options) + return response.data async def link_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -673,10 +733,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.link_customer( + response = await self._raw_client.link_customer( gift_card_id, customer_id=customer_id, request_options=request_options ) - return _response.data + return response.data async def unlink_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -720,10 +780,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.unlink_customer( + response = await self._raw_client.unlink_customer( gift_card_id, customer_id=customer_id, request_options=request_options ) - return _response.data + return response.data async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetGiftCardResponse: """ @@ -761,13 +821,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data - - @property - def activities(self): - if self._activities is None: - from .activities.client import AsyncActivitiesClient # noqa: E402 - - self._activities = AsyncActivitiesClient(client_wrapper=self._client_wrapper) - return self._activities + response = await self._raw_client.get(id, request_options=request_options) + return response.data diff --git a/src/square/gift_cards/raw_client.py b/src/square/gift_cards/raw_client.py index a34df1a7..56c60d65 100644 --- a/src/square/gift_cards/raw_client.py +++ b/src/square/gift_cards/raw_client.py @@ -1,25 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.gift_card import GiftCardParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_gift_card_response import CreateGiftCardResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.gift_card import GiftCardParams -from ..types.create_gift_card_response import CreateGiftCardResponse +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.get_gift_card_from_gan_response import GetGiftCardFromGanResponse from ..types.get_gift_card_from_nonce_response import GetGiftCardFromNonceResponse -from ..types.get_gift_card_response import GetGiftCardResponse -from ..types.gift_card import GiftCard from ..types.link_customer_to_gift_card_response import LinkCustomerToGiftCardResponse -from ..types.list_gift_cards_response import ListGiftCardsResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.unlink_customer_from_gift_card_response import UnlinkCustomerFromGiftCardResponse +from ..types.get_gift_card_response import GetGiftCardResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -29,90 +27,6 @@ class RawGiftCardsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - type: typing.Optional[str] = None, - state: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCard, ListGiftCardsResponse]: - """ - Lists all gift cards. You can specify optional filters to retrieve - a subset of the gift cards. Results are sorted by `created_at` in ascending order. - - Parameters - ---------- - type : typing.Optional[str] - If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type. - Otherwise, the endpoint returns gift cards of all types. - - state : typing.Optional[str] - If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state. - Otherwise, the endpoint returns the gift cards of all states. - - limit : typing.Optional[int] - If a limit is provided, the endpoint returns only the specified number of results per page. - The maximum value is 200. The default value is 30. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - If a cursor is not provided, the endpoint returns the first page of the results. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - customer_id : typing.Optional[str] - If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[GiftCard, ListGiftCardsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/gift-cards", - method="GET", - params={ - "type": type, - "state": state, - "limit": limit, - "cursor": cursor, - "customer_id": customer_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListGiftCardsResponse, - construct_type( - type_=ListGiftCardsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.gift_cards - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - type=type, - state=state, - limit=limit, - cursor=_parsed_next, - customer_id=customer_id, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -192,8 +106,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_from_gan( self, *, gan: str, request_options: typing.Optional[RequestOptions] = None @@ -240,8 +154,8 @@ def get_from_gan( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_from_nonce( self, *, nonce: str, request_options: typing.Optional[RequestOptions] = None @@ -287,8 +201,8 @@ def get_from_nonce( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def link_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -336,8 +250,8 @@ def link_customer( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def unlink_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -385,8 +299,8 @@ def unlink_customer( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -424,101 +338,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawGiftCardsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - type: typing.Optional[str] = None, - state: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCard, ListGiftCardsResponse]: - """ - Lists all gift cards. You can specify optional filters to retrieve - a subset of the gift cards. Results are sorted by `created_at` in ascending order. - - Parameters - ---------- - type : typing.Optional[str] - If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type. - Otherwise, the endpoint returns gift cards of all types. - - state : typing.Optional[str] - If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state. - Otherwise, the endpoint returns the gift cards of all states. - - limit : typing.Optional[int] - If a limit is provided, the endpoint returns only the specified number of results per page. - The maximum value is 200. The default value is 30. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - If a cursor is not provided, the endpoint returns the first page of the results. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - customer_id : typing.Optional[str] - If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[GiftCard, ListGiftCardsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/gift-cards", - method="GET", - params={ - "type": type, - "state": state, - "limit": limit, - "cursor": cursor, - "customer_id": customer_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListGiftCardsResponse, - construct_type( - type_=ListGiftCardsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.gift_cards - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - type=type, - state=state, - limit=limit, - cursor=_parsed_next, - customer_id=customer_id, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -598,8 +425,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_from_gan( self, *, gan: str, request_options: typing.Optional[RequestOptions] = None @@ -646,8 +473,8 @@ async def get_from_gan( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_from_nonce( self, *, nonce: str, request_options: typing.Optional[RequestOptions] = None @@ -693,8 +520,8 @@ async def get_from_nonce( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def link_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -742,8 +569,8 @@ async def link_customer( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def unlink_customer( self, gift_card_id: str, *, customer_id: str, request_options: typing.Optional[RequestOptions] = None @@ -791,8 +618,8 @@ async def unlink_customer( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -830,5 +657,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/inventory/__init__.py b/src/square/inventory/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/inventory/__init__.py +++ b/src/square/inventory/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/inventory/client.py b/src/square/inventory/client.py index 7ae7a02b..2c794687 100644 --- a/src/square/inventory/client.py +++ b/src/square/inventory/client.py @@ -1,24 +1,30 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawInventoryClient from ..core.request_options import RequestOptions +from ..types.get_inventory_adjustment_response import GetInventoryAdjustmentResponse from ..requests.inventory_change import InventoryChangeParams from ..types.batch_change_inventory_response import BatchChangeInventoryResponse +from ..types.inventory_change_type import InventoryChangeType +from ..types.inventory_state import InventoryState from ..types.batch_get_inventory_changes_response import BatchGetInventoryChangesResponse from ..types.batch_get_inventory_counts_response import BatchGetInventoryCountsResponse -from ..types.get_inventory_adjustment_response import GetInventoryAdjustmentResponse -from ..types.get_inventory_changes_response import GetInventoryChangesResponse -from ..types.get_inventory_count_response import GetInventoryCountResponse -from ..types.get_inventory_physical_count_response import GetInventoryPhysicalCountResponse -from ..types.get_inventory_transfer_response import GetInventoryTransferResponse +from ..core.pagination import SyncPager from ..types.inventory_change import InventoryChange -from ..types.inventory_change_type import InventoryChangeType +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.inventory_count import InventoryCount -from ..types.inventory_state import InventoryState -from .raw_client import AsyncRawInventoryClient, RawInventoryClient +from ..types.get_inventory_physical_count_response import GetInventoryPhysicalCountResponse +from ..types.get_inventory_transfer_response import GetInventoryTransferResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..types.get_inventory_count_response import GetInventoryCountResponse +from ..types.get_inventory_changes_response import GetInventoryChangesResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawInventoryClient +from ..core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -70,8 +76,8 @@ def deprecated_get_adjustment( adjustment_id="adjustment_id", ) """ - _response = self._raw_client.deprecated_get_adjustment(adjustment_id, request_options=request_options) - return _response.data + response = self._raw_client.deprecated_get_adjustment(adjustment_id, request_options=request_options) + return response.data def get_adjustment( self, adjustment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -104,8 +110,8 @@ def get_adjustment( adjustment_id="adjustment_id", ) """ - _response = self._raw_client.get_adjustment(adjustment_id, request_options=request_options) - return _response.data + response = self._raw_client.get_adjustment(adjustment_id, request_options=request_options) + return response.data def deprecated_batch_change( self, @@ -172,13 +178,13 @@ def deprecated_batch_change( ignore_unchanged_counts=True, ) """ - _response = self._raw_client.deprecated_batch_change( + response = self._raw_client.deprecated_batch_change( idempotency_key=idempotency_key, changes=changes, ignore_unchanged_counts=ignore_unchanged_counts, request_options=request_options, ) - return _response.data + return response.data def deprecated_batch_get_changes( self, @@ -259,7 +265,7 @@ def deprecated_batch_get_changes( updated_before="2016-12-01T00:00:00.000Z", ) """ - _response = self._raw_client.deprecated_batch_get_changes( + response = self._raw_client.deprecated_batch_get_changes( catalog_object_ids=catalog_object_ids, location_ids=location_ids, types=types, @@ -270,7 +276,7 @@ def deprecated_batch_get_changes( limit=limit, request_options=request_options, ) - return _response.data + return response.data def deprecated_batch_get_counts( self, @@ -337,7 +343,7 @@ def deprecated_batch_get_counts( updated_after="2016-11-16T00:00:00.000Z", ) """ - _response = self._raw_client.deprecated_batch_get_counts( + response = self._raw_client.deprecated_batch_get_counts( catalog_object_ids=catalog_object_ids, location_ids=location_ids, updated_after=updated_after, @@ -346,7 +352,7 @@ def deprecated_batch_get_counts( limit=limit, request_options=request_options, ) - return _response.data + return response.data def batch_create_changes( self, @@ -416,13 +422,13 @@ def batch_create_changes( ignore_unchanged_counts=True, ) """ - _response = self._raw_client.batch_create_changes( + response = self._raw_client.batch_create_changes( idempotency_key=idempotency_key, changes=changes, ignore_unchanged_counts=ignore_unchanged_counts, request_options=request_options, ) - return _response.data + return response.data def batch_get_changes( self, @@ -436,7 +442,7 @@ def batch_get_changes( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange, BatchGetInventoryChangesResponse]: + ) -> SyncPager[InventoryChange]: """ Returns historical physical counts and adjustments based on the provided filter criteria. @@ -490,7 +496,7 @@ def batch_get_changes( Returns ------- - SyncPager[InventoryChange, BatchGetInventoryChangesResponse] + SyncPager[InventoryChange] Success Examples @@ -514,17 +520,50 @@ def batch_get_changes( for page in response.iter_pages(): yield page """ - return self._raw_client.batch_get_changes( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - types=types, - states=states, - updated_after=updated_after, - updated_before=updated_before, - cursor=cursor, - limit=limit, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/inventory/changes/batch-retrieve", + method="POST", + json={ + "catalog_object_ids": catalog_object_ids, + "location_ids": location_ids, + "types": types, + "states": states, + "updated_after": updated_after, + "updated_before": updated_before, + "cursor": cursor, + "limit": limit, + }, request_options=request_options, + omit=OMIT, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + BatchGetInventoryChangesResponse, + construct_type( + type_=BatchGetInventoryChangesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.batch_get_changes( + catalog_object_ids=catalog_object_ids, + location_ids=location_ids, + types=types, + states=states, + updated_after=updated_after, + updated_before=updated_before, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.changes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_get_counts( self, @@ -536,7 +575,7 @@ def batch_get_counts( states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount, BatchGetInventoryCountsResponse]: + ) -> SyncPager[InventoryCount]: """ Returns current counts for the provided [CatalogObject](entity:CatalogObject)s at the requested @@ -584,7 +623,7 @@ def batch_get_counts( Returns ------- - SyncPager[InventoryCount, BatchGetInventoryCountsResponse] + SyncPager[InventoryCount] Success Examples @@ -605,15 +644,46 @@ def batch_get_counts( for page in response.iter_pages(): yield page """ - return self._raw_client.batch_get_counts( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - updated_after=updated_after, - cursor=cursor, - states=states, - limit=limit, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/inventory/counts/batch-retrieve", + method="POST", + json={ + "catalog_object_ids": catalog_object_ids, + "location_ids": location_ids, + "updated_after": updated_after, + "cursor": cursor, + "states": states, + "limit": limit, + }, request_options=request_options, + omit=OMIT, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + BatchGetInventoryCountsResponse, + construct_type( + type_=BatchGetInventoryCountsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.batch_get_counts( + catalog_object_ids=catalog_object_ids, + location_ids=location_ids, + updated_after=updated_after, + cursor=_parsed_next, + states=states, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.counts + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def deprecated_get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -647,8 +717,8 @@ def deprecated_get_physical_count( physical_count_id="physical_count_id", ) """ - _response = self._raw_client.deprecated_get_physical_count(physical_count_id, request_options=request_options) - return _response.data + response = self._raw_client.deprecated_get_physical_count(physical_count_id, request_options=request_options) + return response.data def get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -682,8 +752,8 @@ def get_physical_count( physical_count_id="physical_count_id", ) """ - _response = self._raw_client.get_physical_count(physical_count_id, request_options=request_options) - return _response.data + response = self._raw_client.get_physical_count(physical_count_id, request_options=request_options) + return response.data def get_transfer( self, transfer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -716,8 +786,8 @@ def get_transfer( transfer_id="transfer_id", ) """ - _response = self._raw_client.get_transfer(transfer_id, request_options=request_options) - return _response.data + response = self._raw_client.get_transfer(transfer_id, request_options=request_options) + return response.data def get( self, @@ -726,7 +796,7 @@ def get( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount, GetInventoryCountResponse]: + ) -> SyncPager[InventoryCount]: """ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of @@ -753,7 +823,7 @@ def get( Returns ------- - SyncPager[InventoryCount, GetInventoryCountResponse] + SyncPager[InventoryCount] Success Examples @@ -774,9 +844,38 @@ def get( for page in response.iter_pages(): yield page """ - return self._raw_client.get( - catalog_object_id, location_ids=location_ids, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/inventory/{jsonable_encoder(catalog_object_id)}", + method="GET", + params={ + "location_ids": location_ids, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + GetInventoryCountResponse, + construct_type( + type_=GetInventoryCountResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.get( + catalog_object_id, + location_ids=location_ids, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.counts + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def changes( self, @@ -785,7 +884,7 @@ def changes( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange, GetInventoryChangesResponse]: + ) -> SyncPager[InventoryChange]: """ Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](entity:CatalogObject) at the requested @@ -821,7 +920,7 @@ def changes( Returns ------- - SyncPager[InventoryChange, GetInventoryChangesResponse] + SyncPager[InventoryChange] Success Examples @@ -842,9 +941,38 @@ def changes( for page in response.iter_pages(): yield page """ - return self._raw_client.changes( - catalog_object_id, location_ids=location_ids, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/inventory/{jsonable_encoder(catalog_object_id)}/changes", + method="GET", + params={ + "location_ids": location_ids, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + GetInventoryChangesResponse, + construct_type( + type_=GetInventoryChangesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.changes( + catalog_object_id, + location_ids=location_ids, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.changes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncInventoryClient: @@ -901,8 +1029,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.deprecated_get_adjustment(adjustment_id, request_options=request_options) - return _response.data + response = await self._raw_client.deprecated_get_adjustment(adjustment_id, request_options=request_options) + return response.data async def get_adjustment( self, adjustment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -943,8 +1071,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_adjustment(adjustment_id, request_options=request_options) - return _response.data + response = await self._raw_client.get_adjustment(adjustment_id, request_options=request_options) + return response.data async def deprecated_batch_change( self, @@ -1019,13 +1147,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.deprecated_batch_change( + response = await self._raw_client.deprecated_batch_change( idempotency_key=idempotency_key, changes=changes, ignore_unchanged_counts=ignore_unchanged_counts, request_options=request_options, ) - return _response.data + return response.data async def deprecated_batch_get_changes( self, @@ -1114,7 +1242,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.deprecated_batch_get_changes( + response = await self._raw_client.deprecated_batch_get_changes( catalog_object_ids=catalog_object_ids, location_ids=location_ids, types=types, @@ -1125,7 +1253,7 @@ async def main() -> None: limit=limit, request_options=request_options, ) - return _response.data + return response.data async def deprecated_batch_get_counts( self, @@ -1200,7 +1328,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.deprecated_batch_get_counts( + response = await self._raw_client.deprecated_batch_get_counts( catalog_object_ids=catalog_object_ids, location_ids=location_ids, updated_after=updated_after, @@ -1209,7 +1337,7 @@ async def main() -> None: limit=limit, request_options=request_options, ) - return _response.data + return response.data async def batch_create_changes( self, @@ -1287,13 +1415,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_create_changes( + response = await self._raw_client.batch_create_changes( idempotency_key=idempotency_key, changes=changes, ignore_unchanged_counts=ignore_unchanged_counts, request_options=request_options, ) - return _response.data + return response.data async def batch_get_changes( self, @@ -1307,7 +1435,7 @@ async def batch_get_changes( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange, BatchGetInventoryChangesResponse]: + ) -> AsyncPager[InventoryChange]: """ Returns historical physical counts and adjustments based on the provided filter criteria. @@ -1361,7 +1489,7 @@ async def batch_get_changes( Returns ------- - AsyncPager[InventoryChange, BatchGetInventoryChangesResponse] + AsyncPager[InventoryChange] Success Examples @@ -1386,7 +1514,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -1394,17 +1521,50 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.batch_get_changes( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - types=types, - states=states, - updated_after=updated_after, - updated_before=updated_before, - cursor=cursor, - limit=limit, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/inventory/changes/batch-retrieve", + method="POST", + json={ + "catalog_object_ids": catalog_object_ids, + "location_ids": location_ids, + "types": types, + "states": states, + "updated_after": updated_after, + "updated_before": updated_before, + "cursor": cursor, + "limit": limit, + }, request_options=request_options, + omit=OMIT, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + BatchGetInventoryChangesResponse, + construct_type( + type_=BatchGetInventoryChangesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.batch_get_changes( + catalog_object_ids=catalog_object_ids, + location_ids=location_ids, + types=types, + states=states, + updated_after=updated_after, + updated_before=updated_before, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.changes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_get_counts( self, @@ -1416,7 +1576,7 @@ async def batch_get_counts( states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount, BatchGetInventoryCountsResponse]: + ) -> AsyncPager[InventoryCount]: """ Returns current counts for the provided [CatalogObject](entity:CatalogObject)s at the requested @@ -1464,7 +1624,7 @@ async def batch_get_counts( Returns ------- - AsyncPager[InventoryCount, BatchGetInventoryCountsResponse] + AsyncPager[InventoryCount] Success Examples @@ -1486,7 +1646,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -1494,15 +1653,46 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.batch_get_counts( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - updated_after=updated_after, - cursor=cursor, - states=states, - limit=limit, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/inventory/counts/batch-retrieve", + method="POST", + json={ + "catalog_object_ids": catalog_object_ids, + "location_ids": location_ids, + "updated_after": updated_after, + "cursor": cursor, + "states": states, + "limit": limit, + }, request_options=request_options, + omit=OMIT, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + BatchGetInventoryCountsResponse, + construct_type( + type_=BatchGetInventoryCountsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.batch_get_counts( + catalog_object_ids=catalog_object_ids, + location_ids=location_ids, + updated_after=updated_after, + cursor=_parsed_next, + states=states, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.counts + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def deprecated_get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1544,10 +1734,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.deprecated_get_physical_count( + response = await self._raw_client.deprecated_get_physical_count( physical_count_id, request_options=request_options ) - return _response.data + return response.data async def get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1589,8 +1779,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_physical_count(physical_count_id, request_options=request_options) - return _response.data + response = await self._raw_client.get_physical_count(physical_count_id, request_options=request_options) + return response.data async def get_transfer( self, transfer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1631,8 +1821,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get_transfer(transfer_id, request_options=request_options) - return _response.data + response = await self._raw_client.get_transfer(transfer_id, request_options=request_options) + return response.data async def get( self, @@ -1641,7 +1831,7 @@ async def get( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount, GetInventoryCountResponse]: + ) -> AsyncPager[InventoryCount]: """ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of @@ -1668,7 +1858,7 @@ async def get( Returns ------- - AsyncPager[InventoryCount, GetInventoryCountResponse] + AsyncPager[InventoryCount] Success Examples @@ -1690,7 +1880,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -1698,9 +1887,38 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.get( - catalog_object_id, location_ids=location_ids, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/inventory/{jsonable_encoder(catalog_object_id)}", + method="GET", + params={ + "location_ids": location_ids, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + GetInventoryCountResponse, + construct_type( + type_=GetInventoryCountResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.get( + catalog_object_id, + location_ids=location_ids, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.counts + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def changes( self, @@ -1709,7 +1927,7 @@ async def changes( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange, GetInventoryChangesResponse]: + ) -> AsyncPager[InventoryChange]: """ Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](entity:CatalogObject) at the requested @@ -1745,7 +1963,7 @@ async def changes( Returns ------- - AsyncPager[InventoryChange, GetInventoryChangesResponse] + AsyncPager[InventoryChange] Success Examples @@ -1767,7 +1985,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -1775,6 +1992,35 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.changes( - catalog_object_id, location_ids=location_ids, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/inventory/{jsonable_encoder(catalog_object_id)}/changes", + method="GET", + params={ + "location_ids": location_ids, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + GetInventoryChangesResponse, + construct_type( + type_=GetInventoryChangesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.changes( + catalog_object_id, + location_ids=location_ids, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.changes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/inventory/raw_client.py b/src/square/inventory/raw_client.py index 3068807d..2bf46f77 100644 --- a/src/square/inventory/raw_client.py +++ b/src/square/inventory/raw_client.py @@ -1,29 +1,25 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.http_response import HttpResponse +from ..types.get_inventory_adjustment_response import GetInventoryAdjustmentResponse +from ..core.jsonable_encoder import jsonable_encoder from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.inventory_change import InventoryChangeParams from ..types.batch_change_inventory_response import BatchChangeInventoryResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from ..types.inventory_change_type import InventoryChangeType +from ..types.inventory_state import InventoryState from ..types.batch_get_inventory_changes_response import BatchGetInventoryChangesResponse from ..types.batch_get_inventory_counts_response import BatchGetInventoryCountsResponse -from ..types.get_inventory_adjustment_response import GetInventoryAdjustmentResponse -from ..types.get_inventory_changes_response import GetInventoryChangesResponse -from ..types.get_inventory_count_response import GetInventoryCountResponse from ..types.get_inventory_physical_count_response import GetInventoryPhysicalCountResponse from ..types.get_inventory_transfer_response import GetInventoryTransferResponse -from ..types.inventory_change import InventoryChange -from ..types.inventory_change_type import InventoryChangeType -from ..types.inventory_count import InventoryCount -from ..types.inventory_state import InventoryState +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -70,8 +66,8 @@ def deprecated_get_adjustment( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_adjustment( self, adjustment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -110,8 +106,8 @@ def get_adjustment( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def deprecated_batch_change( self, @@ -164,9 +160,6 @@ def deprecated_batch_change( ), "ignore_unchanged_counts": ignore_unchanged_counts, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -182,8 +175,8 @@ def deprecated_batch_change( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def deprecated_batch_get_changes( self, @@ -261,9 +254,6 @@ def deprecated_batch_get_changes( "cursor": cursor, "limit": limit, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -279,8 +269,8 @@ def deprecated_batch_get_changes( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def deprecated_batch_get_counts( self, @@ -345,9 +335,6 @@ def deprecated_batch_get_counts( "states": states, "limit": limit, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -363,8 +350,8 @@ def deprecated_batch_get_counts( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_create_changes( self, @@ -420,9 +407,6 @@ def batch_create_changes( ), "ignore_unchanged_counts": ignore_unchanged_counts, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -438,230 +422,8 @@ def batch_create_changes( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def batch_get_changes( - self, - *, - catalog_object_ids: typing.Optional[typing.Sequence[str]] = OMIT, - location_ids: typing.Optional[typing.Sequence[str]] = OMIT, - types: typing.Optional[typing.Sequence[InventoryChangeType]] = OMIT, - states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, - updated_after: typing.Optional[str] = OMIT, - updated_before: typing.Optional[str] = OMIT, - cursor: typing.Optional[str] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange, BatchGetInventoryChangesResponse]: - """ - Returns historical physical counts and adjustments based on the - provided filter criteria. - - Results are paginated and sorted in ascending order according their - `occurred_at` timestamp (oldest first). - - BatchRetrieveInventoryChanges is a catch-all query endpoint for queries - that cannot be handled by other, simpler endpoints. - - Parameters - ---------- - catalog_object_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `CatalogObject` ID. - The filter is only applicable when set. The default value is null. - - location_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `Location` ID. - The filter is only applicable when set. The default value is null. - - types : typing.Optional[typing.Sequence[InventoryChangeType]] - The filter to return results by `InventoryChangeType` values other than `TRANSFER`. - The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. - - states : typing.Optional[typing.Sequence[InventoryState]] - The filter to return `ADJUSTMENT` query results by - `InventoryState`. This filter is only applied when set. - The default value is null. - - updated_after : typing.Optional[str] - The filter to return results with their `calculated_at` value - after the given time as specified in an RFC 3339 timestamp. - The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - - updated_before : typing.Optional[str] - The filter to return results with their `created_at` or `calculated_at` value - strictly before the given time as specified in an RFC 3339 timestamp. - The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - limit : typing.Optional[int] - The number of [records](entity:InventoryChange) to return. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[InventoryChange, BatchGetInventoryChangesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/inventory/changes/batch-retrieve", - method="POST", - json={ - "catalog_object_ids": catalog_object_ids, - "location_ids": location_ids, - "types": types, - "states": states, - "updated_after": updated_after, - "updated_before": updated_before, - "cursor": cursor, - "limit": limit, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - BatchGetInventoryChangesResponse, - construct_type( - type_=BatchGetInventoryChangesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.changes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.batch_get_changes( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - types=types, - states=states, - updated_after=updated_after, - updated_before=updated_before, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def batch_get_counts( - self, - *, - catalog_object_ids: typing.Optional[typing.Sequence[str]] = OMIT, - location_ids: typing.Optional[typing.Sequence[str]] = OMIT, - updated_after: typing.Optional[str] = OMIT, - cursor: typing.Optional[str] = OMIT, - states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount, BatchGetInventoryCountsResponse]: - """ - Returns current counts for the provided - [CatalogObject](entity:CatalogObject)s at the requested - [Location](entity:Location)s. - - Results are paginated and sorted in descending order according to their - `calculated_at` timestamp (newest first). - - When `updated_after` is specified, only counts that have changed since that - time (based on the server timestamp for the most recent change) are - returned. This allows clients to perform a "sync" operation, for example - in response to receiving a Webhook notification. - - Parameters - ---------- - catalog_object_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `CatalogObject` ID. - The filter is applicable only when set. The default is null. - - location_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `Location` ID. - This filter is applicable only when set. The default is null. - - updated_after : typing.Optional[str] - The filter to return results with their `calculated_at` value - after the given time as specified in an RFC 3339 timestamp. - The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - states : typing.Optional[typing.Sequence[InventoryState]] - The filter to return results by `InventoryState`. The filter is only applicable when set. - Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. - The default is null. - - limit : typing.Optional[int] - The number of [records](entity:InventoryCount) to return. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[InventoryCount, BatchGetInventoryCountsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/inventory/counts/batch-retrieve", - method="POST", - json={ - "catalog_object_ids": catalog_object_ids, - "location_ids": location_ids, - "updated_after": updated_after, - "cursor": cursor, - "states": states, - "limit": limit, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - BatchGetInventoryCountsResponse, - construct_type( - type_=BatchGetInventoryCountsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.counts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.batch_get_counts( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - updated_after=updated_after, - cursor=_parsed_next, - states=states, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def deprecated_get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -701,8 +463,8 @@ def deprecated_get_physical_count( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -742,8 +504,8 @@ def get_physical_count( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get_transfer( self, transfer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -782,157 +544,8 @@ def get_transfer( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def get( - self, - catalog_object_id: str, - *, - location_ids: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount, GetInventoryCountResponse]: - """ - Retrieves the current calculated stock count for a given - [CatalogObject](entity:CatalogObject) at a given set of - [Location](entity:Location)s. Responses are paginated and unsorted. - For more sophisticated queries, use a batch endpoint. - - Parameters - ---------- - catalog_object_id : str - ID of the [CatalogObject](entity:CatalogObject) to retrieve. - - location_ids : typing.Optional[str] - The [Location](entity:Location) IDs to look up as a comma-separated - list. An empty list queries all locations. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[InventoryCount, GetInventoryCountResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/inventory/{jsonable_encoder(catalog_object_id)}", - method="GET", - params={ - "location_ids": location_ids, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - GetInventoryCountResponse, - construct_type( - type_=GetInventoryCountResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.counts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.get( - catalog_object_id, - location_ids=location_ids, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def changes( - self, - catalog_object_id: str, - *, - location_ids: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange, GetInventoryChangesResponse]: - """ - Returns a set of physical counts and inventory adjustments for the - provided [CatalogObject](entity:CatalogObject) at the requested - [Location](entity:Location)s. - - You can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) - and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. - - Results are paginated and sorted in descending order according to their - `occurred_at` timestamp (newest first). - - There are no limits on how far back the caller can page. This endpoint can be - used to display recent changes for a specific item. For more - sophisticated queries, use a batch endpoint. - - Parameters - ---------- - catalog_object_id : str - ID of the [CatalogObject](entity:CatalogObject) to retrieve. - - location_ids : typing.Optional[str] - The [Location](entity:Location) IDs to look up as a comma-separated - list. An empty list queries all locations. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[InventoryChange, GetInventoryChangesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/inventory/{jsonable_encoder(catalog_object_id)}/changes", - method="GET", - params={ - "location_ids": location_ids, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - GetInventoryChangesResponse, - construct_type( - type_=GetInventoryChangesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.changes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.changes( - catalog_object_id, - location_ids=location_ids, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawInventoryClient: @@ -976,8 +589,8 @@ async def deprecated_get_adjustment( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_adjustment( self, adjustment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1016,8 +629,8 @@ async def get_adjustment( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def deprecated_batch_change( self, @@ -1070,9 +683,6 @@ async def deprecated_batch_change( ), "ignore_unchanged_counts": ignore_unchanged_counts, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1088,8 +698,8 @@ async def deprecated_batch_change( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def deprecated_batch_get_changes( self, @@ -1167,9 +777,6 @@ async def deprecated_batch_get_changes( "cursor": cursor, "limit": limit, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1185,8 +792,8 @@ async def deprecated_batch_get_changes( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def deprecated_batch_get_counts( self, @@ -1251,9 +858,6 @@ async def deprecated_batch_get_counts( "states": states, "limit": limit, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1269,8 +873,8 @@ async def deprecated_batch_get_counts( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_create_changes( self, @@ -1326,9 +930,6 @@ async def batch_create_changes( ), "ignore_unchanged_counts": ignore_unchanged_counts, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -1344,236 +945,8 @@ async def batch_create_changes( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def batch_get_changes( - self, - *, - catalog_object_ids: typing.Optional[typing.Sequence[str]] = OMIT, - location_ids: typing.Optional[typing.Sequence[str]] = OMIT, - types: typing.Optional[typing.Sequence[InventoryChangeType]] = OMIT, - states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, - updated_after: typing.Optional[str] = OMIT, - updated_before: typing.Optional[str] = OMIT, - cursor: typing.Optional[str] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange, BatchGetInventoryChangesResponse]: - """ - Returns historical physical counts and adjustments based on the - provided filter criteria. - - Results are paginated and sorted in ascending order according their - `occurred_at` timestamp (oldest first). - - BatchRetrieveInventoryChanges is a catch-all query endpoint for queries - that cannot be handled by other, simpler endpoints. - - Parameters - ---------- - catalog_object_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `CatalogObject` ID. - The filter is only applicable when set. The default value is null. - - location_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `Location` ID. - The filter is only applicable when set. The default value is null. - - types : typing.Optional[typing.Sequence[InventoryChangeType]] - The filter to return results by `InventoryChangeType` values other than `TRANSFER`. - The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. - - states : typing.Optional[typing.Sequence[InventoryState]] - The filter to return `ADJUSTMENT` query results by - `InventoryState`. This filter is only applied when set. - The default value is null. - - updated_after : typing.Optional[str] - The filter to return results with their `calculated_at` value - after the given time as specified in an RFC 3339 timestamp. - The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - - updated_before : typing.Optional[str] - The filter to return results with their `created_at` or `calculated_at` value - strictly before the given time as specified in an RFC 3339 timestamp. - The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - limit : typing.Optional[int] - The number of [records](entity:InventoryChange) to return. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[InventoryChange, BatchGetInventoryChangesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/inventory/changes/batch-retrieve", - method="POST", - json={ - "catalog_object_ids": catalog_object_ids, - "location_ids": location_ids, - "types": types, - "states": states, - "updated_after": updated_after, - "updated_before": updated_before, - "cursor": cursor, - "limit": limit, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - BatchGetInventoryChangesResponse, - construct_type( - type_=BatchGetInventoryChangesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.changes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.batch_get_changes( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - types=types, - states=states, - updated_after=updated_after, - updated_before=updated_before, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def batch_get_counts( - self, - *, - catalog_object_ids: typing.Optional[typing.Sequence[str]] = OMIT, - location_ids: typing.Optional[typing.Sequence[str]] = OMIT, - updated_after: typing.Optional[str] = OMIT, - cursor: typing.Optional[str] = OMIT, - states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount, BatchGetInventoryCountsResponse]: - """ - Returns current counts for the provided - [CatalogObject](entity:CatalogObject)s at the requested - [Location](entity:Location)s. - - Results are paginated and sorted in descending order according to their - `calculated_at` timestamp (newest first). - - When `updated_after` is specified, only counts that have changed since that - time (based on the server timestamp for the most recent change) are - returned. This allows clients to perform a "sync" operation, for example - in response to receiving a Webhook notification. - - Parameters - ---------- - catalog_object_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `CatalogObject` ID. - The filter is applicable only when set. The default is null. - - location_ids : typing.Optional[typing.Sequence[str]] - The filter to return results by `Location` ID. - This filter is applicable only when set. The default is null. - - updated_after : typing.Optional[str] - The filter to return results with their `calculated_at` value - after the given time as specified in an RFC 3339 timestamp. - The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - states : typing.Optional[typing.Sequence[InventoryState]] - The filter to return results by `InventoryState`. The filter is only applicable when set. - Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. - The default is null. - - limit : typing.Optional[int] - The number of [records](entity:InventoryCount) to return. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[InventoryCount, BatchGetInventoryCountsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/inventory/counts/batch-retrieve", - method="POST", - json={ - "catalog_object_ids": catalog_object_ids, - "location_ids": location_ids, - "updated_after": updated_after, - "cursor": cursor, - "states": states, - "limit": limit, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - BatchGetInventoryCountsResponse, - construct_type( - type_=BatchGetInventoryCountsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.counts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.batch_get_counts( - catalog_object_ids=catalog_object_ids, - location_ids=location_ids, - updated_after=updated_after, - cursor=_parsed_next, - states=states, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def deprecated_get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1613,8 +986,8 @@ async def deprecated_get_physical_count( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_physical_count( self, physical_count_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1654,8 +1027,8 @@ async def get_physical_count( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get_transfer( self, transfer_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1694,160 +1067,5 @@ async def get_transfer( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def get( - self, - catalog_object_id: str, - *, - location_ids: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount, GetInventoryCountResponse]: - """ - Retrieves the current calculated stock count for a given - [CatalogObject](entity:CatalogObject) at a given set of - [Location](entity:Location)s. Responses are paginated and unsorted. - For more sophisticated queries, use a batch endpoint. - - Parameters - ---------- - catalog_object_id : str - ID of the [CatalogObject](entity:CatalogObject) to retrieve. - - location_ids : typing.Optional[str] - The [Location](entity:Location) IDs to look up as a comma-separated - list. An empty list queries all locations. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[InventoryCount, GetInventoryCountResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/inventory/{jsonable_encoder(catalog_object_id)}", - method="GET", - params={ - "location_ids": location_ids, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - GetInventoryCountResponse, - construct_type( - type_=GetInventoryCountResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.counts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.get( - catalog_object_id, - location_ids=location_ids, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def changes( - self, - catalog_object_id: str, - *, - location_ids: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange, GetInventoryChangesResponse]: - """ - Returns a set of physical counts and inventory adjustments for the - provided [CatalogObject](entity:CatalogObject) at the requested - [Location](entity:Location)s. - - You can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) - and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. - - Results are paginated and sorted in descending order according to their - `occurred_at` timestamp (newest first). - - There are no limits on how far back the caller can page. This endpoint can be - used to display recent changes for a specific item. For more - sophisticated queries, use a batch endpoint. - - Parameters - ---------- - catalog_object_id : str - ID of the [CatalogObject](entity:CatalogObject) to retrieve. - - location_ids : typing.Optional[str] - The [Location](entity:Location) IDs to look up as a comma-separated - list. An empty list queries all locations. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for the original query. - - See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[InventoryChange, GetInventoryChangesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/inventory/{jsonable_encoder(catalog_object_id)}/changes", - method="GET", - params={ - "location_ids": location_ids, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - GetInventoryChangesResponse, - construct_type( - type_=GetInventoryChangesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.changes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.changes( - catalog_object_id, - location_ids=location_ids, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/invoices/__init__.py b/src/square/invoices/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/invoices/__init__.py +++ b/src/square/invoices/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/invoices/client.py b/src/square/invoices/client.py index 4e1fe1ae..d8e6beb5 100644 --- a/src/square/invoices/client.py +++ b/src/square/invoices/client.py @@ -1,26 +1,31 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from .. import core -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawInvoicesClient from ..core.request_options import RequestOptions -from ..requests.create_invoice_attachment_request_data import CreateInvoiceAttachmentRequestDataParams +from ..core.pagination import SyncPager +from ..types.invoice import Invoice +from ..types.list_invoices_response import ListInvoicesResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.invoice import InvoiceParams +from ..types.create_invoice_response import CreateInvoiceResponse from ..requests.invoice_query import InvoiceQueryParams -from ..types.cancel_invoice_response import CancelInvoiceResponse +from ..types.search_invoices_response import SearchInvoicesResponse +from ..types.get_invoice_response import GetInvoiceResponse +from ..types.update_invoice_response import UpdateInvoiceResponse +from ..types.delete_invoice_response import DeleteInvoiceResponse +from ..requests.create_invoice_attachment_request_data import CreateInvoiceAttachmentRequestDataParams +from .. import core from ..types.create_invoice_attachment_response import CreateInvoiceAttachmentResponse -from ..types.create_invoice_response import CreateInvoiceResponse from ..types.delete_invoice_attachment_response import DeleteInvoiceAttachmentResponse -from ..types.delete_invoice_response import DeleteInvoiceResponse -from ..types.get_invoice_response import GetInvoiceResponse -from ..types.invoice import Invoice -from ..types.list_invoices_response import ListInvoicesResponse +from ..types.cancel_invoice_response import CancelInvoiceResponse from ..types.publish_invoice_response import PublishInvoiceResponse -from ..types.search_invoices_response import SearchInvoicesResponse -from ..types.update_invoice_response import UpdateInvoiceResponse -from .raw_client import AsyncRawInvoicesClient, RawInvoicesClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawInvoicesClient +from ..core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -48,7 +53,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Invoice, ListInvoicesResponse]: + ) -> SyncPager[Invoice]: """ Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you @@ -74,7 +79,7 @@ def list( Returns ------- - SyncPager[Invoice, ListInvoicesResponse] + SyncPager[Invoice] Success Examples @@ -95,9 +100,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - location_id=location_id, cursor=cursor, limit=limit, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/invoices", + method="GET", + params={ + "location_id": location_id, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListInvoicesResponse, + construct_type( + type_=ListInvoicesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.invoices + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -189,10 +224,10 @@ def create( idempotency_key="ce3748f9-5fc1-4762-aa12-aae5e843f1f4", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( invoice=invoice, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -252,8 +287,8 @@ def search( limit=100, ) """ - _response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) + return response.data def get(self, invoice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetInvoiceResponse: """ @@ -283,8 +318,8 @@ def get(self, invoice_id: str, *, request_options: typing.Optional[RequestOption invoice_id="invoice_id", ) """ - _response = self._raw_client.get(invoice_id, request_options=request_options) - return _response.data + response = self._raw_client.get(invoice_id, request_options=request_options) + return response.data def update( self, @@ -353,14 +388,14 @@ def update( idempotency_key="4ee82288-0910-499e-ab4c-5d0071dad1be", ) """ - _response = self._raw_client.update( + response = self._raw_client.update( invoice_id, invoice=invoice, idempotency_key=idempotency_key, fields_to_clear=fields_to_clear, request_options=request_options, ) - return _response.data + return response.data def delete( self, @@ -404,8 +439,8 @@ def delete( version=1, ) """ - _response = self._raw_client.delete(invoice_id, version=version, request_options=request_options) - return _response.data + response = self._raw_client.delete(invoice_id, version=version, request_options=request_options) + return response.data def create_invoice_attachment( self, @@ -454,10 +489,10 @@ def create_invoice_attachment( invoice_id="invoice_id", ) """ - _response = self._raw_client.create_invoice_attachment( + response = self._raw_client.create_invoice_attachment( invoice_id, request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data def delete_invoice_attachment( self, invoice_id: str, attachment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -494,10 +529,10 @@ def delete_invoice_attachment( attachment_id="attachment_id", ) """ - _response = self._raw_client.delete_invoice_attachment( + response = self._raw_client.delete_invoice_attachment( invoice_id, attachment_id, request_options=request_options ) - return _response.data + return response.data def cancel( self, invoice_id: str, *, version: int, request_options: typing.Optional[RequestOptions] = None @@ -538,8 +573,8 @@ def cancel( version=0, ) """ - _response = self._raw_client.cancel(invoice_id, version=version, request_options=request_options) - return _response.data + response = self._raw_client.cancel(invoice_id, version=version, request_options=request_options) + return response.data def publish( self, @@ -602,10 +637,10 @@ def publish( idempotency_key="32da42d0-1997-41b0-826b-f09464fc2c2e", ) """ - _response = self._raw_client.publish( + response = self._raw_client.publish( invoice_id, version=version, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data class AsyncInvoicesClient: @@ -630,7 +665,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Invoice, ListInvoicesResponse]: + ) -> AsyncPager[Invoice]: """ Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you @@ -656,7 +691,7 @@ async def list( Returns ------- - AsyncPager[Invoice, ListInvoicesResponse] + AsyncPager[Invoice] Success Examples @@ -678,7 +713,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -686,9 +720,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - location_id=location_id, cursor=cursor, limit=limit, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/invoices", + method="GET", + params={ + "location_id": location_id, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListInvoicesResponse, + construct_type( + type_=ListInvoicesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.invoices + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -788,10 +852,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( invoice=invoice, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -859,10 +923,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def get( self, invoice_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -902,8 +966,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(invoice_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(invoice_id, request_options=request_options) + return response.data async def update( self, @@ -980,14 +1044,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( invoice_id, invoice=invoice, idempotency_key=idempotency_key, fields_to_clear=fields_to_clear, request_options=request_options, ) - return _response.data + return response.data async def delete( self, @@ -1039,8 +1103,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(invoice_id, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.delete(invoice_id, version=version, request_options=request_options) + return response.data async def create_invoice_attachment( self, @@ -1097,10 +1161,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create_invoice_attachment( + response = await self._raw_client.create_invoice_attachment( invoice_id, request=request, image_file=image_file, request_options=request_options ) - return _response.data + return response.data async def delete_invoice_attachment( self, invoice_id: str, attachment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1145,10 +1209,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete_invoice_attachment( + response = await self._raw_client.delete_invoice_attachment( invoice_id, attachment_id, request_options=request_options ) - return _response.data + return response.data async def cancel( self, invoice_id: str, *, version: int, request_options: typing.Optional[RequestOptions] = None @@ -1197,8 +1261,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(invoice_id, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(invoice_id, version=version, request_options=request_options) + return response.data async def publish( self, @@ -1269,7 +1333,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.publish( + response = await self._raw_client.publish( invoice_id, version=version, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/invoices/raw_client.py b/src/square/invoices/raw_client.py index a5813087..e1ad5440 100644 --- a/src/square/invoices/raw_client.py +++ b/src/square/invoices/raw_client.py @@ -1,32 +1,30 @@ # This file was auto-generated by Fern from our API Definition. -import json import typing -from json.decoder import JSONDecodeError - -from .. import core -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.invoice import InvoiceParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_invoice_response import CreateInvoiceResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.create_invoice_attachment_request_data import CreateInvoiceAttachmentRequestDataParams -from ..requests.invoice import InvoiceParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.invoice_query import InvoiceQueryParams -from ..types.cancel_invoice_response import CancelInvoiceResponse +from ..types.search_invoices_response import SearchInvoicesResponse +from ..types.get_invoice_response import GetInvoiceResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..types.update_invoice_response import UpdateInvoiceResponse +from ..types.delete_invoice_response import DeleteInvoiceResponse +from ..requests.create_invoice_attachment_request_data import CreateInvoiceAttachmentRequestDataParams +from .. import core from ..types.create_invoice_attachment_response import CreateInvoiceAttachmentResponse -from ..types.create_invoice_response import CreateInvoiceResponse +import json from ..types.delete_invoice_attachment_response import DeleteInvoiceAttachmentResponse -from ..types.delete_invoice_response import DeleteInvoiceResponse -from ..types.get_invoice_response import GetInvoiceResponse -from ..types.invoice import Invoice -from ..types.list_invoices_response import ListInvoicesResponse +from ..types.cancel_invoice_response import CancelInvoiceResponse from ..types.publish_invoice_response import PublishInvoiceResponse -from ..types.search_invoices_response import SearchInvoicesResponse -from ..types.update_invoice_response import UpdateInvoiceResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -36,76 +34,6 @@ class RawInvoicesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - location_id: str, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Invoice, ListInvoicesResponse]: - """ - Returns a list of invoices for a given location. The response - is paginated. If truncated, the response includes a `cursor` that you - use in a subsequent request to retrieve the next set of invoices. - - Parameters - ---------- - location_id : str - The ID of the location for which to list invoices. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of invoices to return (200 is the maximum `limit`). - If not provided, the server uses a default limit of 100 invoices. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Invoice, ListInvoicesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/invoices", - method="GET", - params={ - "location_id": location_id, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListInvoicesResponse, - construct_type( - type_=ListInvoicesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.invoices - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - location_id=location_id, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -167,8 +95,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -238,8 +166,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, invoice_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -277,8 +205,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -354,8 +282,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, @@ -407,8 +335,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create_invoice_attachment( self, @@ -464,7 +392,6 @@ def create_invoice_attachment( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -478,8 +405,8 @@ def create_invoice_attachment( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete_invoice_attachment( self, invoice_id: str, attachment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -521,8 +448,8 @@ def delete_invoice_attachment( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, invoice_id: str, *, version: int, request_options: typing.Optional[RequestOptions] = None @@ -575,8 +502,8 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def publish( self, @@ -651,87 +578,14 @@ def publish( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawInvoicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - location_id: str, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Invoice, ListInvoicesResponse]: - """ - Returns a list of invoices for a given location. The response - is paginated. If truncated, the response includes a `cursor` that you - use in a subsequent request to retrieve the next set of invoices. - - Parameters - ---------- - location_id : str - The ID of the location for which to list invoices. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of invoices to return (200 is the maximum `limit`). - If not provided, the server uses a default limit of 100 invoices. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Invoice, ListInvoicesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/invoices", - method="GET", - params={ - "location_id": location_id, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListInvoicesResponse, - construct_type( - type_=ListInvoicesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.invoices - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - location_id=location_id, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -793,8 +647,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -864,8 +718,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, invoice_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -903,8 +757,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -980,8 +834,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, @@ -1033,8 +887,8 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create_invoice_attachment( self, @@ -1090,7 +944,6 @@ async def create_invoice_attachment( }, request_options=request_options, omit=OMIT, - force_multipart=True, ) try: if 200 <= _response.status_code < 300: @@ -1104,8 +957,8 @@ async def create_invoice_attachment( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete_invoice_attachment( self, invoice_id: str, attachment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1147,8 +1000,8 @@ async def delete_invoice_attachment( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, invoice_id: str, *, version: int, request_options: typing.Optional[RequestOptions] = None @@ -1201,8 +1054,8 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def publish( self, @@ -1277,5 +1130,5 @@ async def publish( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/labor/__init__.py b/src/square/labor/__init__.py index b0129977..35d793c5 100644 --- a/src/square/labor/__init__.py +++ b/src/square/labor/__init__.py @@ -1,40 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import break_types, employee_wages, shifts, team_member_wages, workweek_configs -_dynamic_imports: typing.Dict[str, str] = { - "break_types": ".break_types", - "employee_wages": ".employee_wages", - "shifts": ".shifts", - "team_member_wages": ".team_member_wages", - "workweek_configs": ".workweek_configs", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import break_types, employee_wages, shifts, team_member_wages, workweek_configs __all__ = ["break_types", "employee_wages", "shifts", "team_member_wages", "workweek_configs"] diff --git a/src/square/labor/break_types/__init__.py b/src/square/labor/break_types/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/labor/break_types/__init__.py +++ b/src/square/labor/break_types/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/labor/break_types/client.py b/src/square/labor/break_types/client.py index f18a9209..8dadc1b7 100644 --- a/src/square/labor/break_types/client.py +++ b/src/square/labor/break_types/client.py @@ -1,18 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawBreakTypesClient from ...core.request_options import RequestOptions -from ...requests.break_type import BreakTypeParams +from ...core.pagination import SyncPager from ...types.break_type import BreakType +from ...types.list_break_types_response import ListBreakTypesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...requests.break_type import BreakTypeParams from ...types.create_break_type_response import CreateBreakTypeResponse -from ...types.delete_break_type_response import DeleteBreakTypeResponse from ...types.get_break_type_response import GetBreakTypeResponse -from ...types.list_break_types_response import ListBreakTypesResponse from ...types.update_break_type_response import UpdateBreakTypeResponse -from .raw_client import AsyncRawBreakTypesClient, RawBreakTypesClient +from ...types.delete_break_type_response import DeleteBreakTypeResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawBreakTypesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -40,7 +45,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[BreakType, ListBreakTypesResponse]: + ) -> SyncPager[BreakType]: """ Returns a paginated list of `BreakType` instances for a business. @@ -62,7 +67,7 @@ def list( Returns ------- - SyncPager[BreakType, ListBreakTypesResponse] + SyncPager[BreakType] Success Examples @@ -83,9 +88,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - location_id=location_id, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/break-types", + method="GET", + params={ + "location_id": location_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBreakTypesResponse, + construct_type( + type_=ListBreakTypesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.break_types + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -143,10 +178,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( break_type=break_type, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetBreakTypeResponse: """ @@ -176,8 +211,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data def update( self, id: str, *, break_type: BreakTypeParams, request_options: typing.Optional[RequestOptions] = None @@ -219,8 +254,8 @@ def update( }, ) """ - _response = self._raw_client.update(id, break_type=break_type, request_options=request_options) - return _response.data + response = self._raw_client.update(id, break_type=break_type, request_options=request_options) + return response.data def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeleteBreakTypeResponse: """ @@ -252,8 +287,8 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = id="id", ) """ - _response = self._raw_client.delete(id, request_options=request_options) - return _response.data + response = self._raw_client.delete(id, request_options=request_options) + return response.data class AsyncBreakTypesClient: @@ -278,7 +313,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[BreakType, ListBreakTypesResponse]: + ) -> AsyncPager[BreakType]: """ Returns a paginated list of `BreakType` instances for a business. @@ -300,7 +335,7 @@ async def list( Returns ------- - AsyncPager[BreakType, ListBreakTypesResponse] + AsyncPager[BreakType] Success Examples @@ -322,7 +357,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -330,9 +364,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - location_id=location_id, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/break-types", + method="GET", + params={ + "location_id": location_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListBreakTypesResponse, + construct_type( + type_=ListBreakTypesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.break_types + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -398,10 +462,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( break_type=break_type, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetBreakTypeResponse: """ @@ -439,8 +503,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data async def update( self, id: str, *, break_type: BreakTypeParams, request_options: typing.Optional[RequestOptions] = None @@ -490,8 +554,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update(id, break_type=break_type, request_options=request_options) - return _response.data + response = await self._raw_client.update(id, break_type=break_type, request_options=request_options) + return response.data async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -533,5 +597,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(id, request_options=request_options) + return response.data diff --git a/src/square/labor/break_types/raw_client.py b/src/square/labor/break_types/raw_client.py index e5c7ddd1..3b437ece 100644 --- a/src/square/labor/break_types/raw_client.py +++ b/src/square/labor/break_types/raw_client.py @@ -1,23 +1,21 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.break_type import BreakTypeParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_break_type_response import CreateBreakTypeResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.break_type import BreakTypeParams -from ...types.break_type import BreakType -from ...types.create_break_type_response import CreateBreakTypeResponse -from ...types.delete_break_type_response import DeleteBreakTypeResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_break_type_response import GetBreakTypeResponse -from ...types.list_break_types_response import ListBreakTypesResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_break_type_response import UpdateBreakTypeResponse +from ...types.delete_break_type_response import DeleteBreakTypeResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -27,72 +25,6 @@ class RawBreakTypesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - location_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[BreakType, ListBreakTypesResponse]: - """ - Returns a paginated list of `BreakType` instances for a business. - - Parameters - ---------- - location_id : typing.Optional[str] - Filter the returned `BreakType` results to only those that are associated with the - specified location. - - limit : typing.Optional[int] - The maximum number of `BreakType` results to return per page. The number can range between 1 - and 200. The default is 200. - - cursor : typing.Optional[str] - A pointer to the next page of `BreakType` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[BreakType, ListBreakTypesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/labor/break-types", - method="GET", - params={ - "location_id": location_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBreakTypesResponse, - construct_type( - type_=ListBreakTypesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.break_types - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - location_id=location_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -159,8 +91,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -198,8 +130,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, id: str, *, break_type: BreakTypeParams, request_options: typing.Optional[RequestOptions] = None @@ -249,8 +181,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -290,83 +222,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawBreakTypesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - location_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[BreakType, ListBreakTypesResponse]: - """ - Returns a paginated list of `BreakType` instances for a business. - - Parameters - ---------- - location_id : typing.Optional[str] - Filter the returned `BreakType` results to only those that are associated with the - specified location. - - limit : typing.Optional[int] - The maximum number of `BreakType` results to return per page. The number can range between 1 - and 200. The default is 200. - - cursor : typing.Optional[str] - A pointer to the next page of `BreakType` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[BreakType, ListBreakTypesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/labor/break-types", - method="GET", - params={ - "location_id": location_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListBreakTypesResponse, - construct_type( - type_=ListBreakTypesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.break_types - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - location_id=location_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -433,8 +296,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -472,8 +335,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, id: str, *, break_type: BreakTypeParams, request_options: typing.Optional[RequestOptions] = None @@ -523,8 +386,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -564,5 +427,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/labor/client.py b/src/square/labor/client.py index 099ebb40..e62db55c 100644 --- a/src/square/labor/client.py +++ b/src/square/labor/client.py @@ -1,36 +1,39 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawLaborClient +from .break_types.client import BreakTypesClient +from .employee_wages.client import EmployeeWagesClient +from .shifts.client import ShiftsClient +from .team_member_wages.client import TeamMemberWagesClient +from .workweek_configs.client import WorkweekConfigsClient +from ..requests.scheduled_shift import ScheduledShiftParams from ..core.request_options import RequestOptions +from ..types.create_scheduled_shift_response import CreateScheduledShiftResponse from ..requests.bulk_publish_scheduled_shifts_data import BulkPublishScheduledShiftsDataParams -from ..requests.scheduled_shift import ScheduledShiftParams +from ..types.scheduled_shift_notification_audience import ScheduledShiftNotificationAudience +from ..types.bulk_publish_scheduled_shifts_response import BulkPublishScheduledShiftsResponse from ..requests.scheduled_shift_query import ScheduledShiftQueryParams +from ..types.search_scheduled_shifts_response import SearchScheduledShiftsResponse +from ..types.retrieve_scheduled_shift_response import RetrieveScheduledShiftResponse +from ..types.update_scheduled_shift_response import UpdateScheduledShiftResponse +from ..types.publish_scheduled_shift_response import PublishScheduledShiftResponse from ..requests.timecard import TimecardParams -from ..requests.timecard_query import TimecardQueryParams -from ..types.bulk_publish_scheduled_shifts_response import BulkPublishScheduledShiftsResponse -from ..types.create_scheduled_shift_response import CreateScheduledShiftResponse from ..types.create_timecard_response import CreateTimecardResponse -from ..types.delete_timecard_response import DeleteTimecardResponse -from ..types.publish_scheduled_shift_response import PublishScheduledShiftResponse -from ..types.retrieve_scheduled_shift_response import RetrieveScheduledShiftResponse -from ..types.retrieve_timecard_response import RetrieveTimecardResponse -from ..types.scheduled_shift_notification_audience import ScheduledShiftNotificationAudience -from ..types.search_scheduled_shifts_response import SearchScheduledShiftsResponse +from ..requests.timecard_query import TimecardQueryParams from ..types.search_timecards_response import SearchTimecardsResponse -from ..types.update_scheduled_shift_response import UpdateScheduledShiftResponse +from ..types.retrieve_timecard_response import RetrieveTimecardResponse from ..types.update_timecard_response import UpdateTimecardResponse -from .raw_client import AsyncRawLaborClient, RawLaborClient - -if typing.TYPE_CHECKING: - from .break_types.client import AsyncBreakTypesClient, BreakTypesClient - from .employee_wages.client import AsyncEmployeeWagesClient, EmployeeWagesClient - from .shifts.client import AsyncShiftsClient, ShiftsClient - from .team_member_wages.client import AsyncTeamMemberWagesClient, TeamMemberWagesClient - from .workweek_configs.client import AsyncWorkweekConfigsClient, WorkweekConfigsClient +from ..types.delete_timecard_response import DeleteTimecardResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawLaborClient +from .break_types.client import AsyncBreakTypesClient +from .employee_wages.client import AsyncEmployeeWagesClient +from .shifts.client import AsyncShiftsClient +from .team_member_wages.client import AsyncTeamMemberWagesClient +from .workweek_configs.client import AsyncWorkweekConfigsClient + # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -38,12 +41,15 @@ class LaborClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLaborClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._break_types: typing.Optional[BreakTypesClient] = None - self._employee_wages: typing.Optional[EmployeeWagesClient] = None - self._shifts: typing.Optional[ShiftsClient] = None - self._team_member_wages: typing.Optional[TeamMemberWagesClient] = None - self._workweek_configs: typing.Optional[WorkweekConfigsClient] = None + self.break_types = BreakTypesClient(client_wrapper=client_wrapper) + + self.employee_wages = EmployeeWagesClient(client_wrapper=client_wrapper) + + self.shifts = ShiftsClient(client_wrapper=client_wrapper) + + self.team_member_wages = TeamMemberWagesClient(client_wrapper=client_wrapper) + + self.workweek_configs = WorkweekConfigsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLaborClient: @@ -119,10 +125,10 @@ def create_scheduled_shift( }, ) """ - _response = self._raw_client.create_scheduled_shift( + response = self._raw_client.create_scheduled_shift( scheduled_shift=scheduled_shift, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def bulk_publish_scheduled_shifts( self, @@ -174,12 +180,12 @@ def bulk_publish_scheduled_shifts( scheduled_shift_notification_audience="AFFECTED", ) """ - _response = self._raw_client.bulk_publish_scheduled_shifts( + response = self._raw_client.bulk_publish_scheduled_shifts( scheduled_shifts=scheduled_shifts, scheduled_shift_notification_audience=scheduled_shift_notification_audience, request_options=request_options, ) - return _response.data + return response.data def search_scheduled_shifts( self, @@ -230,10 +236,10 @@ def search_scheduled_shifts( cursor="xoxp-1234-5678-90123", ) """ - _response = self._raw_client.search_scheduled_shifts( + response = self._raw_client.search_scheduled_shifts( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data def retrieve_scheduled_shift( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -265,8 +271,8 @@ def retrieve_scheduled_shift( id="id", ) """ - _response = self._raw_client.retrieve_scheduled_shift(id, request_options=request_options) - return _response.data + response = self._raw_client.retrieve_scheduled_shift(id, request_options=request_options) + return response.data def update_scheduled_shift( self, id: str, *, scheduled_shift: ScheduledShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -334,10 +340,10 @@ def update_scheduled_shift( }, ) """ - _response = self._raw_client.update_scheduled_shift( + response = self._raw_client.update_scheduled_shift( id, scheduled_shift=scheduled_shift, request_options=request_options ) - return _response.data + return response.data def publish_scheduled_shift( self, @@ -394,14 +400,14 @@ def publish_scheduled_shift( scheduled_shift_notification_audience="ALL", ) """ - _response = self._raw_client.publish_scheduled_shift( + response = self._raw_client.publish_scheduled_shift( id, idempotency_key=idempotency_key, version=version, scheduled_shift_notification_audience=scheduled_shift_notification_audience, request_options=request_options, ) - return _response.data + return response.data def create_timecard( self, @@ -479,10 +485,10 @@ def create_timecard( }, ) """ - _response = self._raw_client.create_timecard( + response = self._raw_client.create_timecard( timecard=timecard, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search_timecards( self, @@ -550,10 +556,10 @@ def search_timecards( limit=100, ) """ - _response = self._raw_client.search_timecards( + response = self._raw_client.search_timecards( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data def retrieve_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -585,8 +591,8 @@ def retrieve_timecard( id="id", ) """ - _response = self._raw_client.retrieve_timecard(id, request_options=request_options) - return _response.data + response = self._raw_client.retrieve_timecard(id, request_options=request_options) + return response.data def update_timecard( self, id: str, *, timecard: TimecardParams, request_options: typing.Optional[RequestOptions] = None @@ -652,8 +658,8 @@ def update_timecard( }, ) """ - _response = self._raw_client.update_timecard(id, timecard=timecard, request_options=request_options) - return _response.data + response = self._raw_client.update_timecard(id, timecard=timecard, request_options=request_options) + return response.data def delete_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -685,59 +691,22 @@ def delete_timecard( id="id", ) """ - _response = self._raw_client.delete_timecard(id, request_options=request_options) - return _response.data - - @property - def break_types(self): - if self._break_types is None: - from .break_types.client import BreakTypesClient # noqa: E402 + response = self._raw_client.delete_timecard(id, request_options=request_options) + return response.data - self._break_types = BreakTypesClient(client_wrapper=self._client_wrapper) - return self._break_types - @property - def employee_wages(self): - if self._employee_wages is None: - from .employee_wages.client import EmployeeWagesClient # noqa: E402 - - self._employee_wages = EmployeeWagesClient(client_wrapper=self._client_wrapper) - return self._employee_wages - - @property - def shifts(self): - if self._shifts is None: - from .shifts.client import ShiftsClient # noqa: E402 - - self._shifts = ShiftsClient(client_wrapper=self._client_wrapper) - return self._shifts - - @property - def team_member_wages(self): - if self._team_member_wages is None: - from .team_member_wages.client import TeamMemberWagesClient # noqa: E402 - - self._team_member_wages = TeamMemberWagesClient(client_wrapper=self._client_wrapper) - return self._team_member_wages +class AsyncLaborClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawLaborClient(client_wrapper=client_wrapper) + self.break_types = AsyncBreakTypesClient(client_wrapper=client_wrapper) - @property - def workweek_configs(self): - if self._workweek_configs is None: - from .workweek_configs.client import WorkweekConfigsClient # noqa: E402 + self.employee_wages = AsyncEmployeeWagesClient(client_wrapper=client_wrapper) - self._workweek_configs = WorkweekConfigsClient(client_wrapper=self._client_wrapper) - return self._workweek_configs + self.shifts = AsyncShiftsClient(client_wrapper=client_wrapper) + self.team_member_wages = AsyncTeamMemberWagesClient(client_wrapper=client_wrapper) -class AsyncLaborClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawLaborClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._break_types: typing.Optional[AsyncBreakTypesClient] = None - self._employee_wages: typing.Optional[AsyncEmployeeWagesClient] = None - self._shifts: typing.Optional[AsyncShiftsClient] = None - self._team_member_wages: typing.Optional[AsyncTeamMemberWagesClient] = None - self._workweek_configs: typing.Optional[AsyncWorkweekConfigsClient] = None + self.workweek_configs = AsyncWorkweekConfigsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLaborClient: @@ -821,10 +790,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create_scheduled_shift( + response = await self._raw_client.create_scheduled_shift( scheduled_shift=scheduled_shift, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def bulk_publish_scheduled_shifts( self, @@ -884,12 +853,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_publish_scheduled_shifts( + response = await self._raw_client.bulk_publish_scheduled_shifts( scheduled_shifts=scheduled_shifts, scheduled_shift_notification_audience=scheduled_shift_notification_audience, request_options=request_options, ) - return _response.data + return response.data async def search_scheduled_shifts( self, @@ -948,10 +917,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search_scheduled_shifts( + response = await self._raw_client.search_scheduled_shifts( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def retrieve_scheduled_shift( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -991,8 +960,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_scheduled_shift(id, request_options=request_options) - return _response.data + response = await self._raw_client.retrieve_scheduled_shift(id, request_options=request_options) + return response.data async def update_scheduled_shift( self, id: str, *, scheduled_shift: ScheduledShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -1068,10 +1037,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_scheduled_shift( + response = await self._raw_client.update_scheduled_shift( id, scheduled_shift=scheduled_shift, request_options=request_options ) - return _response.data + return response.data async def publish_scheduled_shift( self, @@ -1136,14 +1105,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.publish_scheduled_shift( + response = await self._raw_client.publish_scheduled_shift( id, idempotency_key=idempotency_key, version=version, scheduled_shift_notification_audience=scheduled_shift_notification_audience, request_options=request_options, ) - return _response.data + return response.data async def create_timecard( self, @@ -1229,10 +1198,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create_timecard( + response = await self._raw_client.create_timecard( timecard=timecard, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search_timecards( self, @@ -1308,10 +1277,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search_timecards( + response = await self._raw_client.search_timecards( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def retrieve_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1351,8 +1320,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_timecard(id, request_options=request_options) - return _response.data + response = await self._raw_client.retrieve_timecard(id, request_options=request_options) + return response.data async def update_timecard( self, id: str, *, timecard: TimecardParams, request_options: typing.Optional[RequestOptions] = None @@ -1426,8 +1395,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_timecard(id, timecard=timecard, request_options=request_options) - return _response.data + response = await self._raw_client.update_timecard(id, timecard=timecard, request_options=request_options) + return response.data async def delete_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1467,45 +1436,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete_timecard(id, request_options=request_options) - return _response.data - - @property - def break_types(self): - if self._break_types is None: - from .break_types.client import AsyncBreakTypesClient # noqa: E402 - - self._break_types = AsyncBreakTypesClient(client_wrapper=self._client_wrapper) - return self._break_types - - @property - def employee_wages(self): - if self._employee_wages is None: - from .employee_wages.client import AsyncEmployeeWagesClient # noqa: E402 - - self._employee_wages = AsyncEmployeeWagesClient(client_wrapper=self._client_wrapper) - return self._employee_wages - - @property - def shifts(self): - if self._shifts is None: - from .shifts.client import AsyncShiftsClient # noqa: E402 - - self._shifts = AsyncShiftsClient(client_wrapper=self._client_wrapper) - return self._shifts - - @property - def team_member_wages(self): - if self._team_member_wages is None: - from .team_member_wages.client import AsyncTeamMemberWagesClient # noqa: E402 - - self._team_member_wages = AsyncTeamMemberWagesClient(client_wrapper=self._client_wrapper) - return self._team_member_wages - - @property - def workweek_configs(self): - if self._workweek_configs is None: - from .workweek_configs.client import AsyncWorkweekConfigsClient # noqa: E402 - - self._workweek_configs = AsyncWorkweekConfigsClient(client_wrapper=self._client_wrapper) - return self._workweek_configs + response = await self._raw_client.delete_timecard(id, request_options=request_options) + return response.data diff --git a/src/square/labor/employee_wages/__init__.py b/src/square/labor/employee_wages/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/labor/employee_wages/__init__.py +++ b/src/square/labor/employee_wages/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/labor/employee_wages/client.py b/src/square/labor/employee_wages/client.py index e2b854f5..e0251a22 100644 --- a/src/square/labor/employee_wages/client.py +++ b/src/square/labor/employee_wages/client.py @@ -1,14 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawEmployeeWagesClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager from ...types.employee_wage import EmployeeWage -from ...types.get_employee_wage_response import GetEmployeeWageResponse from ...types.list_employee_wages_response import ListEmployeeWagesResponse -from .raw_client import AsyncRawEmployeeWagesClient, RawEmployeeWagesClient +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.get_employee_wage_response import GetEmployeeWageResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawEmployeeWagesClient +from ...core.pagination import AsyncPager class EmployeeWagesClient: @@ -33,7 +38,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[EmployeeWage, ListEmployeeWagesResponse]: + ) -> SyncPager[EmployeeWage]: """ Returns a paginated list of `EmployeeWage` instances for a business. @@ -54,7 +59,7 @@ def list( Returns ------- - SyncPager[EmployeeWage, ListEmployeeWagesResponse] + SyncPager[EmployeeWage] Success Examples @@ -75,9 +80,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - employee_id=employee_id, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/employee-wages", + method="GET", + params={ + "employee_id": employee_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListEmployeeWagesResponse, + construct_type( + type_=ListEmployeeWagesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + employee_id=employee_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.employee_wages + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetEmployeeWageResponse: """ @@ -107,8 +142,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data class AsyncEmployeeWagesClient: @@ -133,7 +168,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[EmployeeWage, ListEmployeeWagesResponse]: + ) -> AsyncPager[EmployeeWage]: """ Returns a paginated list of `EmployeeWage` instances for a business. @@ -154,7 +189,7 @@ async def list( Returns ------- - AsyncPager[EmployeeWage, ListEmployeeWagesResponse] + AsyncPager[EmployeeWage] Success Examples @@ -176,7 +211,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -184,9 +218,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - employee_id=employee_id, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/employee-wages", + method="GET", + params={ + "employee_id": employee_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListEmployeeWagesResponse, + construct_type( + type_=ListEmployeeWagesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + employee_id=employee_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.employee_wages + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetEmployeeWageResponse: """ @@ -224,5 +288,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data diff --git a/src/square/labor/employee_wages/raw_client.py b/src/square/labor/employee_wages/raw_client.py index bb4985b0..94227b7a 100644 --- a/src/square/labor/employee_wages/raw_client.py +++ b/src/square/labor/employee_wages/raw_client.py @@ -1,89 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type -from ...types.employee_wage import EmployeeWage +from ...core.http_response import HttpResponse from ...types.get_employee_wage_response import GetEmployeeWageResponse -from ...types.list_employee_wages_response import ListEmployeeWagesResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawEmployeeWagesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - employee_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[EmployeeWage, ListEmployeeWagesResponse]: - """ - Returns a paginated list of `EmployeeWage` instances for a business. - - Parameters - ---------- - employee_id : typing.Optional[str] - Filter the returned wages to only those that are associated with the specified employee. - - limit : typing.Optional[int] - The maximum number of `EmployeeWage` results to return per page. The number can range between - 1 and 200. The default is 200. - - cursor : typing.Optional[str] - A pointer to the next page of `EmployeeWage` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[EmployeeWage, ListEmployeeWagesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/labor/employee-wages", - method="GET", - params={ - "employee_id": employee_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListEmployeeWagesResponse, - construct_type( - type_=ListEmployeeWagesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.employee_wages - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - employee_id=employee_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetEmployeeWageResponse]: @@ -120,82 +53,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawEmployeeWagesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - employee_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[EmployeeWage, ListEmployeeWagesResponse]: - """ - Returns a paginated list of `EmployeeWage` instances for a business. - - Parameters - ---------- - employee_id : typing.Optional[str] - Filter the returned wages to only those that are associated with the specified employee. - - limit : typing.Optional[int] - The maximum number of `EmployeeWage` results to return per page. The number can range between - 1 and 200. The default is 200. - - cursor : typing.Optional[str] - A pointer to the next page of `EmployeeWage` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[EmployeeWage, ListEmployeeWagesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/labor/employee-wages", - method="GET", - params={ - "employee_id": employee_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListEmployeeWagesResponse, - construct_type( - type_=ListEmployeeWagesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.employee_wages - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - employee_id=employee_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetEmployeeWageResponse]: @@ -232,5 +97,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/labor/raw_client.py b/src/square/labor/raw_client.py index e2013f4d..a6fcd97a 100644 --- a/src/square/labor/raw_client.py +++ b/src/square/labor/raw_client.py @@ -1,32 +1,33 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper +from ..requests.scheduled_shift import ScheduledShiftParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_scheduled_shift_response import CreateScheduledShiftResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.bulk_publish_scheduled_shifts_data import BulkPublishScheduledShiftsDataParams -from ..requests.scheduled_shift import ScheduledShiftParams +from ..types.scheduled_shift_notification_audience import ScheduledShiftNotificationAudience +from ..types.bulk_publish_scheduled_shifts_response import BulkPublishScheduledShiftsResponse from ..requests.scheduled_shift_query import ScheduledShiftQueryParams +from ..types.search_scheduled_shifts_response import SearchScheduledShiftsResponse +from ..types.retrieve_scheduled_shift_response import RetrieveScheduledShiftResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..types.update_scheduled_shift_response import UpdateScheduledShiftResponse +from ..types.publish_scheduled_shift_response import PublishScheduledShiftResponse from ..requests.timecard import TimecardParams -from ..requests.timecard_query import TimecardQueryParams -from ..types.bulk_publish_scheduled_shifts_response import BulkPublishScheduledShiftsResponse -from ..types.create_scheduled_shift_response import CreateScheduledShiftResponse from ..types.create_timecard_response import CreateTimecardResponse -from ..types.delete_timecard_response import DeleteTimecardResponse -from ..types.publish_scheduled_shift_response import PublishScheduledShiftResponse -from ..types.retrieve_scheduled_shift_response import RetrieveScheduledShiftResponse -from ..types.retrieve_timecard_response import RetrieveTimecardResponse -from ..types.scheduled_shift_notification_audience import ScheduledShiftNotificationAudience -from ..types.search_scheduled_shifts_response import SearchScheduledShiftsResponse +from ..requests.timecard_query import TimecardQueryParams from ..types.search_timecards_response import SearchTimecardsResponse -from ..types.update_scheduled_shift_response import UpdateScheduledShiftResponse +from ..types.retrieve_timecard_response import RetrieveTimecardResponse from ..types.update_timecard_response import UpdateTimecardResponse +from ..types.delete_timecard_response import DeleteTimecardResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -104,8 +105,8 @@ def create_scheduled_shift( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_publish_scheduled_shifts( self, @@ -174,8 +175,8 @@ def bulk_publish_scheduled_shifts( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search_scheduled_shifts( self, @@ -238,8 +239,8 @@ def search_scheduled_shifts( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def retrieve_scheduled_shift( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -277,8 +278,8 @@ def retrieve_scheduled_shift( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_scheduled_shift( self, id: str, *, scheduled_shift: ScheduledShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -349,8 +350,8 @@ def update_scheduled_shift( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def publish_scheduled_shift( self, @@ -419,8 +420,8 @@ def publish_scheduled_shift( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create_timecard( self, @@ -492,8 +493,8 @@ def create_timecard( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search_timecards( self, @@ -566,8 +567,8 @@ def search_timecards( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def retrieve_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -605,8 +606,8 @@ def retrieve_timecard( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_timecard( self, id: str, *, timecard: TimecardParams, request_options: typing.Optional[RequestOptions] = None @@ -662,8 +663,8 @@ def update_timecard( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -701,8 +702,8 @@ def delete_timecard( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawLaborClient: @@ -777,8 +778,8 @@ async def create_scheduled_shift( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_publish_scheduled_shifts( self, @@ -847,8 +848,8 @@ async def bulk_publish_scheduled_shifts( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search_scheduled_shifts( self, @@ -911,8 +912,8 @@ async def search_scheduled_shifts( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def retrieve_scheduled_shift( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -950,8 +951,8 @@ async def retrieve_scheduled_shift( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_scheduled_shift( self, id: str, *, scheduled_shift: ScheduledShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -1022,8 +1023,8 @@ async def update_scheduled_shift( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def publish_scheduled_shift( self, @@ -1092,8 +1093,8 @@ async def publish_scheduled_shift( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create_timecard( self, @@ -1165,8 +1166,8 @@ async def create_timecard( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search_timecards( self, @@ -1239,8 +1240,8 @@ async def search_timecards( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def retrieve_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1278,8 +1279,8 @@ async def retrieve_timecard( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_timecard( self, id: str, *, timecard: TimecardParams, request_options: typing.Optional[RequestOptions] = None @@ -1335,8 +1336,8 @@ async def update_timecard( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete_timecard( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1374,5 +1375,5 @@ async def delete_timecard( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/labor/shifts/__init__.py b/src/square/labor/shifts/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/labor/shifts/__init__.py +++ b/src/square/labor/shifts/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/labor/shifts/client.py b/src/square/labor/shifts/client.py index 6ad4f935..23fd1d53 100644 --- a/src/square/labor/shifts/client.py +++ b/src/square/labor/shifts/client.py @@ -1,17 +1,18 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawShiftsClient from ...requests.shift import ShiftParams -from ...requests.shift_query import ShiftQueryParams +from ...core.request_options import RequestOptions from ...types.create_shift_response import CreateShiftResponse -from ...types.delete_shift_response import DeleteShiftResponse -from ...types.get_shift_response import GetShiftResponse +from ...requests.shift_query import ShiftQueryParams from ...types.search_shifts_response import SearchShiftsResponse +from ...types.get_shift_response import GetShiftResponse from ...types.update_shift_response import UpdateShiftResponse -from .raw_client import AsyncRawShiftsClient, RawShiftsClient +from ...types.delete_shift_response import DeleteShiftResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawShiftsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -108,10 +109,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( shift=shift, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -179,8 +180,8 @@ def search( limit=100, ) """ - _response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) + return response.data def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetShiftResponse: """ @@ -210,8 +211,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data def update( self, id: str, *, shift: ShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -276,8 +277,8 @@ def update( }, ) """ - _response = self._raw_client.update(id, shift=shift, request_options=request_options) - return _response.data + response = self._raw_client.update(id, shift=shift, request_options=request_options) + return response.data def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeleteShiftResponse: """ @@ -307,8 +308,8 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = id="id", ) """ - _response = self._raw_client.delete(id, request_options=request_options) - return _response.data + response = self._raw_client.delete(id, request_options=request_options) + return response.data class AsyncShiftsClient: @@ -410,10 +411,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( shift=shift, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -489,10 +490,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetShiftResponse: """ @@ -530,8 +531,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data async def update( self, id: str, *, shift: ShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -604,8 +605,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update(id, shift=shift, request_options=request_options) - return _response.data + response = await self._raw_client.update(id, shift=shift, request_options=request_options) + return response.data async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeleteShiftResponse: """ @@ -643,5 +644,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(id, request_options=request_options) + return response.data diff --git a/src/square/labor/shifts/raw_client.py b/src/square/labor/shifts/raw_client.py index bad5dc91..fff56967 100644 --- a/src/square/labor/shifts/raw_client.py +++ b/src/square/labor/shifts/raw_client.py @@ -1,22 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.shift import ShiftParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_shift_response import CreateShiftResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.shift import ShiftParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.shift_query import ShiftQueryParams -from ...types.create_shift_response import CreateShiftResponse -from ...types.delete_shift_response import DeleteShiftResponse -from ...types.get_shift_response import GetShiftResponse from ...types.search_shifts_response import SearchShiftsResponse +from ...types.get_shift_response import GetShiftResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_shift_response import UpdateShiftResponse +from ...types.delete_shift_response import DeleteShiftResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -96,8 +97,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -170,8 +171,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -209,8 +210,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, id: str, *, shift: ShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -266,8 +267,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -305,8 +306,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawShiftsClient: @@ -383,8 +384,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -457,8 +458,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -496,8 +497,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, id: str, *, shift: ShiftParams, request_options: typing.Optional[RequestOptions] = None @@ -553,8 +554,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -592,5 +593,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/labor/team_member_wages/__init__.py b/src/square/labor/team_member_wages/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/labor/team_member_wages/__init__.py +++ b/src/square/labor/team_member_wages/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/labor/team_member_wages/client.py b/src/square/labor/team_member_wages/client.py index d0b61c42..6f8c76e6 100644 --- a/src/square/labor/team_member_wages/client.py +++ b/src/square/labor/team_member_wages/client.py @@ -1,14 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawTeamMemberWagesClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...types.get_team_member_wage_response import GetTeamMemberWageResponse -from ...types.list_team_member_wages_response import ListTeamMemberWagesResponse +from ...core.pagination import SyncPager from ...types.team_member_wage import TeamMemberWage -from .raw_client import AsyncRawTeamMemberWagesClient, RawTeamMemberWagesClient +from ...types.list_team_member_wages_response import ListTeamMemberWagesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.get_team_member_wage_response import GetTeamMemberWageResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawTeamMemberWagesClient +from ...core.pagination import AsyncPager class TeamMemberWagesClient: @@ -33,7 +38,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: + ) -> SyncPager[TeamMemberWage]: """ Returns a paginated list of `TeamMemberWage` instances for a business. @@ -55,7 +60,7 @@ def list( Returns ------- - SyncPager[TeamMemberWage, ListTeamMemberWagesResponse] + SyncPager[TeamMemberWage] Success Examples @@ -76,9 +81,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - team_member_id=team_member_id, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/team-member-wages", + method="GET", + params={ + "team_member_id": team_member_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListTeamMemberWagesResponse, + construct_type( + type_=ListTeamMemberWagesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + team_member_id=team_member_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.team_member_wages + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetTeamMemberWageResponse: """ @@ -108,8 +143,8 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non id="id", ) """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data + response = self._raw_client.get(id, request_options=request_options) + return response.data class AsyncTeamMemberWagesClient: @@ -134,7 +169,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: + ) -> AsyncPager[TeamMemberWage]: """ Returns a paginated list of `TeamMemberWage` instances for a business. @@ -156,7 +191,7 @@ async def list( Returns ------- - AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse] + AsyncPager[TeamMemberWage] Success Examples @@ -178,7 +213,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -186,9 +220,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - team_member_id=team_member_id, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/team-member-wages", + method="GET", + params={ + "team_member_id": team_member_id, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListTeamMemberWagesResponse, + construct_type( + type_=ListTeamMemberWagesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + team_member_id=team_member_id, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.team_member_wages + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -228,5 +292,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, request_options=request_options) + return response.data diff --git a/src/square/labor/team_member_wages/raw_client.py b/src/square/labor/team_member_wages/raw_client.py index d28f5217..87400051 100644 --- a/src/square/labor/team_member_wages/raw_client.py +++ b/src/square/labor/team_member_wages/raw_client.py @@ -1,90 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type +from ...core.http_response import HttpResponse from ...types.get_team_member_wage_response import GetTeamMemberWageResponse -from ...types.list_team_member_wages_response import ListTeamMemberWagesResponse -from ...types.team_member_wage import TeamMemberWage +from ...core.jsonable_encoder import jsonable_encoder +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawTeamMemberWagesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - team_member_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: - """ - Returns a paginated list of `TeamMemberWage` instances for a business. - - Parameters - ---------- - team_member_id : typing.Optional[str] - Filter the returned wages to only those that are associated with the - specified team member. - - limit : typing.Optional[int] - The maximum number of `TeamMemberWage` results to return per page. The number can range between - 1 and 200. The default is 200. - - cursor : typing.Optional[str] - A pointer to the next page of `EmployeeWage` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[TeamMemberWage, ListTeamMemberWagesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/labor/team-member-wages", - method="GET", - params={ - "team_member_id": team_member_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListTeamMemberWagesResponse, - construct_type( - type_=ListTeamMemberWagesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.team_member_wages - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - team_member_id=team_member_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetTeamMemberWageResponse]: @@ -121,83 +53,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawTeamMemberWagesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - team_member_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: - """ - Returns a paginated list of `TeamMemberWage` instances for a business. - - Parameters - ---------- - team_member_id : typing.Optional[str] - Filter the returned wages to only those that are associated with the - specified team member. - - limit : typing.Optional[int] - The maximum number of `TeamMemberWage` results to return per page. The number can range between - 1 and 200. The default is 200. - - cursor : typing.Optional[str] - A pointer to the next page of `EmployeeWage` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/labor/team-member-wages", - method="GET", - params={ - "team_member_id": team_member_id, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListTeamMemberWagesResponse, - construct_type( - type_=ListTeamMemberWagesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.team_member_wages - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - team_member_id=team_member_id, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetTeamMemberWageResponse]: @@ -234,5 +97,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/labor/workweek_configs/__init__.py b/src/square/labor/workweek_configs/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/labor/workweek_configs/__init__.py +++ b/src/square/labor/workweek_configs/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/labor/workweek_configs/client.py b/src/square/labor/workweek_configs/client.py index 7e539bb5..3859155d 100644 --- a/src/square/labor/workweek_configs/client.py +++ b/src/square/labor/workweek_configs/client.py @@ -1,15 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawWorkweekConfigsClient from ...core.request_options import RequestOptions -from ...requests.workweek_config import WorkweekConfigParams +from ...core.pagination import SyncPager +from ...types.workweek_config import WorkweekConfig from ...types.list_workweek_configs_response import ListWorkweekConfigsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...requests.workweek_config import WorkweekConfigParams from ...types.update_workweek_config_response import UpdateWorkweekConfigResponse -from ...types.workweek_config import WorkweekConfig -from .raw_client import AsyncRawWorkweekConfigsClient, RawWorkweekConfigsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawWorkweekConfigsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -36,7 +41,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: + ) -> SyncPager[WorkweekConfig]: """ Returns a list of `WorkweekConfig` instances for a business. @@ -53,7 +58,7 @@ def list( Returns ------- - SyncPager[WorkweekConfig, ListWorkweekConfigsResponse] + SyncPager[WorkweekConfig] Success Examples @@ -73,7 +78,37 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/workweek-configs", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListWorkweekConfigsResponse, + construct_type( + type_=ListWorkweekConfigsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.workweek_configs + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, id: str, *, workweek_config: WorkweekConfigParams, request_options: typing.Optional[RequestOptions] = None @@ -113,8 +148,8 @@ def get( }, ) """ - _response = self._raw_client.get(id, workweek_config=workweek_config, request_options=request_options) - return _response.data + response = self._raw_client.get(id, workweek_config=workweek_config, request_options=request_options) + return response.data class AsyncWorkweekConfigsClient: @@ -138,7 +173,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: + ) -> AsyncPager[WorkweekConfig]: """ Returns a list of `WorkweekConfig` instances for a business. @@ -155,7 +190,7 @@ async def list( Returns ------- - AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse] + AsyncPager[WorkweekConfig] Success Examples @@ -176,7 +211,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -184,7 +218,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(limit=limit, cursor=cursor, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/labor/workweek-configs", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListWorkweekConfigsResponse, + construct_type( + type_=ListWorkweekConfigsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.workweek_configs + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, id: str, *, workweek_config: WorkweekConfigParams, request_options: typing.Optional[RequestOptions] = None @@ -232,5 +296,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(id, workweek_config=workweek_config, request_options=request_options) - return _response.data + response = await self._raw_client.get(id, workweek_config=workweek_config, request_options=request_options) + return response.data diff --git a/src/square/labor/workweek_configs/raw_client.py b/src/square/labor/workweek_configs/raw_client.py index 6e767b14..2930b711 100644 --- a/src/square/labor/workweek_configs/raw_client.py +++ b/src/square/labor/workweek_configs/raw_client.py @@ -1,20 +1,18 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.workweek_config import WorkweekConfigParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.update_workweek_config_response import UpdateWorkweekConfigResponse +from ...core.jsonable_encoder import jsonable_encoder from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.workweek_config import WorkweekConfigParams -from ...types.list_workweek_configs_response import ListWorkweekConfigsResponse -from ...types.update_workweek_config_response import UpdateWorkweekConfigResponse -from ...types.workweek_config import WorkweekConfig +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -24,64 +22,6 @@ class RawWorkweekConfigsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: - """ - Returns a list of `WorkweekConfig` instances for a business. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of `WorkweekConfigs` results to return per page. - - cursor : typing.Optional[str] - A pointer to the next page of `WorkweekConfig` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[WorkweekConfig, ListWorkweekConfigsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/labor/workweek-configs", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListWorkweekConfigsResponse, - construct_type( - type_=ListWorkweekConfigsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.workweek_configs - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, id: str, *, workweek_config: WorkweekConfigParams, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[UpdateWorkweekConfigResponse]: @@ -130,75 +70,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawWorkweekConfigsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: - """ - Returns a list of `WorkweekConfig` instances for a business. - - Parameters - ---------- - limit : typing.Optional[int] - The maximum number of `WorkweekConfigs` results to return per page. - - cursor : typing.Optional[str] - A pointer to the next page of `WorkweekConfig` results to fetch. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/labor/workweek-configs", - method="GET", - params={ - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListWorkweekConfigsResponse, - construct_type( - type_=ListWorkweekConfigsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.workweek_configs - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, id: str, *, workweek_config: WorkweekConfigParams, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[UpdateWorkweekConfigResponse]: @@ -247,5 +126,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/locations/__init__.py b/src/square/locations/__init__.py index 8deb140c..d38cb42e 100644 --- a/src/square/locations/__init__.py +++ b/src/square/locations/__init__.py @@ -1,38 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import custom_attribute_definitions, custom_attributes, transactions -_dynamic_imports: typing.Dict[str, str] = { - "custom_attribute_definitions": ".custom_attribute_definitions", - "custom_attributes": ".custom_attributes", - "transactions": ".transactions", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import custom_attribute_definitions, custom_attributes, transactions __all__ = ["custom_attribute_definitions", "custom_attributes", "transactions"] diff --git a/src/square/locations/client.py b/src/square/locations/client.py index b97d01a8..ad76a36b 100644 --- a/src/square/locations/client.py +++ b/src/square/locations/client.py @@ -1,29 +1,27 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawLocationsClient +from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient +from .custom_attributes.client import CustomAttributesClient +from .transactions.client import TransactionsClient from ..core.request_options import RequestOptions -from ..requests.address import AddressParams -from ..requests.charge_request_additional_recipient import ChargeRequestAdditionalRecipientParams -from ..requests.create_order_request import CreateOrderRequestParams +from ..types.list_locations_response import ListLocationsResponse from ..requests.location import LocationParams -from ..types.create_checkout_response import CreateCheckoutResponse from ..types.create_location_response import CreateLocationResponse from ..types.get_location_response import GetLocationResponse -from ..types.list_locations_response import ListLocationsResponse from ..types.update_location_response import UpdateLocationResponse -from .raw_client import AsyncRawLocationsClient, RawLocationsClient - -if typing.TYPE_CHECKING: - from .custom_attribute_definitions.client import ( - AsyncCustomAttributeDefinitionsClient, - CustomAttributeDefinitionsClient, - ) - from .custom_attributes.client import AsyncCustomAttributesClient, CustomAttributesClient - from .transactions.client import AsyncTransactionsClient, TransactionsClient +from ..requests.create_order_request import CreateOrderRequestParams +from ..requests.address import AddressParams +from ..requests.charge_request_additional_recipient import ChargeRequestAdditionalRecipientParams +from ..types.create_checkout_response import CreateCheckoutResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawLocationsClient +from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient +from .custom_attributes.client import AsyncCustomAttributesClient +from .transactions.client import AsyncTransactionsClient + # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -31,10 +29,11 @@ class LocationsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLocationsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[CustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[CustomAttributesClient] = None - self._transactions: typing.Optional[TransactionsClient] = None + self.custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = CustomAttributesClient(client_wrapper=client_wrapper) + + self.transactions = TransactionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLocationsClient: @@ -71,8 +70,8 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Li ) client.locations.list() """ - _response = self._raw_client.list(request_options=request_options) - return _response.data + response = self._raw_client.list(request_options=request_options) + return response.data def create( self, @@ -124,8 +123,8 @@ def create( }, ) """ - _response = self._raw_client.create(location=location, request_options=request_options) - return _response.data + response = self._raw_client.create(location=location, request_options=request_options) + return response.data def get(self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetLocationResponse: """ @@ -157,8 +156,8 @@ def get(self, location_id: str, *, request_options: typing.Optional[RequestOptio location_id="location_id", ) """ - _response = self._raw_client.get(location_id, request_options=request_options) - return _response.data + response = self._raw_client.get(location_id, request_options=request_options) + return response.data def update( self, @@ -219,8 +218,8 @@ def update( }, ) """ - _response = self._raw_client.update(location_id, location=location, request_options=request_options) - return _response.data + response = self._raw_client.update(location_id, location=location, request_options=request_options) + return response.data def checkouts( self, @@ -414,7 +413,7 @@ def checkouts( ], ) """ - _response = self._raw_client.checkouts( + response = self._raw_client.checkouts( location_id, idempotency_key=idempotency_key, order=order, @@ -427,40 +426,17 @@ def checkouts( note=note, request_options=request_options, ) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=self._client_wrapper) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import CustomAttributesClient # noqa: E402 - - self._custom_attributes = CustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes - - @property - def transactions(self): - if self._transactions is None: - from .transactions.client import TransactionsClient # noqa: E402 - - self._transactions = TransactionsClient(client_wrapper=self._client_wrapper) - return self._transactions + return response.data class AsyncLocationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLocationsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[AsyncCustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[AsyncCustomAttributesClient] = None - self._transactions: typing.Optional[AsyncTransactionsClient] = None + self.custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = AsyncCustomAttributesClient(client_wrapper=client_wrapper) + + self.transactions = AsyncTransactionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLocationsClient: @@ -505,8 +481,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list(request_options=request_options) - return _response.data + response = await self._raw_client.list(request_options=request_options) + return response.data async def create( self, @@ -566,8 +542,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create(location=location, request_options=request_options) - return _response.data + response = await self._raw_client.create(location=location, request_options=request_options) + return response.data async def get( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -609,8 +585,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(location_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(location_id, request_options=request_options) + return response.data async def update( self, @@ -679,8 +655,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update(location_id, location=location, request_options=request_options) - return _response.data + response = await self._raw_client.update(location_id, location=location, request_options=request_options) + return response.data async def checkouts( self, @@ -884,7 +860,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.checkouts( + response = await self._raw_client.checkouts( location_id, idempotency_key=idempotency_key, order=order, @@ -897,30 +873,4 @@ async def main() -> None: note=note, request_options=request_options, ) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient( - client_wrapper=self._client_wrapper - ) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import AsyncCustomAttributesClient # noqa: E402 - - self._custom_attributes = AsyncCustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes - - @property - def transactions(self): - if self._transactions is None: - from .transactions.client import AsyncTransactionsClient # noqa: E402 - - self._transactions = AsyncTransactionsClient(client_wrapper=self._client_wrapper) - return self._transactions + return response.data diff --git a/src/square/locations/custom_attribute_definitions/__init__.py b/src/square/locations/custom_attribute_definitions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/locations/custom_attribute_definitions/__init__.py +++ b/src/square/locations/custom_attribute_definitions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/locations/custom_attribute_definitions/client.py b/src/square/locations/custom_attribute_definitions/client.py index 7233ff94..97497188 100644 --- a/src/square/locations/custom_attribute_definitions/client.py +++ b/src/square/locations/custom_attribute_definitions/client.py @@ -1,27 +1,32 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributeDefinitionsClient +from ...types.visibility_filter import VisibilityFilter from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager +from ...types.custom_attribute_definition import CustomAttributeDefinition +from ...types.list_location_custom_attribute_definitions_response import ListLocationCustomAttributeDefinitionsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams from ...types.create_location_custom_attribute_definition_response import ( CreateLocationCustomAttributeDefinitionResponse, ) -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_location_custom_attribute_definition_response import ( - DeleteLocationCustomAttributeDefinitionResponse, -) -from ...types.list_location_custom_attribute_definitions_response import ListLocationCustomAttributeDefinitionsResponse from ...types.retrieve_location_custom_attribute_definition_response import ( RetrieveLocationCustomAttributeDefinitionResponse, ) from ...types.update_location_custom_attribute_definition_response import ( UpdateLocationCustomAttributeDefinitionResponse, ) -from ...types.visibility_filter import VisibilityFilter -from .raw_client import AsyncRawCustomAttributeDefinitionsClient, RawCustomAttributeDefinitionsClient +from ...types.delete_location_custom_attribute_definition_response import ( + DeleteLocationCustomAttributeDefinitionResponse, +) +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributeDefinitionsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -49,7 +54,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: + ) -> SyncPager[CustomAttributeDefinition]: """ Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -76,7 +81,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] + SyncPager[CustomAttributeDefinition] Success Examples @@ -97,9 +102,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - visibility_filter=visibility_filter, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/locations/custom-attribute-definitions", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLocationCustomAttributeDefinitionsResponse, + construct_type( + type_=ListLocationCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -157,12 +192,12 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -204,8 +239,8 @@ def get( version=1, ) """ - _response = self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = self._raw_client.get(key, version=version, request_options=request_options) + return response.data def update( self, @@ -269,13 +304,13 @@ def update( }, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -310,8 +345,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(key, request_options=request_options) - return _response.data + response = self._raw_client.delete(key, request_options=request_options) + return response.data class AsyncCustomAttributeDefinitionsClient: @@ -336,7 +371,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: + ) -> AsyncPager[CustomAttributeDefinition]: """ Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -363,7 +398,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] + AsyncPager[CustomAttributeDefinition] Success Examples @@ -385,7 +420,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -393,9 +427,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - visibility_filter=visibility_filter, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/locations/custom-attribute-definitions", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLocationCustomAttributeDefinitionsResponse, + construct_type( + type_=ListLocationCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -461,12 +525,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -516,8 +580,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.get(key, version=version, request_options=request_options) + return response.data async def update( self, @@ -589,13 +653,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -638,5 +702,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(key, request_options=request_options) + return response.data diff --git a/src/square/locations/custom_attribute_definitions/raw_client.py b/src/square/locations/custom_attribute_definitions/raw_client.py index 7af097a2..82590275 100644 --- a/src/square/locations/custom_attribute_definitions/raw_client.py +++ b/src/square/locations/custom_attribute_definitions/raw_client.py @@ -1,32 +1,29 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type +from ...core.client_wrapper import SyncClientWrapper from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse from ...types.create_location_custom_attribute_definition_response import ( CreateLocationCustomAttributeDefinitionResponse, ) -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_location_custom_attribute_definition_response import ( - DeleteLocationCustomAttributeDefinitionResponse, -) -from ...types.list_location_custom_attribute_definitions_response import ListLocationCustomAttributeDefinitionsResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_location_custom_attribute_definition_response import ( RetrieveLocationCustomAttributeDefinitionResponse, ) +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_location_custom_attribute_definition_response import ( UpdateLocationCustomAttributeDefinitionResponse, ) -from ...types.visibility_filter import VisibilityFilter +from ...types.delete_location_custom_attribute_definition_response import ( + DeleteLocationCustomAttributeDefinitionResponse, +) +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -36,77 +33,6 @@ class RawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: - """ - Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/locations/custom-attribute-definitions", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLocationCustomAttributeDefinitionsResponse, - construct_type( - type_=ListLocationCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -171,8 +97,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -222,8 +148,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -299,8 +225,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -341,88 +267,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: - """ - Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/locations/custom-attribute-definitions", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLocationCustomAttributeDefinitionsResponse, - construct_type( - type_=ListLocationCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -487,8 +339,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -538,8 +390,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -615,8 +467,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -657,5 +509,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/locations/custom_attributes/__init__.py b/src/square/locations/custom_attributes/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/locations/custom_attributes/__init__.py +++ b/src/square/locations/custom_attributes/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/locations/custom_attributes/client.py b/src/square/locations/custom_attributes/client.py index 1ec6dfcb..0ddae68c 100644 --- a/src/square/locations/custom_attributes/client.py +++ b/src/square/locations/custom_attributes/client.py @@ -1,26 +1,32 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributesClient from ...requests.bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request import ( BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestParams, ) +from ...core.request_options import RequestOptions +from ...types.bulk_delete_location_custom_attributes_response import BulkDeleteLocationCustomAttributesResponse from ...requests.bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request import ( BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestParams, ) -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_location_custom_attributes_response import BulkDeleteLocationCustomAttributesResponse from ...types.bulk_upsert_location_custom_attributes_response import BulkUpsertLocationCustomAttributesResponse +from ...types.visibility_filter import VisibilityFilter +from ...core.pagination import SyncPager from ...types.custom_attribute import CustomAttribute -from ...types.delete_location_custom_attribute_response import DeleteLocationCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_location_custom_attributes_response import ListLocationCustomAttributesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_location_custom_attribute_response import RetrieveLocationCustomAttributeResponse +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_location_custom_attribute_response import UpsertLocationCustomAttributeResponse -from ...types.visibility_filter import VisibilityFilter -from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient +from ...types.delete_location_custom_attribute_response import DeleteLocationCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -81,8 +87,8 @@ def batch_delete( }, ) """ - _response = self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data def batch_upsert( self, @@ -147,8 +153,8 @@ def batch_upsert( }, ) """ - _response = self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data def list( self, @@ -159,7 +165,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: + ) -> SyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a location. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -196,7 +202,7 @@ def list( Returns ------- - SyncPager[CustomAttribute, ListLocationCustomAttributesResponse] + SyncPager[CustomAttribute] Success Examples @@ -219,14 +225,42 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - location_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=cursor, - with_definitions=with_definitions, + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/locations/{jsonable_encoder(location_id)}/custom-attributes", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLocationCustomAttributesResponse, + construct_type( + type_=ListLocationCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id, + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -287,10 +321,10 @@ def get( version=1, ) """ - _response = self._raw_client.get( + response = self._raw_client.get( location_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data def upsert( self, @@ -352,14 +386,14 @@ def upsert( custom_attribute={"value": "hot cocoa"}, ) """ - _response = self._raw_client.upsert( + response = self._raw_client.upsert( location_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, location_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -399,8 +433,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(location_id, key, request_options=request_options) - return _response.data + response = self._raw_client.delete(location_id, key, request_options=request_options) + return response.data class AsyncCustomAttributesClient: @@ -466,8 +500,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data async def batch_upsert( self, @@ -540,8 +574,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data async def list( self, @@ -552,7 +586,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: + ) -> AsyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a location. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -589,7 +623,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse] + AsyncPager[CustomAttribute] Success Examples @@ -613,7 +647,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -621,14 +654,42 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - location_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=cursor, - with_definitions=with_definitions, + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/locations/{jsonable_encoder(location_id)}/custom-attributes", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLocationCustomAttributesResponse, + construct_type( + type_=ListLocationCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id, + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -697,10 +758,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get( + response = await self._raw_client.get( location_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data async def upsert( self, @@ -770,14 +831,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.upsert( + response = await self._raw_client.upsert( location_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, location_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -825,5 +886,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(location_id, key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(location_id, key, request_options=request_options) + return response.data diff --git a/src/square/locations/custom_attributes/raw_client.py b/src/square/locations/custom_attributes/raw_client.py index 4476e8db..caeb62ee 100644 --- a/src/square/locations/custom_attributes/raw_client.py +++ b/src/square/locations/custom_attributes/raw_client.py @@ -1,31 +1,28 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type +from ...core.client_wrapper import SyncClientWrapper from ...requests.bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request import ( BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestParams, ) +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.bulk_delete_location_custom_attributes_response import BulkDeleteLocationCustomAttributesResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request import ( BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestParams, ) -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_location_custom_attributes_response import BulkDeleteLocationCustomAttributesResponse from ...types.bulk_upsert_location_custom_attributes_response import BulkUpsertLocationCustomAttributesResponse -from ...types.custom_attribute import CustomAttribute -from ...types.delete_location_custom_attribute_response import DeleteLocationCustomAttributeResponse -from ...types.list_location_custom_attributes_response import ListLocationCustomAttributesResponse from ...types.retrieve_location_custom_attribute_response import RetrieveLocationCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_location_custom_attribute_response import UpsertLocationCustomAttributeResponse -from ...types.visibility_filter import VisibilityFilter +from ...types.delete_location_custom_attribute_response import DeleteLocationCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -90,8 +87,8 @@ def batch_delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_upsert( self, @@ -156,94 +153,8 @@ def batch_upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list( - self, - location_id: str, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with a location. - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - location_id : str - The ID of the target [location](entity:Location). - - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttribute, ListLocationCustomAttributesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/locations/{jsonable_encoder(location_id)}/custom-attributes", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLocationCustomAttributesResponse, - construct_type( - type_=ListLocationCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - location_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -311,8 +222,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def upsert( self, @@ -388,8 +299,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, location_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -434,8 +345,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributesClient: @@ -497,8 +408,8 @@ async def batch_delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_upsert( self, @@ -563,97 +474,8 @@ async def batch_upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list( - self, - location_id: str, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with a location. - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - location_id : str - The ID of the target [location](entity:Location). - - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/locations/{jsonable_encoder(location_id)}/custom-attributes", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLocationCustomAttributesResponse, - construct_type( - type_=ListLocationCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - location_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -721,8 +543,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def upsert( self, @@ -798,8 +620,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, location_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -844,5 +666,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/locations/raw_client.py b/src/square/locations/raw_client.py index d2488275..5ea3dc6c 100644 --- a/src/square/locations/raw_client.py +++ b/src/square/locations/raw_client.py @@ -1,24 +1,25 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.http_response import HttpResponse +from ..types.list_locations_response import ListLocationsResponse from ..core.unchecked_base_model import construct_type -from ..requests.address import AddressParams -from ..requests.charge_request_additional_recipient import ChargeRequestAdditionalRecipientParams -from ..requests.create_order_request import CreateOrderRequestParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.location import LocationParams -from ..types.create_checkout_response import CreateCheckoutResponse from ..types.create_location_response import CreateLocationResponse +from ..core.serialization import convert_and_respect_annotation_metadata from ..types.get_location_response import GetLocationResponse -from ..types.list_locations_response import ListLocationsResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.update_location_response import UpdateLocationResponse +from ..requests.create_order_request import CreateOrderRequestParams +from ..requests.address import AddressParams +from ..requests.charge_request_additional_recipient import ChargeRequestAdditionalRecipientParams +from ..types.create_checkout_response import CreateCheckoutResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -60,8 +61,8 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Ht return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -119,8 +120,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -160,8 +161,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -215,8 +216,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def checkouts( self, @@ -370,8 +371,8 @@ def checkouts( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawLocationsClient: @@ -412,8 +413,8 @@ async def list( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -471,8 +472,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, location_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -512,8 +513,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -567,8 +568,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def checkouts( self, @@ -722,5 +723,5 @@ async def checkouts( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/locations/transactions/__init__.py b/src/square/locations/transactions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/locations/transactions/__init__.py +++ b/src/square/locations/transactions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/locations/transactions/client.py b/src/square/locations/transactions/client.py index 2777b102..7404d82e 100644 --- a/src/square/locations/transactions/client.py +++ b/src/square/locations/transactions/client.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawTransactionsClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...types.sort_order import SortOrder from ...core.request_options import RequestOptions -from ...types.capture_transaction_response import CaptureTransactionResponse -from ...types.get_transaction_response import GetTransactionResponse from ...types.list_transactions_response import ListTransactionsResponse -from ...types.sort_order import SortOrder +from ...types.get_transaction_response import GetTransactionResponse +from ...types.capture_transaction_response import CaptureTransactionResponse from ...types.void_transaction_response import VoidTransactionResponse -from .raw_client import AsyncRawTransactionsClient, RawTransactionsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawTransactionsClient class TransactionsClient: @@ -99,7 +100,7 @@ def list( cursor="cursor", ) """ - _response = self._raw_client.list( + response = self._raw_client.list( location_id, begin_time=begin_time, end_time=end_time, @@ -107,7 +108,7 @@ def list( cursor=cursor, request_options=request_options, ) - return _response.data + return response.data def get( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -143,8 +144,8 @@ def get( transaction_id="transaction_id", ) """ - _response = self._raw_client.get(location_id, transaction_id, request_options=request_options) - return _response.data + response = self._raw_client.get(location_id, transaction_id, request_options=request_options) + return response.data def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -185,8 +186,8 @@ def capture( transaction_id="transaction_id", ) """ - _response = self._raw_client.capture(location_id, transaction_id, request_options=request_options) - return _response.data + response = self._raw_client.capture(location_id, transaction_id, request_options=request_options) + return response.data def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -227,8 +228,8 @@ def void( transaction_id="transaction_id", ) """ - _response = self._raw_client.void(location_id, transaction_id, request_options=request_options) - return _response.data + response = self._raw_client.void(location_id, transaction_id, request_options=request_options) + return response.data class AsyncTransactionsClient: @@ -326,7 +327,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list( + response = await self._raw_client.list( location_id, begin_time=begin_time, end_time=end_time, @@ -334,7 +335,7 @@ async def main() -> None: cursor=cursor, request_options=request_options, ) - return _response.data + return response.data async def get( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -378,8 +379,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(location_id, transaction_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(location_id, transaction_id, request_options=request_options) + return response.data async def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -428,8 +429,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.capture(location_id, transaction_id, request_options=request_options) - return _response.data + response = await self._raw_client.capture(location_id, transaction_id, request_options=request_options) + return response.data async def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -478,5 +479,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.void(location_id, transaction_id, request_options=request_options) - return _response.data + response = await self._raw_client.void(location_id, transaction_id, request_options=request_options) + return response.data diff --git a/src/square/locations/transactions/raw_client.py b/src/square/locations/transactions/raw_client.py index 3a0563b0..4ca8615a 100644 --- a/src/square/locations/transactions/raw_client.py +++ b/src/square/locations/transactions/raw_client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...types.sort_order import SortOrder from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.list_transactions_response import ListTransactionsResponse +from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type -from ...types.capture_transaction_response import CaptureTransactionResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_transaction_response import GetTransactionResponse -from ...types.list_transactions_response import ListTransactionsResponse -from ...types.sort_order import SortOrder +from ...types.capture_transaction_response import CaptureTransactionResponse from ...types.void_transaction_response import VoidTransactionResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawTransactionsClient: @@ -100,8 +101,8 @@ def list( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -142,8 +143,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -189,8 +190,8 @@ def capture( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -236,8 +237,8 @@ def void( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawTransactionsClient: @@ -324,8 +325,8 @@ async def list( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -366,8 +367,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -413,8 +414,8 @@ async def capture( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -460,5 +461,5 @@ async def void( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/loyalty/__init__.py b/src/square/loyalty/__init__.py index e68adcb7..81d53d39 100644 --- a/src/square/loyalty/__init__.py +++ b/src/square/loyalty/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import accounts, programs, rewards -_dynamic_imports: typing.Dict[str, str] = {"accounts": ".accounts", "programs": ".programs", "rewards": ".rewards"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import accounts, programs, rewards __all__ = ["accounts", "programs", "rewards"] diff --git a/src/square/loyalty/accounts/__init__.py b/src/square/loyalty/accounts/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/loyalty/accounts/__init__.py +++ b/src/square/loyalty/accounts/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/loyalty/accounts/client.py b/src/square/loyalty/accounts/client.py index e0c6a3fa..b0952702 100644 --- a/src/square/loyalty/accounts/client.py +++ b/src/square/loyalty/accounts/client.py @@ -1,21 +1,22 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawAccountsClient from ...requests.loyalty_account import LoyaltyAccountParams -from ...requests.loyalty_event_accumulate_points import LoyaltyEventAccumulatePointsParams -from ...requests.loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams +from ...core.request_options import RequestOptions +from ...types.create_loyalty_account_response import CreateLoyaltyAccountResponse from ...requests.search_loyalty_accounts_request_loyalty_account_query import ( SearchLoyaltyAccountsRequestLoyaltyAccountQueryParams, ) +from ...types.search_loyalty_accounts_response import SearchLoyaltyAccountsResponse +from ...types.get_loyalty_account_response import GetLoyaltyAccountResponse +from ...requests.loyalty_event_accumulate_points import LoyaltyEventAccumulatePointsParams from ...types.accumulate_loyalty_points_response import AccumulateLoyaltyPointsResponse +from ...requests.loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams from ...types.adjust_loyalty_points_response import AdjustLoyaltyPointsResponse -from ...types.create_loyalty_account_response import CreateLoyaltyAccountResponse -from ...types.get_loyalty_account_response import GetLoyaltyAccountResponse -from ...types.search_loyalty_accounts_response import SearchLoyaltyAccountsResponse -from .raw_client import AsyncRawAccountsClient, RawAccountsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawAccountsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -78,10 +79,10 @@ def create( idempotency_key="ec78c477-b1c3-4899-a209-a4e71337c996", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( loyalty_account=loyalty_account, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -134,8 +135,8 @@ def search( limit=10, ) """ - _response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) + return response.data def get( self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -167,8 +168,8 @@ def get( account_id="account_id", ) """ - _response = self._raw_client.get(account_id, request_options=request_options) - return _response.data + response = self._raw_client.get(account_id, request_options=request_options) + return response.data def accumulate_points( self, @@ -234,14 +235,14 @@ def accumulate_points( location_id="P034NEENMD09F", ) """ - _response = self._raw_client.accumulate_points( + response = self._raw_client.accumulate_points( account_id, accumulate_points=accumulate_points, idempotency_key=idempotency_key, location_id=location_id, request_options=request_options, ) - return _response.data + return response.data def adjust( self, @@ -298,14 +299,14 @@ def adjust( adjust_points={"points": 10, "reason": "Complimentary points"}, ) """ - _response = self._raw_client.adjust( + response = self._raw_client.adjust( account_id, idempotency_key=idempotency_key, adjust_points=adjust_points, allow_negative_balance=allow_negative_balance, request_options=request_options, ) - return _response.data + return response.data class AsyncAccountsClient: @@ -373,10 +374,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( loyalty_account=loyalty_account, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -437,10 +438,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def get( self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -480,8 +481,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(account_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(account_id, request_options=request_options) + return response.data async def accumulate_points( self, @@ -555,14 +556,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.accumulate_points( + response = await self._raw_client.accumulate_points( account_id, accumulate_points=accumulate_points, idempotency_key=idempotency_key, location_id=location_id, request_options=request_options, ) - return _response.data + return response.data async def adjust( self, @@ -627,11 +628,11 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.adjust( + response = await self._raw_client.adjust( account_id, idempotency_key=idempotency_key, adjust_points=adjust_points, allow_negative_balance=allow_negative_balance, request_options=request_options, ) - return _response.data + return response.data diff --git a/src/square/loyalty/accounts/raw_client.py b/src/square/loyalty/accounts/raw_client.py index 5e20b466..c1717cd8 100644 --- a/src/square/loyalty/accounts/raw_client.py +++ b/src/square/loyalty/accounts/raw_client.py @@ -1,26 +1,27 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.loyalty_account import LoyaltyAccountParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_loyalty_account_response import CreateLoyaltyAccountResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.loyalty_account import LoyaltyAccountParams -from ...requests.loyalty_event_accumulate_points import LoyaltyEventAccumulatePointsParams -from ...requests.loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.search_loyalty_accounts_request_loyalty_account_query import ( SearchLoyaltyAccountsRequestLoyaltyAccountQueryParams, ) +from ...types.search_loyalty_accounts_response import SearchLoyaltyAccountsResponse +from ...types.get_loyalty_account_response import GetLoyaltyAccountResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...requests.loyalty_event_accumulate_points import LoyaltyEventAccumulatePointsParams from ...types.accumulate_loyalty_points_response import AccumulateLoyaltyPointsResponse +from ...requests.loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams from ...types.adjust_loyalty_points_response import AdjustLoyaltyPointsResponse -from ...types.create_loyalty_account_response import CreateLoyaltyAccountResponse -from ...types.get_loyalty_account_response import GetLoyaltyAccountResponse -from ...types.search_loyalty_accounts_response import SearchLoyaltyAccountsResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -84,8 +85,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -154,8 +155,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -193,8 +194,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def accumulate_points( self, @@ -274,8 +275,8 @@ def accumulate_points( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def adjust( self, @@ -347,8 +348,8 @@ def adjust( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawAccountsClient: @@ -409,8 +410,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -479,8 +480,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, account_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -518,8 +519,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def accumulate_points( self, @@ -599,8 +600,8 @@ async def accumulate_points( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def adjust( self, @@ -672,5 +673,5 @@ async def adjust( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/loyalty/client.py b/src/square/loyalty/client.py index 972ba866..f811820c 100644 --- a/src/square/loyalty/client.py +++ b/src/square/loyalty/client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawLoyaltyClient +from .accounts.client import AccountsClient +from .programs.client import ProgramsClient +from .rewards.client import RewardsClient from ..requests.loyalty_event_query import LoyaltyEventQueryParams +from ..core.request_options import RequestOptions from ..types.search_loyalty_events_response import SearchLoyaltyEventsResponse -from .raw_client import AsyncRawLoyaltyClient, RawLoyaltyClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawLoyaltyClient +from .accounts.client import AsyncAccountsClient +from .programs.client import AsyncProgramsClient +from .rewards.client import AsyncRewardsClient -if typing.TYPE_CHECKING: - from .accounts.client import AccountsClient, AsyncAccountsClient - from .programs.client import AsyncProgramsClient, ProgramsClient - from .rewards.client import AsyncRewardsClient, RewardsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -21,10 +22,11 @@ class LoyaltyClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawLoyaltyClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._accounts: typing.Optional[AccountsClient] = None - self._programs: typing.Optional[ProgramsClient] = None - self._rewards: typing.Optional[RewardsClient] = None + self.accounts = AccountsClient(client_wrapper=client_wrapper) + + self.programs = ProgramsClient(client_wrapper=client_wrapper) + + self.rewards = RewardsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawLoyaltyClient: @@ -97,43 +99,20 @@ def search_events( limit=30, ) """ - _response = self._raw_client.search_events( + response = self._raw_client.search_events( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data - - @property - def accounts(self): - if self._accounts is None: - from .accounts.client import AccountsClient # noqa: E402 - - self._accounts = AccountsClient(client_wrapper=self._client_wrapper) - return self._accounts - - @property - def programs(self): - if self._programs is None: - from .programs.client import ProgramsClient # noqa: E402 - - self._programs = ProgramsClient(client_wrapper=self._client_wrapper) - return self._programs - - @property - def rewards(self): - if self._rewards is None: - from .rewards.client import RewardsClient # noqa: E402 - - self._rewards = RewardsClient(client_wrapper=self._client_wrapper) - return self._rewards + return response.data class AsyncLoyaltyClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawLoyaltyClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._accounts: typing.Optional[AsyncAccountsClient] = None - self._programs: typing.Optional[AsyncProgramsClient] = None - self._rewards: typing.Optional[AsyncRewardsClient] = None + self.accounts = AsyncAccountsClient(client_wrapper=client_wrapper) + + self.programs = AsyncProgramsClient(client_wrapper=client_wrapper) + + self.rewards = AsyncRewardsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawLoyaltyClient: @@ -214,31 +193,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search_events( + response = await self._raw_client.search_events( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data - - @property - def accounts(self): - if self._accounts is None: - from .accounts.client import AsyncAccountsClient # noqa: E402 - - self._accounts = AsyncAccountsClient(client_wrapper=self._client_wrapper) - return self._accounts - - @property - def programs(self): - if self._programs is None: - from .programs.client import AsyncProgramsClient # noqa: E402 - - self._programs = AsyncProgramsClient(client_wrapper=self._client_wrapper) - return self._programs - - @property - def rewards(self): - if self._rewards is None: - from .rewards.client import AsyncRewardsClient # noqa: E402 - - self._rewards = AsyncRewardsClient(client_wrapper=self._client_wrapper) - return self._rewards + return response.data diff --git a/src/square/loyalty/programs/__init__.py b/src/square/loyalty/programs/__init__.py index 4d547aec..86e70d3e 100644 --- a/src/square/loyalty/programs/__init__.py +++ b/src/square/loyalty/programs/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import promotions -_dynamic_imports: typing.Dict[str, str] = {"promotions": ".promotions"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import promotions __all__ = ["promotions"] diff --git a/src/square/loyalty/programs/client.py b/src/square/loyalty/programs/client.py index f438bc15..fc4010d5 100644 --- a/src/square/loyalty/programs/client.py +++ b/src/square/loyalty/programs/client.py @@ -1,19 +1,18 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawProgramsClient +from .promotions.client import PromotionsClient from ...core.request_options import RequestOptions +from ...types.list_loyalty_programs_response import ListLoyaltyProgramsResponse +from ...types.get_loyalty_program_response import GetLoyaltyProgramResponse from ...requests.money import MoneyParams from ...types.calculate_loyalty_points_response import CalculateLoyaltyPointsResponse -from ...types.get_loyalty_program_response import GetLoyaltyProgramResponse -from ...types.list_loyalty_programs_response import ListLoyaltyProgramsResponse -from .raw_client import AsyncRawProgramsClient, RawProgramsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawProgramsClient +from .promotions.client import AsyncPromotionsClient -if typing.TYPE_CHECKING: - from .promotions.client import AsyncPromotionsClient, PromotionsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -21,8 +20,7 @@ class ProgramsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawProgramsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._promotions: typing.Optional[PromotionsClient] = None + self.promotions = PromotionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawProgramsClient: @@ -62,8 +60,8 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Li ) client.loyalty.programs.list() """ - _response = self._raw_client.list(request_options=request_options) - return _response.data + response = self._raw_client.list(request_options=request_options) + return response.data def get( self, program_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -97,8 +95,8 @@ def get( program_id="program_id", ) """ - _response = self._raw_client.get(program_id, request_options=request_options) - return _response.data + response = self._raw_client.get(program_id, request_options=request_options) + return response.data def calculate( self, @@ -172,29 +170,20 @@ def calculate( loyalty_account_id="79b807d2-d786-46a9-933b-918028d7a8c5", ) """ - _response = self._raw_client.calculate( + response = self._raw_client.calculate( program_id, order_id=order_id, transaction_amount_money=transaction_amount_money, loyalty_account_id=loyalty_account_id, request_options=request_options, ) - return _response.data - - @property - def promotions(self): - if self._promotions is None: - from .promotions.client import PromotionsClient # noqa: E402 - - self._promotions = PromotionsClient(client_wrapper=self._client_wrapper) - return self._promotions + return response.data class AsyncProgramsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawProgramsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._promotions: typing.Optional[AsyncPromotionsClient] = None + self.promotions = AsyncPromotionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawProgramsClient: @@ -242,8 +231,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list(request_options=request_options) - return _response.data + response = await self._raw_client.list(request_options=request_options) + return response.data async def get( self, program_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -285,8 +274,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(program_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(program_id, request_options=request_options) + return response.data async def calculate( self, @@ -368,19 +357,11 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.calculate( + response = await self._raw_client.calculate( program_id, order_id=order_id, transaction_amount_money=transaction_amount_money, loyalty_account_id=loyalty_account_id, request_options=request_options, ) - return _response.data - - @property - def promotions(self): - if self._promotions is None: - from .promotions.client import AsyncPromotionsClient # noqa: E402 - - self._promotions = AsyncPromotionsClient(client_wrapper=self._client_wrapper) - return self._promotions + return response.data diff --git a/src/square/loyalty/programs/promotions/__init__.py b/src/square/loyalty/programs/promotions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/loyalty/programs/promotions/__init__.py +++ b/src/square/loyalty/programs/promotions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/loyalty/programs/promotions/client.py b/src/square/loyalty/programs/promotions/client.py index 3030ab2a..328e21c7 100644 --- a/src/square/loyalty/programs/promotions/client.py +++ b/src/square/loyalty/programs/promotions/client.py @@ -1,18 +1,24 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ....core.pagination import AsyncPager, SyncPager +from ....core.client_wrapper import SyncClientWrapper +from .raw_client import RawPromotionsClient +from ....types.loyalty_promotion_status import LoyaltyPromotionStatus from ....core.request_options import RequestOptions +from ....core.pagination import SyncPager +from ....types.loyalty_promotion import LoyaltyPromotion +from ....core.jsonable_encoder import jsonable_encoder +from ....types.list_loyalty_promotions_response import ListLoyaltyPromotionsResponse +from ....core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ....core.api_error import ApiError from ....requests.loyalty_promotion import LoyaltyPromotionParams -from ....types.cancel_loyalty_promotion_response import CancelLoyaltyPromotionResponse from ....types.create_loyalty_promotion_response import CreateLoyaltyPromotionResponse from ....types.get_loyalty_promotion_response import GetLoyaltyPromotionResponse -from ....types.list_loyalty_promotions_response import ListLoyaltyPromotionsResponse -from ....types.loyalty_promotion import LoyaltyPromotion -from ....types.loyalty_promotion_status import LoyaltyPromotionStatus -from .raw_client import AsyncRawPromotionsClient, RawPromotionsClient +from ....types.cancel_loyalty_promotion_response import CancelLoyaltyPromotionResponse +from ....core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawPromotionsClient +from ....core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -41,7 +47,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: + ) -> SyncPager[LoyaltyPromotion]: """ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). @@ -72,7 +78,7 @@ def list( Returns ------- - SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] + SyncPager[LoyaltyPromotion] Success Examples @@ -94,9 +100,40 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - program_id, status=status, cursor=cursor, limit=limit, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/loyalty/programs/{jsonable_encoder(program_id)}/promotions", + method="GET", + params={ + "status": status, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLoyaltyPromotionsResponse, + construct_type( + type_=ListLoyaltyPromotionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + program_id, + status=status, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.loyalty_promotions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -163,13 +200,13 @@ def create( idempotency_key="ec78c477-b1c3-4899-a209-a4e71337c996", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( program_id, loyalty_promotion=loyalty_promotion, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def get( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -206,8 +243,8 @@ def get( promotion_id="promotion_id", ) """ - _response = self._raw_client.get(program_id, promotion_id, request_options=request_options) - return _response.data + response = self._raw_client.get(program_id, promotion_id, request_options=request_options) + return response.data def cancel( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -249,8 +286,8 @@ def cancel( promotion_id="promotion_id", ) """ - _response = self._raw_client.cancel(program_id, promotion_id, request_options=request_options) - return _response.data + response = self._raw_client.cancel(program_id, promotion_id, request_options=request_options) + return response.data class AsyncPromotionsClient: @@ -276,7 +313,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: + ) -> AsyncPager[LoyaltyPromotion]: """ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). @@ -307,7 +344,7 @@ async def list( Returns ------- - AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] + AsyncPager[LoyaltyPromotion] Success Examples @@ -330,7 +367,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -338,9 +374,40 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - program_id, status=status, cursor=cursor, limit=limit, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/loyalty/programs/{jsonable_encoder(program_id)}/promotions", + method="GET", + params={ + "status": status, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListLoyaltyPromotionsResponse, + construct_type( + type_=ListLoyaltyPromotionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + program_id, + status=status, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.loyalty_promotions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -415,13 +482,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( program_id, loyalty_promotion=loyalty_promotion, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def get( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -466,8 +533,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(program_id, promotion_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(program_id, promotion_id, request_options=request_options) + return response.data async def cancel( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -517,5 +584,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(program_id, promotion_id, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(program_id, promotion_id, request_options=request_options) + return response.data diff --git a/src/square/loyalty/programs/promotions/raw_client.py b/src/square/loyalty/programs/promotions/raw_client.py index 3e60a737..cd4bd89b 100644 --- a/src/square/loyalty/programs/promotions/raw_client.py +++ b/src/square/loyalty/programs/promotions/raw_client.py @@ -1,23 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ....core.api_error import ApiError -from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ....core.http_response import AsyncHttpResponse, HttpResponse -from ....core.jsonable_encoder import jsonable_encoder -from ....core.pagination import AsyncPager, SyncPager +from ....core.client_wrapper import SyncClientWrapper +from ....requests.loyalty_promotion import LoyaltyPromotionParams from ....core.request_options import RequestOptions +from ....core.http_response import HttpResponse +from ....types.create_loyalty_promotion_response import CreateLoyaltyPromotionResponse +from ....core.jsonable_encoder import jsonable_encoder from ....core.serialization import convert_and_respect_annotation_metadata from ....core.unchecked_base_model import construct_type -from ....requests.loyalty_promotion import LoyaltyPromotionParams -from ....types.cancel_loyalty_promotion_response import CancelLoyaltyPromotionResponse -from ....types.create_loyalty_promotion_response import CreateLoyaltyPromotionResponse +from json.decoder import JSONDecodeError +from ....core.api_error import ApiError from ....types.get_loyalty_promotion_response import GetLoyaltyPromotionResponse -from ....types.list_loyalty_promotions_response import ListLoyaltyPromotionsResponse -from ....types.loyalty_promotion import LoyaltyPromotion -from ....types.loyalty_promotion_status import LoyaltyPromotionStatus +from ....types.cancel_loyalty_promotion_response import CancelLoyaltyPromotionResponse +from ....core.client_wrapper import AsyncClientWrapper +from ....core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -27,83 +24,6 @@ class RawPromotionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - program_id: str, - *, - status: typing.Optional[LoyaltyPromotionStatus] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: - """ - Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). - Results are sorted by the `created_at` date in descending order (newest to oldest). - - Parameters - ---------- - program_id : str - The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID, - call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. - - status : typing.Optional[LoyaltyPromotionStatus] - The status to filter the results by. If a status is provided, only loyalty promotions - with the specified status are returned. Otherwise, all loyalty promotions associated with - the loyalty program are returned. - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. - The minimum value is 1 and the maximum value is 30. The default value is 30. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/loyalty/programs/{jsonable_encoder(program_id)}/promotions", - method="GET", - params={ - "status": status, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLoyaltyPromotionsResponse, - construct_type( - type_=ListLoyaltyPromotionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.loyalty_promotions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - program_id, - status=status, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, program_id: str, @@ -169,8 +89,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -212,8 +132,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -260,94 +180,14 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawPromotionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - program_id: str, - *, - status: typing.Optional[LoyaltyPromotionStatus] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: - """ - Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). - Results are sorted by the `created_at` date in descending order (newest to oldest). - - Parameters - ---------- - program_id : str - The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID, - call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. - - status : typing.Optional[LoyaltyPromotionStatus] - The status to filter the results by. If a status is provided, only loyalty promotions - with the specified status are returned. Otherwise, all loyalty promotions associated with - the loyalty program are returned. - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. - The minimum value is 1 and the maximum value is 30. The default value is 30. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/loyalty/programs/{jsonable_encoder(program_id)}/promotions", - method="GET", - params={ - "status": status, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListLoyaltyPromotionsResponse, - construct_type( - type_=ListLoyaltyPromotionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.loyalty_promotions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - program_id, - status=status, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, program_id: str, @@ -413,8 +253,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -456,8 +296,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, program_id: str, promotion_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -504,5 +344,5 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/loyalty/programs/raw_client.py b/src/square/loyalty/programs/raw_client.py index eb3d48e5..e6e99950 100644 --- a/src/square/loyalty/programs/raw_client.py +++ b/src/square/loyalty/programs/raw_client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing +from ...core.client_wrapper import SyncClientWrapper +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.list_loyalty_programs_response import ListLoyaltyProgramsResponse +from ...core.unchecked_base_model import construct_type from json.decoder import JSONDecodeError - from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse +from ...types.get_loyalty_program_response import GetLoyaltyProgramResponse from ...core.jsonable_encoder import jsonable_encoder -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type from ...requests.money import MoneyParams from ...types.calculate_loyalty_points_response import CalculateLoyaltyPointsResponse -from ...types.get_loyalty_program_response import GetLoyaltyProgramResponse -from ...types.list_loyalty_programs_response import ListLoyaltyProgramsResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -60,8 +61,8 @@ def list( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, program_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -101,8 +102,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def calculate( self, @@ -191,8 +192,8 @@ def calculate( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawProgramsClient: @@ -236,8 +237,8 @@ async def list( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, program_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -277,8 +278,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def calculate( self, @@ -367,5 +368,5 @@ async def calculate( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/loyalty/raw_client.py b/src/square/loyalty/raw_client.py index 7782050f..2fb9fde2 100644 --- a/src/square/loyalty/raw_client.py +++ b/src/square/loyalty/raw_client.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.client_wrapper import SyncClientWrapper +from ..requests.loyalty_event_query import LoyaltyEventQueryParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.search_loyalty_events_response import SearchLoyaltyEventsResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.loyalty_event_query import LoyaltyEventQueryParams -from ..types.search_loyalty_events_response import SearchLoyaltyEventsResponse +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -92,8 +93,8 @@ def search_events( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawLoyaltyClient: @@ -172,5 +173,5 @@ async def search_events( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/loyalty/rewards/__init__.py b/src/square/loyalty/rewards/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/loyalty/rewards/__init__.py +++ b/src/square/loyalty/rewards/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/loyalty/rewards/client.py b/src/square/loyalty/rewards/client.py index 4182121d..5c0449e4 100644 --- a/src/square/loyalty/rewards/client.py +++ b/src/square/loyalty/rewards/client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawRewardsClient from ...requests.loyalty_reward import LoyaltyRewardParams +from ...core.request_options import RequestOptions +from ...types.create_loyalty_reward_response import CreateLoyaltyRewardResponse from ...requests.search_loyalty_rewards_request_loyalty_reward_query import ( SearchLoyaltyRewardsRequestLoyaltyRewardQueryParams, ) -from ...types.create_loyalty_reward_response import CreateLoyaltyRewardResponse -from ...types.delete_loyalty_reward_response import DeleteLoyaltyRewardResponse +from ...types.search_loyalty_rewards_response import SearchLoyaltyRewardsResponse from ...types.get_loyalty_reward_response import GetLoyaltyRewardResponse +from ...types.delete_loyalty_reward_response import DeleteLoyaltyRewardResponse from ...types.redeem_loyalty_reward_response import RedeemLoyaltyRewardResponse -from ...types.search_loyalty_rewards_response import SearchLoyaltyRewardsResponse -from .raw_client import AsyncRawRewardsClient, RawRewardsClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawRewardsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -84,10 +85,10 @@ def create( idempotency_key="18c2e5ea-a620-4b1f-ad60-7b167285e451", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( reward=reward, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -142,8 +143,8 @@ def search( limit=10, ) """ - _response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) + return response.data def get( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -175,8 +176,8 @@ def get( reward_id="reward_id", ) """ - _response = self._raw_client.get(reward_id, request_options=request_options) - return _response.data + response = self._raw_client.get(reward_id, request_options=request_options) + return response.data def delete( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -216,8 +217,8 @@ def delete( reward_id="reward_id", ) """ - _response = self._raw_client.delete(reward_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(reward_id, request_options=request_options) + return response.data def redeem( self, @@ -273,10 +274,10 @@ def redeem( location_id="P034NEENMD09F", ) """ - _response = self._raw_client.redeem( + response = self._raw_client.redeem( reward_id, idempotency_key=idempotency_key, location_id=location_id, request_options=request_options ) - return _response.data + return response.data class AsyncRewardsClient: @@ -352,10 +353,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( reward=reward, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -418,10 +419,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def get( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -461,8 +462,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(reward_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(reward_id, request_options=request_options) + return response.data async def delete( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -510,8 +511,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(reward_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(reward_id, request_options=request_options) + return response.data async def redeem( self, @@ -575,7 +576,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.redeem( + response = await self._raw_client.redeem( reward_id, idempotency_key=idempotency_key, location_id=location_id, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/loyalty/rewards/raw_client.py b/src/square/loyalty/rewards/raw_client.py index d9d7f343..5d2fbca8 100644 --- a/src/square/loyalty/rewards/raw_client.py +++ b/src/square/loyalty/rewards/raw_client.py @@ -1,24 +1,25 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.loyalty_reward import LoyaltyRewardParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_loyalty_reward_response import CreateLoyaltyRewardResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.loyalty_reward import LoyaltyRewardParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.search_loyalty_rewards_request_loyalty_reward_query import ( SearchLoyaltyRewardsRequestLoyaltyRewardQueryParams, ) -from ...types.create_loyalty_reward_response import CreateLoyaltyRewardResponse -from ...types.delete_loyalty_reward_response import DeleteLoyaltyRewardResponse +from ...types.search_loyalty_rewards_response import SearchLoyaltyRewardsResponse from ...types.get_loyalty_reward_response import GetLoyaltyRewardResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...types.delete_loyalty_reward_response import DeleteLoyaltyRewardResponse from ...types.redeem_loyalty_reward_response import RedeemLoyaltyRewardResponse -from ...types.search_loyalty_rewards_response import SearchLoyaltyRewardsResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -89,8 +90,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -161,8 +162,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -200,8 +201,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -247,8 +248,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def redeem( self, @@ -316,8 +317,8 @@ def redeem( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawRewardsClient: @@ -385,8 +386,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -457,8 +458,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -496,8 +497,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, reward_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -543,8 +544,8 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def redeem( self, @@ -612,5 +613,5 @@ async def redeem( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/merchants/__init__.py b/src/square/merchants/__init__.py index 762ae6a5..cbf84df6 100644 --- a/src/square/merchants/__init__.py +++ b/src/square/merchants/__init__.py @@ -1,37 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import custom_attribute_definitions, custom_attributes -_dynamic_imports: typing.Dict[str, str] = { - "custom_attribute_definitions": ".custom_attribute_definitions", - "custom_attributes": ".custom_attributes", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import custom_attribute_definitions, custom_attributes __all__ = ["custom_attribute_definitions", "custom_attributes"] diff --git a/src/square/merchants/client.py b/src/square/merchants/client.py index 3288f1a1..43372f5c 100644 --- a/src/square/merchants/client.py +++ b/src/square/merchants/client.py @@ -1,31 +1,31 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawMerchantsClient +from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient +from .custom_attributes.client import CustomAttributesClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..types.get_merchant_response import GetMerchantResponse -from ..types.list_merchants_response import ListMerchantsResponse +from ..core.pagination import SyncPager from ..types.merchant import Merchant -from .raw_client import AsyncRawMerchantsClient, RawMerchantsClient - -if typing.TYPE_CHECKING: - from .custom_attribute_definitions.client import ( - AsyncCustomAttributeDefinitionsClient, - CustomAttributeDefinitionsClient, - ) - from .custom_attributes.client import AsyncCustomAttributesClient, CustomAttributesClient +from ..types.list_merchants_response import ListMerchantsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.get_merchant_response import GetMerchantResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawMerchantsClient +from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient +from .custom_attributes.client import AsyncCustomAttributesClient +from ..core.pagination import AsyncPager class MerchantsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawMerchantsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[CustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[CustomAttributesClient] = None + self.custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = CustomAttributesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawMerchantsClient: @@ -40,7 +40,7 @@ def with_raw_response(self) -> RawMerchantsClient: def list( self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> SyncPager[Merchant, ListMerchantsResponse]: + ) -> SyncPager[Merchant]: """ Provides details about the merchant associated with a given access token. @@ -63,7 +63,7 @@ def list( Returns ------- - SyncPager[Merchant, ListMerchantsResponse] + SyncPager[Merchant] Success Examples @@ -82,7 +82,35 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list(cursor=cursor, request_options=request_options) + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/merchants", + method="GET", + params={ + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListMerchantsResponse, + construct_type( + type_=ListMerchantsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.merchant + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, merchant_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetMerchantResponse: """ @@ -113,32 +141,16 @@ def get(self, merchant_id: str, *, request_options: typing.Optional[RequestOptio merchant_id="merchant_id", ) """ - _response = self._raw_client.get(merchant_id, request_options=request_options) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=self._client_wrapper) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import CustomAttributesClient # noqa: E402 - - self._custom_attributes = CustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes + response = self._raw_client.get(merchant_id, request_options=request_options) + return response.data class AsyncMerchantsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawMerchantsClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[AsyncCustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[AsyncCustomAttributesClient] = None + self.custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = AsyncCustomAttributesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawMerchantsClient: @@ -153,7 +165,7 @@ def with_raw_response(self) -> AsyncRawMerchantsClient: async def list( self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncPager[Merchant, ListMerchantsResponse]: + ) -> AsyncPager[Merchant]: """ Provides details about the merchant associated with a given access token. @@ -176,7 +188,7 @@ async def list( Returns ------- - AsyncPager[Merchant, ListMerchantsResponse] + AsyncPager[Merchant] Success Examples @@ -196,7 +208,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -204,7 +215,35 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list(cursor=cursor, request_options=request_options) + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/merchants", + method="GET", + params={ + "cursor": cursor, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListMerchantsResponse, + construct_type( + type_=ListMerchantsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.merchant + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, merchant_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -245,23 +284,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(merchant_id, request_options=request_options) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient( - client_wrapper=self._client_wrapper - ) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import AsyncCustomAttributesClient # noqa: E402 - - self._custom_attributes = AsyncCustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes + response = await self._raw_client.get(merchant_id, request_options=request_options) + return response.data diff --git a/src/square/merchants/custom_attribute_definitions/__init__.py b/src/square/merchants/custom_attribute_definitions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/merchants/custom_attribute_definitions/__init__.py +++ b/src/square/merchants/custom_attribute_definitions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/merchants/custom_attribute_definitions/client.py b/src/square/merchants/custom_attribute_definitions/client.py index d515b707..c4aca486 100644 --- a/src/square/merchants/custom_attribute_definitions/client.py +++ b/src/square/merchants/custom_attribute_definitions/client.py @@ -1,27 +1,32 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributeDefinitionsClient +from ...types.visibility_filter import VisibilityFilter from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager +from ...types.custom_attribute_definition import CustomAttributeDefinition +from ...types.list_merchant_custom_attribute_definitions_response import ListMerchantCustomAttributeDefinitionsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams from ...types.create_merchant_custom_attribute_definition_response import ( CreateMerchantCustomAttributeDefinitionResponse, ) -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_merchant_custom_attribute_definition_response import ( - DeleteMerchantCustomAttributeDefinitionResponse, -) -from ...types.list_merchant_custom_attribute_definitions_response import ListMerchantCustomAttributeDefinitionsResponse from ...types.retrieve_merchant_custom_attribute_definition_response import ( RetrieveMerchantCustomAttributeDefinitionResponse, ) from ...types.update_merchant_custom_attribute_definition_response import ( UpdateMerchantCustomAttributeDefinitionResponse, ) -from ...types.visibility_filter import VisibilityFilter -from .raw_client import AsyncRawCustomAttributeDefinitionsClient, RawCustomAttributeDefinitionsClient +from ...types.delete_merchant_custom_attribute_definition_response import ( + DeleteMerchantCustomAttributeDefinitionResponse, +) +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributeDefinitionsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -49,7 +54,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: + ) -> SyncPager[CustomAttributeDefinition]: """ Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -76,7 +81,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] + SyncPager[CustomAttributeDefinition] Success Examples @@ -97,9 +102,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - visibility_filter=visibility_filter, limit=limit, cursor=cursor, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/merchants/custom-attribute-definitions", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListMerchantCustomAttributeDefinitionsResponse, + construct_type( + type_=ListMerchantCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -157,12 +192,12 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -204,8 +239,8 @@ def get( version=1, ) """ - _response = self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = self._raw_client.get(key, version=version, request_options=request_options) + return response.data def update( self, @@ -268,13 +303,13 @@ def update( }, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -309,8 +344,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(key, request_options=request_options) - return _response.data + response = self._raw_client.delete(key, request_options=request_options) + return response.data class AsyncCustomAttributeDefinitionsClient: @@ -335,7 +370,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: + ) -> AsyncPager[CustomAttributeDefinition]: """ Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -362,7 +397,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] + AsyncPager[CustomAttributeDefinition] Success Examples @@ -384,7 +419,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -392,9 +426,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - visibility_filter=visibility_filter, limit=limit, cursor=cursor, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/merchants/custom-attribute-definitions", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListMerchantCustomAttributeDefinitionsResponse, + construct_type( + type_=ListMerchantCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -460,12 +524,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -515,8 +579,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.get(key, version=version, request_options=request_options) + return response.data async def update( self, @@ -587,13 +651,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -636,5 +700,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(key, request_options=request_options) + return response.data diff --git a/src/square/merchants/custom_attribute_definitions/raw_client.py b/src/square/merchants/custom_attribute_definitions/raw_client.py index 776a97fd..6f1e08b3 100644 --- a/src/square/merchants/custom_attribute_definitions/raw_client.py +++ b/src/square/merchants/custom_attribute_definitions/raw_client.py @@ -1,32 +1,29 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type +from ...core.client_wrapper import SyncClientWrapper from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse from ...types.create_merchant_custom_attribute_definition_response import ( CreateMerchantCustomAttributeDefinitionResponse, ) -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_merchant_custom_attribute_definition_response import ( - DeleteMerchantCustomAttributeDefinitionResponse, -) -from ...types.list_merchant_custom_attribute_definitions_response import ListMerchantCustomAttributeDefinitionsResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_merchant_custom_attribute_definition_response import ( RetrieveMerchantCustomAttributeDefinitionResponse, ) +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_merchant_custom_attribute_definition_response import ( UpdateMerchantCustomAttributeDefinitionResponse, ) -from ...types.visibility_filter import VisibilityFilter +from ...types.delete_merchant_custom_attribute_definition_response import ( + DeleteMerchantCustomAttributeDefinitionResponse, +) +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -36,77 +33,6 @@ class RawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: - """ - Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/merchants/custom-attribute-definitions", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListMerchantCustomAttributeDefinitionsResponse, - construct_type( - type_=ListMerchantCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -171,8 +97,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -222,8 +148,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -298,8 +224,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -340,88 +266,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: - """ - Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/merchants/custom-attribute-definitions", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListMerchantCustomAttributeDefinitionsResponse, - construct_type( - type_=ListMerchantCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -486,8 +338,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -537,8 +389,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -613,8 +465,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -655,5 +507,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/merchants/custom_attributes/__init__.py b/src/square/merchants/custom_attributes/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/merchants/custom_attributes/__init__.py +++ b/src/square/merchants/custom_attributes/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/merchants/custom_attributes/client.py b/src/square/merchants/custom_attributes/client.py index 85788bd1..ff060b6f 100644 --- a/src/square/merchants/custom_attributes/client.py +++ b/src/square/merchants/custom_attributes/client.py @@ -1,26 +1,32 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributesClient from ...requests.bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request import ( BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestParams, ) +from ...core.request_options import RequestOptions +from ...types.bulk_delete_merchant_custom_attributes_response import BulkDeleteMerchantCustomAttributesResponse from ...requests.bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request import ( BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestParams, ) -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_merchant_custom_attributes_response import BulkDeleteMerchantCustomAttributesResponse from ...types.bulk_upsert_merchant_custom_attributes_response import BulkUpsertMerchantCustomAttributesResponse +from ...types.visibility_filter import VisibilityFilter +from ...core.pagination import SyncPager from ...types.custom_attribute import CustomAttribute -from ...types.delete_merchant_custom_attribute_response import DeleteMerchantCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_merchant_custom_attributes_response import ListMerchantCustomAttributesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_merchant_custom_attribute_response import RetrieveMerchantCustomAttributeResponse +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_merchant_custom_attribute_response import UpsertMerchantCustomAttributeResponse -from ...types.visibility_filter import VisibilityFilter -from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient +from ...types.delete_merchant_custom_attribute_response import DeleteMerchantCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -80,8 +86,8 @@ def batch_delete( }, ) """ - _response = self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data def batch_upsert( self, @@ -139,8 +145,8 @@ def batch_upsert( }, ) """ - _response = self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data def list( self, @@ -151,7 +157,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: + ) -> SyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -188,7 +194,7 @@ def list( Returns ------- - SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] + SyncPager[CustomAttribute] Success Examples @@ -211,14 +217,42 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - merchant_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=cursor, - with_definitions=with_definitions, + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/merchants/{jsonable_encoder(merchant_id)}/custom-attributes", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListMerchantCustomAttributesResponse, + construct_type( + type_=ListMerchantCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + merchant_id, + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -279,10 +313,10 @@ def get( version=1, ) """ - _response = self._raw_client.get( + response = self._raw_client.get( merchant_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data def upsert( self, @@ -344,14 +378,14 @@ def upsert( custom_attribute={"value": "Ultimate Sneaker Store"}, ) """ - _response = self._raw_client.upsert( + response = self._raw_client.upsert( merchant_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, merchant_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -391,8 +425,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(merchant_id, key, request_options=request_options) - return _response.data + response = self._raw_client.delete(merchant_id, key, request_options=request_options) + return response.data class AsyncCustomAttributesClient: @@ -457,8 +491,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data async def batch_upsert( self, @@ -524,8 +558,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data async def list( self, @@ -536,7 +570,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: + ) -> AsyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -573,7 +607,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] + AsyncPager[CustomAttribute] Success Examples @@ -597,7 +631,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -605,14 +638,42 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - merchant_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=cursor, - with_definitions=with_definitions, + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/merchants/{jsonable_encoder(merchant_id)}/custom-attributes", + method="GET", + params={ + "visibility_filter": visibility_filter, + "limit": limit, + "cursor": cursor, + "with_definitions": with_definitions, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListMerchantCustomAttributesResponse, + construct_type( + type_=ListMerchantCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + merchant_id, + visibility_filter=visibility_filter, + limit=limit, + cursor=_parsed_next, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -681,10 +742,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get( + response = await self._raw_client.get( merchant_id, key, with_definition=with_definition, version=version, request_options=request_options ) - return _response.data + return response.data async def upsert( self, @@ -754,14 +815,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.upsert( + response = await self._raw_client.upsert( merchant_id, key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, merchant_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -809,5 +870,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(merchant_id, key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(merchant_id, key, request_options=request_options) + return response.data diff --git a/src/square/merchants/custom_attributes/raw_client.py b/src/square/merchants/custom_attributes/raw_client.py index 35e4b219..eb44aad3 100644 --- a/src/square/merchants/custom_attributes/raw_client.py +++ b/src/square/merchants/custom_attributes/raw_client.py @@ -1,31 +1,28 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type +from ...core.client_wrapper import SyncClientWrapper from ...requests.bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request import ( BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestParams, ) +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.bulk_delete_merchant_custom_attributes_response import BulkDeleteMerchantCustomAttributesResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request import ( BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestParams, ) -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_merchant_custom_attributes_response import BulkDeleteMerchantCustomAttributesResponse from ...types.bulk_upsert_merchant_custom_attributes_response import BulkUpsertMerchantCustomAttributesResponse -from ...types.custom_attribute import CustomAttribute -from ...types.delete_merchant_custom_attribute_response import DeleteMerchantCustomAttributeResponse -from ...types.list_merchant_custom_attributes_response import ListMerchantCustomAttributesResponse from ...types.retrieve_merchant_custom_attribute_response import RetrieveMerchantCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_merchant_custom_attribute_response import UpsertMerchantCustomAttributeResponse -from ...types.visibility_filter import VisibilityFilter +from ...types.delete_merchant_custom_attribute_response import DeleteMerchantCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -90,8 +87,8 @@ def batch_delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_upsert( self, @@ -156,94 +153,8 @@ def batch_upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list( - self, - merchant_id: str, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - merchant_id : str - The ID of the target [merchant](entity:Merchant). - - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/merchants/{jsonable_encoder(merchant_id)}/custom-attributes", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListMerchantCustomAttributesResponse, - construct_type( - type_=ListMerchantCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - merchant_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -311,8 +222,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def upsert( self, @@ -388,8 +299,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, merchant_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -434,8 +345,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributesClient: @@ -497,8 +408,8 @@ async def batch_delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_upsert( self, @@ -563,97 +474,8 @@ async def batch_upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list( - self, - merchant_id: str, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - limit: typing.Optional[int] = None, - cursor: typing.Optional[str] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - merchant_id : str - The ID of the target [merchant](entity:Merchant). - - visibility_filter : typing.Optional[VisibilityFilter] - Filters the `CustomAttributeDefinition` results by their `visibility` values. - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. For more - information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom - attribute, information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/merchants/{jsonable_encoder(merchant_id)}/custom-attributes", - method="GET", - params={ - "visibility_filter": visibility_filter, - "limit": limit, - "cursor": cursor, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListMerchantCustomAttributesResponse, - construct_type( - type_=ListMerchantCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - merchant_id, - visibility_filter=visibility_filter, - limit=limit, - cursor=_parsed_next, - with_definitions=with_definitions, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -721,8 +543,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def upsert( self, @@ -798,8 +620,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, merchant_id: str, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -844,5 +666,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/merchants/raw_client.py b/src/square/merchants/raw_client.py index f196f44b..a41dcfcf 100644 --- a/src/square/merchants/raw_client.py +++ b/src/square/merchants/raw_client.py @@ -1,82 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.http_response import HttpResponse from ..types.get_merchant_response import GetMerchantResponse -from ..types.list_merchants_response import ListMerchantsResponse -from ..types.merchant import Merchant +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawMerchantsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> SyncPager[Merchant, ListMerchantsResponse]: - """ - Provides details about the merchant associated with a given access token. - - The access token used to connect your application to a Square seller is associated - with a single merchant. That means that `ListMerchants` returns a list - with a single `Merchant` object. You can specify your personal access token - to get your own merchant information or specify an OAuth token to get the - information for the merchant that granted your application access. - - If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) - endpoint to retrieve the merchant information. - - Parameters - ---------- - cursor : typing.Optional[int] - The cursor generated by the previous response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Merchant, ListMerchantsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/merchants", - method="GET", - params={ - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListMerchantsResponse, - construct_type( - type_=ListMerchantsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.merchant - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, merchant_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetMerchantResponse]: @@ -114,75 +54,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawMerchantsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncPager[Merchant, ListMerchantsResponse]: - """ - Provides details about the merchant associated with a given access token. - - The access token used to connect your application to a Square seller is associated - with a single merchant. That means that `ListMerchants` returns a list - with a single `Merchant` object. You can specify your personal access token - to get your own merchant information or specify an OAuth token to get the - information for the merchant that granted your application access. - - If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) - endpoint to retrieve the merchant information. - - Parameters - ---------- - cursor : typing.Optional[int] - The cursor generated by the previous response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Merchant, ListMerchantsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/merchants", - method="GET", - params={ - "cursor": cursor, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListMerchantsResponse, - construct_type( - type_=ListMerchantsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.merchant - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, merchant_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetMerchantResponse]: @@ -220,5 +99,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/mobile/__init__.py b/src/square/mobile/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/mobile/__init__.py +++ b/src/square/mobile/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/mobile/client.py b/src/square/mobile/client.py index 877eb5fe..024d8292 100644 --- a/src/square/mobile/client.py +++ b/src/square/mobile/client.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawMobileClient from ..core.request_options import RequestOptions from ..types.create_mobile_authorization_code_response import CreateMobileAuthorizationCodeResponse -from .raw_client import AsyncRawMobileClient, RawMobileClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawMobileClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -70,8 +71,8 @@ def authorization_code( location_id="YOUR_LOCATION_ID", ) """ - _response = self._raw_client.authorization_code(location_id=location_id, request_options=request_options) - return _response.data + response = self._raw_client.authorization_code(location_id=location_id, request_options=request_options) + return response.data class AsyncMobileClient: @@ -141,5 +142,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.authorization_code(location_id=location_id, request_options=request_options) - return _response.data + response = await self._raw_client.authorization_code(location_id=location_id, request_options=request_options) + return response.data diff --git a/src/square/mobile/raw_client.py b/src/square/mobile/raw_client.py index cda6a717..d7a22d19 100644 --- a/src/square/mobile/raw_client.py +++ b/src/square/mobile/raw_client.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.http_response import HttpResponse from ..types.create_mobile_authorization_code_response import CreateMobileAuthorizationCodeResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -75,8 +76,8 @@ def authorization_code( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawMobileClient: @@ -140,5 +141,5 @@ async def authorization_code( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/o_auth/__init__.py b/src/square/o_auth/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/o_auth/__init__.py +++ b/src/square/o_auth/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/o_auth/client.py b/src/square/o_auth/client.py index ccafdc01..9a534c8b 100644 --- a/src/square/o_auth/client.py +++ b/src/square/o_auth/client.py @@ -1,13 +1,14 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawOAuthClient from ..core.request_options import RequestOptions +from ..types.revoke_token_response import RevokeTokenResponse from ..types.obtain_token_response import ObtainTokenResponse from ..types.retrieve_token_status_response import RetrieveTokenStatusResponse -from ..types.revoke_token_response import RevokeTokenResponse -from .raw_client import AsyncRawOAuthClient, RawOAuthClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawOAuthClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -92,14 +93,14 @@ def revoke_token( access_token="ACCESS_TOKEN", ) """ - _response = self._raw_client.revoke_token( + response = self._raw_client.revoke_token( client_id=client_id, access_token=access_token, merchant_id=merchant_id, revoke_only_access_token=revoke_only_access_token, request_options=request_options, ) - return _response.data + return response.data def obtain_token( self, @@ -231,7 +232,7 @@ def obtain_token( grant_type="authorization_code", ) """ - _response = self._raw_client.obtain_token( + response = self._raw_client.obtain_token( client_id=client_id, grant_type=grant_type, client_secret=client_secret, @@ -244,7 +245,7 @@ def obtain_token( code_verifier=code_verifier, request_options=request_options, ) - return _response.data + return response.data def retrieve_token_status( self, *, request_options: typing.Optional[RequestOptions] = None @@ -284,8 +285,8 @@ def retrieve_token_status( ) client.o_auth.retrieve_token_status() """ - _response = self._raw_client.retrieve_token_status(request_options=request_options) - return _response.data + response = self._raw_client.retrieve_token_status(request_options=request_options) + return response.data def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ @@ -307,8 +308,8 @@ def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) ) client.o_auth.authorize() """ - _response = self._raw_client.authorize(request_options=request_options) - return _response.data + response = self._raw_client.authorize(request_options=request_options) + return response.data class AsyncOAuthClient: @@ -398,14 +399,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.revoke_token( + response = await self._raw_client.revoke_token( client_id=client_id, access_token=access_token, merchant_id=merchant_id, revoke_only_access_token=revoke_only_access_token, request_options=request_options, ) - return _response.data + return response.data async def obtain_token( self, @@ -545,7 +546,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.obtain_token( + response = await self._raw_client.obtain_token( client_id=client_id, grant_type=grant_type, client_secret=client_secret, @@ -558,7 +559,7 @@ async def main() -> None: code_verifier=code_verifier, request_options=request_options, ) - return _response.data + return response.data async def retrieve_token_status( self, *, request_options: typing.Optional[RequestOptions] = None @@ -606,8 +607,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_token_status(request_options=request_options) - return _response.data + response = await self._raw_client.retrieve_token_status(request_options=request_options) + return response.data async def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ @@ -637,5 +638,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.authorize(request_options=request_options) - return _response.data + response = await self._raw_client.authorize(request_options=request_options) + return response.data diff --git a/src/square/o_auth/raw_client.py b/src/square/o_auth/raw_client.py index 1433ca30..b7e4a7d1 100644 --- a/src/square/o_auth/raw_client.py +++ b/src/square/o_auth/raw_client.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.revoke_token_response import RevokeTokenResponse from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.obtain_token_response import ObtainTokenResponse from ..types.retrieve_token_status_response import RetrieveTokenStatusResponse -from ..types.revoke_token_response import RevokeTokenResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -99,8 +100,8 @@ def revoke_token( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def obtain_token( self, @@ -251,8 +252,8 @@ def obtain_token( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def retrieve_token_status( self, *, request_options: typing.Optional[RequestOptions] = None @@ -300,8 +301,8 @@ def retrieve_token_status( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ @@ -324,8 +325,8 @@ def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) return HttpResponse(response=_response, data=None) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawOAuthClient: @@ -411,8 +412,8 @@ async def revoke_token( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def obtain_token( self, @@ -563,8 +564,8 @@ async def obtain_token( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def retrieve_token_status( self, *, request_options: typing.Optional[RequestOptions] = None @@ -612,8 +613,8 @@ async def retrieve_token_status( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) -> AsyncHttpResponse[None]: """ @@ -636,5 +637,5 @@ async def authorize(self, *, request_options: typing.Optional[RequestOptions] = return AsyncHttpResponse(response=_response, data=None) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/orders/__init__.py b/src/square/orders/__init__.py index 762ae6a5..cbf84df6 100644 --- a/src/square/orders/__init__.py +++ b/src/square/orders/__init__.py @@ -1,37 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import custom_attribute_definitions, custom_attributes -_dynamic_imports: typing.Dict[str, str] = { - "custom_attribute_definitions": ".custom_attribute_definitions", - "custom_attributes": ".custom_attributes", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import custom_attribute_definitions, custom_attributes __all__ = ["custom_attribute_definitions", "custom_attributes"] diff --git a/src/square/orders/client.py b/src/square/orders/client.py index 3537c4af..70f24cc5 100644 --- a/src/square/orders/client.py +++ b/src/square/orders/client.py @@ -1,30 +1,27 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawOrdersClient +from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient +from .custom_attributes.client import CustomAttributesClient from ..requests.order import OrderParams -from ..requests.order_reward import OrderRewardParams -from ..requests.search_orders_query import SearchOrdersQueryParams +from ..core.request_options import RequestOptions +from ..types.create_order_response import CreateOrderResponse from ..types.batch_get_orders_response import BatchGetOrdersResponse +from ..requests.order_reward import OrderRewardParams from ..types.calculate_order_response import CalculateOrderResponse from ..types.clone_order_response import CloneOrderResponse -from ..types.create_order_response import CreateOrderResponse -from ..types.get_order_response import GetOrderResponse -from ..types.pay_order_response import PayOrderResponse +from ..requests.search_orders_query import SearchOrdersQueryParams from ..types.search_orders_response import SearchOrdersResponse +from ..types.get_order_response import GetOrderResponse from ..types.update_order_response import UpdateOrderResponse -from .raw_client import AsyncRawOrdersClient, RawOrdersClient - -if typing.TYPE_CHECKING: - from .custom_attribute_definitions.client import ( - AsyncCustomAttributeDefinitionsClient, - CustomAttributeDefinitionsClient, - ) - from .custom_attributes.client import AsyncCustomAttributesClient, CustomAttributesClient +from ..types.pay_order_response import PayOrderResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawOrdersClient +from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient +from .custom_attributes.client import AsyncCustomAttributesClient + # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -32,9 +29,9 @@ class OrdersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawOrdersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[CustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[CustomAttributesClient] = None + self.custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = CustomAttributesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawOrdersClient: @@ -144,10 +141,10 @@ def create( idempotency_key="8193148c-9586-11e6-99f9-28cfe92138cf", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( order=order, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def batch_get( self, @@ -190,10 +187,10 @@ def batch_get( order_ids=["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"], ) """ - _response = self._raw_client.batch_get( + response = self._raw_client.batch_get( order_ids=order_ids, location_id=location_id, request_options=request_options ) - return _response.data + return response.data def calculate( self, @@ -253,10 +250,10 @@ def calculate( }, ) """ - _response = self._raw_client.calculate( + response = self._raw_client.calculate( order=order, proposed_rewards=proposed_rewards, request_options=request_options ) - return _response.data + return response.data def clone( self, @@ -312,10 +309,10 @@ def clone( idempotency_key="UNIQUE_STRING", ) """ - _response = self._raw_client.clone( + response = self._raw_client.clone( order_id=order_id, version=version, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -409,7 +406,7 @@ def search( return_entries=True, ) """ - _response = self._raw_client.search( + response = self._raw_client.search( location_ids=location_ids, cursor=cursor, query=query, @@ -417,7 +414,7 @@ def search( return_entries=return_entries, request_options=request_options, ) - return _response.data + return response.data def get(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetOrderResponse: """ @@ -447,8 +444,8 @@ def get(self, order_id: str, *, request_options: typing.Optional[RequestOptions] order_id="order_id", ) """ - _response = self._raw_client.get(order_id, request_options=request_options) - return _response.data + response = self._raw_client.get(order_id, request_options=request_options) + return response.data def update( self, @@ -534,14 +531,14 @@ def update( idempotency_key="UNIQUE_STRING", ) """ - _response = self._raw_client.update( + response = self._raw_client.update( order_id, order=order, fields_to_clear=fields_to_clear, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def pay( self, @@ -608,38 +605,22 @@ def pay( payment_ids=["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"], ) """ - _response = self._raw_client.pay( + response = self._raw_client.pay( order_id, idempotency_key=idempotency_key, order_version=order_version, payment_ids=payment_ids, request_options=request_options, ) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import CustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = CustomAttributeDefinitionsClient(client_wrapper=self._client_wrapper) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import CustomAttributesClient # noqa: E402 - - self._custom_attributes = CustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes + return response.data class AsyncOrdersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawOrdersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._custom_attribute_definitions: typing.Optional[AsyncCustomAttributeDefinitionsClient] = None - self._custom_attributes: typing.Optional[AsyncCustomAttributesClient] = None + self.custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient(client_wrapper=client_wrapper) + + self.custom_attributes = AsyncCustomAttributesClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawOrdersClient: @@ -757,10 +738,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( order=order, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def batch_get( self, @@ -814,10 +795,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_get( + response = await self._raw_client.batch_get( order_ids=order_ids, location_id=location_id, request_options=request_options ) - return _response.data + return response.data async def calculate( self, @@ -885,10 +866,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.calculate( + response = await self._raw_client.calculate( order=order, proposed_rewards=proposed_rewards, request_options=request_options ) - return _response.data + return response.data async def clone( self, @@ -952,10 +933,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.clone( + response = await self._raw_client.clone( order_id=order_id, version=version, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -1057,7 +1038,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( location_ids=location_ids, cursor=cursor, query=query, @@ -1065,7 +1046,7 @@ async def main() -> None: return_entries=return_entries, request_options=request_options, ) - return _response.data + return response.data async def get(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetOrderResponse: """ @@ -1103,8 +1084,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(order_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(order_id, request_options=request_options) + return response.data async def update( self, @@ -1198,14 +1179,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( order_id, order=order, fields_to_clear=fields_to_clear, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def pay( self, @@ -1283,29 +1264,11 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.pay( + response = await self._raw_client.pay( order_id, idempotency_key=idempotency_key, order_version=order_version, payment_ids=payment_ids, request_options=request_options, ) - return _response.data - - @property - def custom_attribute_definitions(self): - if self._custom_attribute_definitions is None: - from .custom_attribute_definitions.client import AsyncCustomAttributeDefinitionsClient # noqa: E402 - - self._custom_attribute_definitions = AsyncCustomAttributeDefinitionsClient( - client_wrapper=self._client_wrapper - ) - return self._custom_attribute_definitions - - @property - def custom_attributes(self): - if self._custom_attributes is None: - from .custom_attributes.client import AsyncCustomAttributesClient # noqa: E402 - - self._custom_attributes = AsyncCustomAttributesClient(client_wrapper=self._client_wrapper) - return self._custom_attributes + return response.data diff --git a/src/square/orders/custom_attribute_definitions/__init__.py b/src/square/orders/custom_attribute_definitions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/orders/custom_attribute_definitions/__init__.py +++ b/src/square/orders/custom_attribute_definitions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/orders/custom_attribute_definitions/client.py b/src/square/orders/custom_attribute_definitions/client.py index 2803b2a4..e669f77d 100644 --- a/src/square/orders/custom_attribute_definitions/client.py +++ b/src/square/orders/custom_attribute_definitions/client.py @@ -1,19 +1,24 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributeDefinitionsClient +from ...types.visibility_filter import VisibilityFilter from ...core.request_options import RequestOptions -from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams -from ...types.create_order_custom_attribute_definition_response import CreateOrderCustomAttributeDefinitionResponse +from ...core.pagination import SyncPager from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_order_custom_attribute_definition_response import DeleteOrderCustomAttributeDefinitionResponse from ...types.list_order_custom_attribute_definitions_response import ListOrderCustomAttributeDefinitionsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams +from ...types.create_order_custom_attribute_definition_response import CreateOrderCustomAttributeDefinitionResponse from ...types.retrieve_order_custom_attribute_definition_response import RetrieveOrderCustomAttributeDefinitionResponse from ...types.update_order_custom_attribute_definition_response import UpdateOrderCustomAttributeDefinitionResponse -from ...types.visibility_filter import VisibilityFilter -from .raw_client import AsyncRawCustomAttributeDefinitionsClient, RawCustomAttributeDefinitionsClient +from ...types.delete_order_custom_attribute_definition_response import DeleteOrderCustomAttributeDefinitionResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributeDefinitionsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -41,7 +46,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: + ) -> SyncPager[CustomAttributeDefinition]: """ Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -71,7 +76,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] + SyncPager[CustomAttributeDefinition] Success Examples @@ -92,9 +97,39 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - visibility_filter=visibility_filter, cursor=cursor, limit=limit, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/orders/custom-attribute-definitions", + method="GET", + params={ + "visibility_filter": visibility_filter, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrderCustomAttributeDefinitionsResponse, + construct_type( + type_=ListOrderCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + visibility_filter=visibility_filter, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -152,12 +187,12 @@ def create( idempotency_key="IDEMPOTENCY_KEY", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -198,8 +233,8 @@ def get( version=1, ) """ - _response = self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = self._raw_client.get(key, version=version, request_options=request_options) + return response.data def update( self, @@ -255,13 +290,13 @@ def update( idempotency_key="IDEMPOTENCY_KEY", ) """ - _response = self._raw_client.update( + response = self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -295,8 +330,8 @@ def delete( key="key", ) """ - _response = self._raw_client.delete(key, request_options=request_options) - return _response.data + response = self._raw_client.delete(key, request_options=request_options) + return response.data class AsyncCustomAttributeDefinitionsClient: @@ -321,7 +356,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: + ) -> AsyncPager[CustomAttributeDefinition]: """ Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -351,7 +386,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] + AsyncPager[CustomAttributeDefinition] Success Examples @@ -373,7 +408,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -381,9 +415,39 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - visibility_filter=visibility_filter, cursor=cursor, limit=limit, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/orders/custom-attribute-definitions", + method="GET", + params={ + "visibility_filter": visibility_filter, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrderCustomAttributeDefinitionsResponse, + construct_type( + type_=ListOrderCustomAttributeDefinitionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + visibility_filter=visibility_filter, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.custom_attribute_definitions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -449,12 +513,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -503,8 +567,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(key, version=version, request_options=request_options) - return _response.data + response = await self._raw_client.get(key, version=version, request_options=request_options) + return response.data async def update( self, @@ -568,13 +632,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( key, custom_attribute_definition=custom_attribute_definition, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -616,5 +680,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(key, request_options=request_options) + return response.data diff --git a/src/square/orders/custom_attribute_definitions/raw_client.py b/src/square/orders/custom_attribute_definitions/raw_client.py index b5f799ad..4179529c 100644 --- a/src/square/orders/custom_attribute_definitions/raw_client.py +++ b/src/square/orders/custom_attribute_definitions/raw_client.py @@ -1,24 +1,21 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_order_custom_attribute_definition_response import CreateOrderCustomAttributeDefinitionResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.custom_attribute_definition import CustomAttributeDefinitionParams -from ...types.create_order_custom_attribute_definition_response import CreateOrderCustomAttributeDefinitionResponse -from ...types.custom_attribute_definition import CustomAttributeDefinition -from ...types.delete_order_custom_attribute_definition_response import DeleteOrderCustomAttributeDefinitionResponse -from ...types.list_order_custom_attribute_definitions_response import ListOrderCustomAttributeDefinitionsResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_order_custom_attribute_definition_response import RetrieveOrderCustomAttributeDefinitionResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_order_custom_attribute_definition_response import UpdateOrderCustomAttributeDefinitionResponse -from ...types.visibility_filter import VisibilityFilter +from ...types.delete_order_custom_attribute_definition_response import DeleteOrderCustomAttributeDefinitionResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -28,80 +25,6 @@ class RawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: - """ - Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that - seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - visibility_filter : typing.Optional[VisibilityFilter] - Requests that all of the custom attributes be returned, or only those that are read-only or read-write. - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/orders/custom-attribute-definitions", - method="GET", - params={ - "visibility_filter": visibility_filter, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListOrderCustomAttributeDefinitionsResponse, - construct_type( - type_=ListOrderCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - visibility_filter=visibility_filter, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -165,8 +88,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -215,8 +138,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -282,8 +205,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -323,91 +246,14 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributeDefinitionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: - """ - Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. - - When all response pages are retrieved, the results include all custom attribute definitions - that are visible to the requesting application, including those that are created by other - applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that - seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - visibility_filter : typing.Optional[VisibilityFilter] - Requests that all of the custom attributes be returned, or only those that are read-only or read-write. - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/orders/custom-attribute-definitions", - method="GET", - params={ - "visibility_filter": visibility_filter, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListOrderCustomAttributeDefinitionsResponse, - construct_type( - type_=ListOrderCustomAttributeDefinitionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attribute_definitions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - visibility_filter=visibility_filter, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -471,8 +317,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, key: str, *, version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None @@ -521,8 +367,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -588,8 +434,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -629,5 +475,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/orders/custom_attributes/__init__.py b/src/square/orders/custom_attributes/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/orders/custom_attributes/__init__.py +++ b/src/square/orders/custom_attributes/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/orders/custom_attributes/client.py b/src/square/orders/custom_attributes/client.py index 403a2d91..862942c1 100644 --- a/src/square/orders/custom_attributes/client.py +++ b/src/square/orders/custom_attributes/client.py @@ -1,26 +1,32 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCustomAttributesClient from ...requests.bulk_delete_order_custom_attributes_request_delete_custom_attribute import ( BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeParams, ) +from ...core.request_options import RequestOptions +from ...types.bulk_delete_order_custom_attributes_response import BulkDeleteOrderCustomAttributesResponse from ...requests.bulk_upsert_order_custom_attributes_request_upsert_custom_attribute import ( BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeParams, ) -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_order_custom_attributes_response import BulkDeleteOrderCustomAttributesResponse from ...types.bulk_upsert_order_custom_attributes_response import BulkUpsertOrderCustomAttributesResponse +from ...types.visibility_filter import VisibilityFilter +from ...core.pagination import SyncPager from ...types.custom_attribute import CustomAttribute -from ...types.delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.list_order_custom_attributes_response import ListOrderCustomAttributesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.retrieve_order_custom_attribute_response import RetrieveOrderCustomAttributeResponse +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_order_custom_attribute_response import UpsertOrderCustomAttributeResponse -from ...types.visibility_filter import VisibilityFilter -from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient +from ...types.delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCustomAttributesClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -96,8 +102,8 @@ def batch_delete( }, ) """ - _response = self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data def batch_upsert( self, @@ -162,8 +168,8 @@ def batch_upsert( }, ) """ - _response = self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data def list( self, @@ -174,7 +180,7 @@ def list( limit: typing.Optional[int] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: + ) -> SyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with an order. @@ -214,7 +220,7 @@ def list( Returns ------- - SyncPager[CustomAttribute, ListOrderCustomAttributesResponse] + SyncPager[CustomAttribute] Success Examples @@ -237,14 +243,42 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - order_id, - visibility_filter=visibility_filter, - cursor=cursor, - limit=limit, - with_definitions=with_definitions, + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/orders/{jsonable_encoder(order_id)}/custom-attributes", + method="GET", + params={ + "visibility_filter": visibility_filter, + "cursor": cursor, + "limit": limit, + "with_definitions": with_definitions, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrderCustomAttributesResponse, + construct_type( + type_=ListOrderCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + order_id, + visibility_filter=visibility_filter, + cursor=_parsed_next, + limit=limit, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -305,14 +339,14 @@ def get( with_definition=True, ) """ - _response = self._raw_client.get( + response = self._raw_client.get( order_id, custom_attribute_key, version=version, with_definition=with_definition, request_options=request_options, ) - return _response.data + return response.data def upsert( self, @@ -377,14 +411,14 @@ def upsert( custom_attribute={"key": "table-number", "value": "42", "version": 1}, ) """ - _response = self._raw_client.upsert( + response = self._raw_client.upsert( order_id, custom_attribute_key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data def delete( self, order_id: str, custom_attribute_key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -425,8 +459,8 @@ def delete( custom_attribute_key="custom_attribute_key", ) """ - _response = self._raw_client.delete(order_id, custom_attribute_key, request_options=request_options) - return _response.data + response = self._raw_client.delete(order_id, custom_attribute_key, request_options=request_options) + return response.data class AsyncCustomAttributesClient: @@ -507,8 +541,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_delete(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_delete(values=values, request_options=request_options) + return response.data async def batch_upsert( self, @@ -581,8 +615,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_upsert(values=values, request_options=request_options) - return _response.data + response = await self._raw_client.batch_upsert(values=values, request_options=request_options) + return response.data async def list( self, @@ -593,7 +627,7 @@ async def list( limit: typing.Optional[int] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: + ) -> AsyncPager[CustomAttribute]: """ Lists the [custom attributes](entity:CustomAttribute) associated with an order. @@ -633,7 +667,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse] + AsyncPager[CustomAttribute] Success Examples @@ -657,7 +691,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -665,14 +698,42 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - order_id, - visibility_filter=visibility_filter, - cursor=cursor, - limit=limit, - with_definitions=with_definitions, + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/orders/{jsonable_encoder(order_id)}/custom-attributes", + method="GET", + params={ + "visibility_filter": visibility_filter, + "cursor": cursor, + "limit": limit, + "with_definitions": with_definitions, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListOrderCustomAttributesResponse, + construct_type( + type_=ListOrderCustomAttributesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + order_id, + visibility_filter=visibility_filter, + cursor=_parsed_next, + limit=limit, + with_definitions=with_definitions, + request_options=request_options, + ) + _items = _parsed_response.custom_attributes + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -741,14 +802,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get( + response = await self._raw_client.get( order_id, custom_attribute_key, version=version, with_definition=with_definition, request_options=request_options, ) - return _response.data + return response.data async def upsert( self, @@ -821,14 +882,14 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.upsert( + response = await self._raw_client.upsert( order_id, custom_attribute_key, custom_attribute=custom_attribute, idempotency_key=idempotency_key, request_options=request_options, ) - return _response.data + return response.data async def delete( self, order_id: str, custom_attribute_key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -877,5 +938,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(order_id, custom_attribute_key, request_options=request_options) - return _response.data + response = await self._raw_client.delete(order_id, custom_attribute_key, request_options=request_options) + return response.data diff --git a/src/square/orders/custom_attributes/raw_client.py b/src/square/orders/custom_attributes/raw_client.py index 213dc970..7bcc5616 100644 --- a/src/square/orders/custom_attributes/raw_client.py +++ b/src/square/orders/custom_attributes/raw_client.py @@ -1,31 +1,28 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager -from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata -from ...core.unchecked_base_model import construct_type +from ...core.client_wrapper import SyncClientWrapper from ...requests.bulk_delete_order_custom_attributes_request_delete_custom_attribute import ( BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeParams, ) +from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.bulk_delete_order_custom_attributes_response import BulkDeleteOrderCustomAttributesResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.bulk_upsert_order_custom_attributes_request_upsert_custom_attribute import ( BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeParams, ) -from ...requests.custom_attribute import CustomAttributeParams -from ...types.bulk_delete_order_custom_attributes_response import BulkDeleteOrderCustomAttributesResponse from ...types.bulk_upsert_order_custom_attributes_response import BulkUpsertOrderCustomAttributesResponse -from ...types.custom_attribute import CustomAttribute -from ...types.delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponse -from ...types.list_order_custom_attributes_response import ListOrderCustomAttributesResponse from ...types.retrieve_order_custom_attribute_response import RetrieveOrderCustomAttributeResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...requests.custom_attribute import CustomAttributeParams from ...types.upsert_order_custom_attribute_response import UpsertOrderCustomAttributeResponse -from ...types.visibility_filter import VisibilityFilter +from ...types.delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -98,8 +95,8 @@ def batch_delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_upsert( self, @@ -164,97 +161,8 @@ def batch_upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list( - self, - order_id: str, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with an order. - - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - order_id : str - The ID of the target [order](entity:Order). - - visibility_filter : typing.Optional[VisibilityFilter] - Requests that all of the custom attributes be returned, or only those that are read-only or read-write. - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom attribute, - information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CustomAttribute, ListOrderCustomAttributesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/orders/{jsonable_encoder(order_id)}/custom-attributes", - method="GET", - params={ - "visibility_filter": visibility_filter, - "cursor": cursor, - "limit": limit, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListOrderCustomAttributesResponse, - construct_type( - type_=ListOrderCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - order_id, - visibility_filter=visibility_filter, - cursor=_parsed_next, - limit=limit, - with_definitions=with_definitions, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -322,8 +230,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def upsert( self, @@ -402,8 +310,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, order_id: str, custom_attribute_key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -449,8 +357,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCustomAttributesClient: @@ -520,8 +428,8 @@ async def batch_delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_upsert( self, @@ -586,100 +494,8 @@ async def batch_upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list( - self, - order_id: str, - *, - visibility_filter: typing.Optional[VisibilityFilter] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - with_definitions: typing.Optional[bool] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: - """ - Lists the [custom attributes](entity:CustomAttribute) associated with an order. - - You can use the `with_definitions` query parameter to also retrieve custom attribute definitions - in the same call. - - When all response pages are retrieved, the results include all custom attributes that are - visible to the requesting application, including those that are owned by other applications - and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - - Parameters - ---------- - order_id : str - The ID of the target [order](entity:Order). - - visibility_filter : typing.Optional[VisibilityFilter] - Requests that all of the custom attributes be returned, or only those that are read-only or read-write. - - cursor : typing.Optional[str] - The cursor returned in the paged response from the previous call to this endpoint. - Provide this cursor to retrieve the next page of results for your original request. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - limit : typing.Optional[int] - The maximum number of results to return in a single paged response. This limit is advisory. - The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. - The default value is 20. - For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). - - with_definitions : typing.Optional[bool] - Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each - custom attribute. Set this parameter to `true` to get the name and description of each custom attribute, - information about the data type, or other definition details. The default value is `false`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/orders/{jsonable_encoder(order_id)}/custom-attributes", - method="GET", - params={ - "visibility_filter": visibility_filter, - "cursor": cursor, - "limit": limit, - "with_definitions": with_definitions, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListOrderCustomAttributesResponse, - construct_type( - type_=ListOrderCustomAttributesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.custom_attributes - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - order_id, - visibility_filter=visibility_filter, - cursor=_parsed_next, - limit=limit, - with_definitions=with_definitions, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -747,8 +563,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def upsert( self, @@ -827,8 +643,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, order_id: str, custom_attribute_key: str, *, request_options: typing.Optional[RequestOptions] = None @@ -874,5 +690,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/orders/raw_client.py b/src/square/orders/raw_client.py index 5fd5067b..3127e2f5 100644 --- a/src/square/orders/raw_client.py +++ b/src/square/orders/raw_client.py @@ -1,26 +1,27 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper +from ..requests.order import OrderParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_order_response import CreateOrderResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.order import OrderParams -from ..requests.order_reward import OrderRewardParams -from ..requests.search_orders_query import SearchOrdersQueryParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.batch_get_orders_response import BatchGetOrdersResponse +from ..requests.order_reward import OrderRewardParams from ..types.calculate_order_response import CalculateOrderResponse from ..types.clone_order_response import CloneOrderResponse -from ..types.create_order_response import CreateOrderResponse -from ..types.get_order_response import GetOrderResponse -from ..types.pay_order_response import PayOrderResponse +from ..requests.search_orders_query import SearchOrdersQueryParams from ..types.search_orders_response import SearchOrdersResponse +from ..types.get_order_response import GetOrderResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.update_order_response import UpdateOrderResponse +from ..types.pay_order_response import PayOrderResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -79,9 +80,6 @@ def create( ), "idempotency_key": idempotency_key, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -97,8 +95,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_get( self, @@ -154,8 +152,8 @@ def batch_get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def calculate( self, @@ -218,8 +216,8 @@ def calculate( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def clone( self, @@ -288,8 +286,8 @@ def clone( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -388,8 +386,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -427,8 +425,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -517,8 +515,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def pay( self, @@ -598,8 +596,8 @@ def pay( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawOrdersClient: @@ -655,9 +653,6 @@ async def create( ), "idempotency_key": idempotency_key, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -673,8 +668,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_get( self, @@ -730,8 +725,8 @@ async def batch_get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def calculate( self, @@ -794,8 +789,8 @@ async def calculate( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def clone( self, @@ -864,8 +859,8 @@ async def clone( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -964,8 +959,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1003,8 +998,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -1093,8 +1088,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def pay( self, @@ -1174,5 +1169,5 @@ async def pay( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/payments/__init__.py b/src/square/payments/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/payments/__init__.py +++ b/src/square/payments/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/payments/client.py b/src/square/payments/client.py index 5110abfe..2bc70a0d 100644 --- a/src/square/payments/client.py +++ b/src/square/payments/client.py @@ -1,27 +1,32 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawPaymentsClient +from ..types.list_payments_request_sort_field import ListPaymentsRequestSortField from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager +from ..types.payment import Payment +from ..types.list_payments_response import ListPaymentsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..requests.money import MoneyParams from ..requests.address import AddressParams from ..requests.cash_payment_details import CashPaymentDetailsParams -from ..requests.customer_details import CustomerDetailsParams from ..requests.external_payment_details import ExternalPaymentDetailsParams -from ..requests.money import MoneyParams +from ..requests.customer_details import CustomerDetailsParams from ..requests.offline_payment_details import OfflinePaymentDetailsParams -from ..requests.payment import PaymentParams -from ..types.cancel_payment_by_idempotency_key_response import CancelPaymentByIdempotencyKeyResponse -from ..types.cancel_payment_response import CancelPaymentResponse -from ..types.complete_payment_response import CompletePaymentResponse from ..types.create_payment_response import CreatePaymentResponse +from ..types.cancel_payment_by_idempotency_key_response import CancelPaymentByIdempotencyKeyResponse from ..types.get_payment_response import GetPaymentResponse -from ..types.list_payments_request_sort_field import ListPaymentsRequestSortField -from ..types.list_payments_response import ListPaymentsResponse -from ..types.payment import Payment +from ..requests.payment import PaymentParams from ..types.update_payment_response import UpdatePaymentResponse -from .raw_client import AsyncRawPaymentsClient, RawPaymentsClient +from ..types.cancel_payment_response import CancelPaymentResponse +from ..types.complete_payment_response import CompletePaymentResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawPaymentsClient +from ..core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -61,7 +66,7 @@ def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payment, ListPaymentsResponse]: + ) -> SyncPager[Payment]: """ Retrieves a list of payments taken by the account making the request. @@ -151,7 +156,7 @@ def list( Returns ------- - SyncPager[Payment, ListPaymentsResponse] + SyncPager[Payment] Success Examples @@ -184,24 +189,63 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=cursor, - location_id=location_id, - total=total, - last4=last4, - card_brand=card_brand, - limit=limit, - is_offline_payment=is_offline_payment, - offline_begin_time=offline_begin_time, - offline_end_time=offline_end_time, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/payments", + method="GET", + params={ + "begin_time": begin_time, + "end_time": end_time, + "sort_order": sort_order, + "cursor": cursor, + "location_id": location_id, + "total": total, + "last_4": last4, + "card_brand": card_brand, + "limit": limit, + "is_offline_payment": is_offline_payment, + "offline_begin_time": offline_begin_time, + "offline_end_time": offline_end_time, + "updated_at_begin_time": updated_at_begin_time, + "updated_at_end_time": updated_at_end_time, + "sort_field": sort_field, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPaymentsResponse, + construct_type( + type_=ListPaymentsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + begin_time=begin_time, + end_time=end_time, + sort_order=sort_order, + cursor=_parsed_next, + location_id=location_id, + total=total, + last4=last4, + card_brand=card_brand, + limit=limit, + is_offline_payment=is_offline_payment, + offline_begin_time=offline_begin_time, + offline_end_time=offline_end_time, + updated_at_begin_time=updated_at_begin_time, + updated_at_end_time=updated_at_end_time, + sort_field=sort_field, + request_options=request_options, + ) + _items = _parsed_response.payments + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -444,7 +488,7 @@ def create( note="Brief description", ) """ - _response = self._raw_client.create( + response = self._raw_client.create( source_id=source_id, idempotency_key=idempotency_key, amount_money=amount_money, @@ -472,7 +516,7 @@ def create( offline_payment_details=offline_payment_details, request_options=request_options, ) - return _response.data + return response.data def cancel_by_idempotency_key( self, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -514,10 +558,10 @@ def cancel_by_idempotency_key( idempotency_key="a7e36d40-d24b-11e8-b568-0800200c9a66", ) """ - _response = self._raw_client.cancel_by_idempotency_key( + response = self._raw_client.cancel_by_idempotency_key( idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def get(self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetPaymentResponse: """ @@ -547,8 +591,8 @@ def get(self, payment_id: str, *, request_options: typing.Optional[RequestOption payment_id="payment_id", ) """ - _response = self._raw_client.get(payment_id, request_options=request_options) - return _response.data + response = self._raw_client.get(payment_id, request_options=request_options) + return response.data def update( self, @@ -601,10 +645,10 @@ def update( idempotency_key="956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", ) """ - _response = self._raw_client.update( + response = self._raw_client.update( payment_id, idempotency_key=idempotency_key, payment=payment, request_options=request_options ) - return _response.data + return response.data def cancel( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -637,8 +681,8 @@ def cancel( payment_id="payment_id", ) """ - _response = self._raw_client.cancel(payment_id, request_options=request_options) - return _response.data + response = self._raw_client.cancel(payment_id, request_options=request_options) + return response.data def complete( self, @@ -682,8 +726,8 @@ def complete( payment_id="payment_id", ) """ - _response = self._raw_client.complete(payment_id, version_token=version_token, request_options=request_options) - return _response.data + response = self._raw_client.complete(payment_id, version_token=version_token, request_options=request_options) + return response.data class AsyncPaymentsClient: @@ -720,7 +764,7 @@ async def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payment, ListPaymentsResponse]: + ) -> AsyncPager[Payment]: """ Retrieves a list of payments taken by the account making the request. @@ -810,7 +854,7 @@ async def list( Returns ------- - AsyncPager[Payment, ListPaymentsResponse] + AsyncPager[Payment] Success Examples @@ -844,7 +888,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -852,24 +895,63 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=cursor, - location_id=location_id, - total=total, - last4=last4, - card_brand=card_brand, - limit=limit, - is_offline_payment=is_offline_payment, - offline_begin_time=offline_begin_time, - offline_end_time=offline_end_time, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/payments", + method="GET", + params={ + "begin_time": begin_time, + "end_time": end_time, + "sort_order": sort_order, + "cursor": cursor, + "location_id": location_id, + "total": total, + "last_4": last4, + "card_brand": card_brand, + "limit": limit, + "is_offline_payment": is_offline_payment, + "offline_begin_time": offline_begin_time, + "offline_end_time": offline_end_time, + "updated_at_begin_time": updated_at_begin_time, + "updated_at_end_time": updated_at_end_time, + "sort_field": sort_field, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPaymentsResponse, + construct_type( + type_=ListPaymentsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + begin_time=begin_time, + end_time=end_time, + sort_order=sort_order, + cursor=_parsed_next, + location_id=location_id, + total=total, + last4=last4, + card_brand=card_brand, + limit=limit, + is_offline_payment=is_offline_payment, + offline_begin_time=offline_begin_time, + offline_end_time=offline_end_time, + updated_at_begin_time=updated_at_begin_time, + updated_at_end_time=updated_at_end_time, + sort_field=sort_field, + request_options=request_options, + ) + _items = _parsed_response.payments + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -1120,7 +1202,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( source_id=source_id, idempotency_key=idempotency_key, amount_money=amount_money, @@ -1148,7 +1230,7 @@ async def main() -> None: offline_payment_details=offline_payment_details, request_options=request_options, ) - return _response.data + return response.data async def cancel_by_idempotency_key( self, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -1198,10 +1280,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel_by_idempotency_key( + response = await self._raw_client.cancel_by_idempotency_key( idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def get( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1241,8 +1323,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(payment_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(payment_id, request_options=request_options) + return response.data async def update( self, @@ -1303,10 +1385,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( payment_id, idempotency_key=idempotency_key, payment=payment, request_options=request_options ) - return _response.data + return response.data async def cancel( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1347,8 +1429,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(payment_id, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(payment_id, request_options=request_options) + return response.data async def complete( self, @@ -1400,7 +1482,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.complete( + response = await self._raw_client.complete( payment_id, version_token=version_token, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/payments/raw_client.py b/src/square/payments/raw_client.py index e20751dd..c9794b0b 100644 --- a/src/square/payments/raw_client.py +++ b/src/square/payments/raw_client.py @@ -1,32 +1,29 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..core.unchecked_base_model import construct_type +from ..core.client_wrapper import SyncClientWrapper +from ..requests.money import MoneyParams from ..requests.address import AddressParams from ..requests.cash_payment_details import CashPaymentDetailsParams -from ..requests.customer_details import CustomerDetailsParams from ..requests.external_payment_details import ExternalPaymentDetailsParams -from ..requests.money import MoneyParams +from ..requests.customer_details import CustomerDetailsParams from ..requests.offline_payment_details import OfflinePaymentDetailsParams -from ..requests.payment import PaymentParams -from ..types.cancel_payment_by_idempotency_key_response import CancelPaymentByIdempotencyKeyResponse -from ..types.cancel_payment_response import CancelPaymentResponse -from ..types.complete_payment_response import CompletePaymentResponse +from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse from ..types.create_payment_response import CreatePaymentResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.cancel_payment_by_idempotency_key_response import CancelPaymentByIdempotencyKeyResponse from ..types.get_payment_response import GetPaymentResponse -from ..types.list_payments_request_sort_field import ListPaymentsRequestSortField -from ..types.list_payments_response import ListPaymentsResponse -from ..types.payment import Payment +from ..core.jsonable_encoder import jsonable_encoder +from ..requests.payment import PaymentParams from ..types.update_payment_response import UpdatePaymentResponse +from ..types.cancel_payment_response import CancelPaymentResponse +from ..types.complete_payment_response import CompletePaymentResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -36,176 +33,6 @@ class RawPaymentsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - sort_order: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - total: typing.Optional[int] = None, - last4: typing.Optional[str] = None, - card_brand: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - is_offline_payment: typing.Optional[bool] = None, - offline_begin_time: typing.Optional[str] = None, - offline_end_time: typing.Optional[str] = None, - updated_at_begin_time: typing.Optional[str] = None, - updated_at_end_time: typing.Optional[str] = None, - sort_field: typing.Optional[ListPaymentsRequestSortField] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payment, ListPaymentsResponse]: - """ - Retrieves a list of payments taken by the account making the request. - - Results are eventually consistent, and new payments or changes to payments might take several - seconds to appear. - - The maximum results per page is 100. - - Parameters - ---------- - begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve payments for, in RFC 3339 format. - The range is determined using the `created_at` field for each Payment. - Inclusive. Default: The current time minus one year. - - end_time : typing.Optional[str] - Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - range is determined using the `created_at` field for each Payment. - - Default: The current time. - - sort_order : typing.Optional[str] - The order in which results are listed by `ListPaymentsRequest.sort_field`: - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - location_id : typing.Optional[str] - Limit results to the location supplied. By default, results are returned - for the default (main) location associated with the seller. - - total : typing.Optional[int] - The exact amount in the `total_money` for a payment. - - last4 : typing.Optional[str] - The last four digits of a payment card. - - card_brand : typing.Optional[str] - The brand of the payment card (for example, VISA). - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - - The default value of 100 is also the maximum allowed value. If the provided value is - greater than 100, it is ignored and the default value is used instead. - - Default: `100` - - is_offline_payment : typing.Optional[bool] - Whether the payment was taken offline or not. - - offline_begin_time : typing.Optional[str] - Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 - format for timestamps. The range is determined using the - `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - value set in `offline_payment_details.client_created_at` will not be returned. - - Default: The current time. - - offline_end_time : typing.Optional[str] - Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 - format for timestamps. The range is determined using the - `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - value set in `offline_payment_details.client_created_at` will not be returned. - - Default: The current time. - - updated_at_begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The - range is determined using the `updated_at` field for each Payment. - - updated_at_end_time : typing.Optional[str] - Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - range is determined using the `updated_at` field for each Payment. - - sort_field : typing.Optional[ListPaymentsRequestSortField] - The field used to sort results by. The default is `CREATED_AT`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Payment, ListPaymentsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/payments", - method="GET", - params={ - "begin_time": begin_time, - "end_time": end_time, - "sort_order": sort_order, - "cursor": cursor, - "location_id": location_id, - "total": total, - "last_4": last4, - "card_brand": card_brand, - "limit": limit, - "is_offline_payment": is_offline_payment, - "offline_begin_time": offline_begin_time, - "offline_end_time": offline_end_time, - "updated_at_begin_time": updated_at_begin_time, - "updated_at_end_time": updated_at_end_time, - "sort_field": sort_field, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPaymentsResponse, - construct_type( - type_=ListPaymentsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payments - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=_parsed_next, - location_id=location_id, - total=total, - last4=last4, - card_brand=card_brand, - limit=limit, - is_offline_payment=is_offline_payment, - offline_begin_time=offline_begin_time, - offline_end_time=offline_end_time, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -494,8 +321,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel_by_idempotency_key( self, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -550,8 +377,8 @@ def cancel_by_idempotency_key( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -589,8 +416,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -653,8 +480,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -693,8 +520,8 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def complete( self, @@ -751,187 +578,14 @@ def complete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawPaymentsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - sort_order: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - total: typing.Optional[int] = None, - last4: typing.Optional[str] = None, - card_brand: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - is_offline_payment: typing.Optional[bool] = None, - offline_begin_time: typing.Optional[str] = None, - offline_end_time: typing.Optional[str] = None, - updated_at_begin_time: typing.Optional[str] = None, - updated_at_end_time: typing.Optional[str] = None, - sort_field: typing.Optional[ListPaymentsRequestSortField] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payment, ListPaymentsResponse]: - """ - Retrieves a list of payments taken by the account making the request. - - Results are eventually consistent, and new payments or changes to payments might take several - seconds to appear. - - The maximum results per page is 100. - - Parameters - ---------- - begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve payments for, in RFC 3339 format. - The range is determined using the `created_at` field for each Payment. - Inclusive. Default: The current time minus one year. - - end_time : typing.Optional[str] - Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - range is determined using the `created_at` field for each Payment. - - Default: The current time. - - sort_order : typing.Optional[str] - The order in which results are listed by `ListPaymentsRequest.sort_field`: - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - location_id : typing.Optional[str] - Limit results to the location supplied. By default, results are returned - for the default (main) location associated with the seller. - - total : typing.Optional[int] - The exact amount in the `total_money` for a payment. - - last4 : typing.Optional[str] - The last four digits of a payment card. - - card_brand : typing.Optional[str] - The brand of the payment card (for example, VISA). - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - - The default value of 100 is also the maximum allowed value. If the provided value is - greater than 100, it is ignored and the default value is used instead. - - Default: `100` - - is_offline_payment : typing.Optional[bool] - Whether the payment was taken offline or not. - - offline_begin_time : typing.Optional[str] - Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 - format for timestamps. The range is determined using the - `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - value set in `offline_payment_details.client_created_at` will not be returned. - - Default: The current time. - - offline_end_time : typing.Optional[str] - Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 - format for timestamps. The range is determined using the - `offline_payment_details.client_created_at` field for each Payment. If set, payments without a - value set in `offline_payment_details.client_created_at` will not be returned. - - Default: The current time. - - updated_at_begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The - range is determined using the `updated_at` field for each Payment. - - updated_at_end_time : typing.Optional[str] - Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The - range is determined using the `updated_at` field for each Payment. - - sort_field : typing.Optional[ListPaymentsRequestSortField] - The field used to sort results by. The default is `CREATED_AT`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Payment, ListPaymentsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/payments", - method="GET", - params={ - "begin_time": begin_time, - "end_time": end_time, - "sort_order": sort_order, - "cursor": cursor, - "location_id": location_id, - "total": total, - "last_4": last4, - "card_brand": card_brand, - "limit": limit, - "is_offline_payment": is_offline_payment, - "offline_begin_time": offline_begin_time, - "offline_end_time": offline_end_time, - "updated_at_begin_time": updated_at_begin_time, - "updated_at_end_time": updated_at_end_time, - "sort_field": sort_field, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPaymentsResponse, - construct_type( - type_=ListPaymentsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payments - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=_parsed_next, - location_id=location_id, - total=total, - last4=last4, - card_brand=card_brand, - limit=limit, - is_offline_payment=is_offline_payment, - offline_begin_time=offline_begin_time, - offline_end_time=offline_end_time, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -1220,8 +874,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel_by_idempotency_key( self, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -1276,8 +930,8 @@ async def cancel_by_idempotency_key( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1315,8 +969,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -1379,8 +1033,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, payment_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1419,8 +1073,8 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def complete( self, @@ -1477,5 +1131,5 @@ async def complete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/payouts/__init__.py b/src/square/payouts/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/payouts/__init__.py +++ b/src/square/payouts/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/payouts/client.py b/src/square/payouts/client.py index 1c34a918..906e953a 100644 --- a/src/square/payouts/client.py +++ b/src/square/payouts/client.py @@ -1,18 +1,24 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawPayoutsClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..types.payout_status import PayoutStatus +from ..types.sort_order import SortOrder from ..core.request_options import RequestOptions -from ..types.get_payout_response import GetPayoutResponse -from ..types.list_payout_entries_response import ListPayoutEntriesResponse -from ..types.list_payouts_response import ListPayoutsResponse +from ..core.pagination import SyncPager from ..types.payout import Payout +from ..types.list_payouts_response import ListPayoutsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.get_payout_response import GetPayoutResponse from ..types.payout_entry import PayoutEntry -from ..types.payout_status import PayoutStatus -from ..types.sort_order import SortOrder -from .raw_client import AsyncRawPayoutsClient, RawPayoutsClient +from ..core.jsonable_encoder import jsonable_encoder +from ..types.list_payout_entries_response import ListPayoutEntriesResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawPayoutsClient +from ..core.pagination import AsyncPager class PayoutsClient: @@ -41,7 +47,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payout, ListPayoutsResponse]: + ) -> SyncPager[Payout]: """ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. @@ -85,7 +91,7 @@ def list( Returns ------- - SyncPager[Payout, ListPayoutsResponse] + SyncPager[Payout] Success Examples @@ -110,16 +116,47 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - location_id=location_id, - status=status, - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=cursor, - limit=limit, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/payouts", + method="GET", + params={ + "location_id": location_id, + "status": status, + "begin_time": begin_time, + "end_time": end_time, + "sort_order": sort_order, + "cursor": cursor, + "limit": limit, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPayoutsResponse, + construct_type( + type_=ListPayoutsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + status=status, + begin_time=begin_time, + end_time=end_time, + sort_order=sort_order, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.payouts + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get(self, payout_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetPayoutResponse: """ @@ -150,8 +187,8 @@ def get(self, payout_id: str, *, request_options: typing.Optional[RequestOptions payout_id="payout_id", ) """ - _response = self._raw_client.get(payout_id, request_options=request_options) - return _response.data + response = self._raw_client.get(payout_id, request_options=request_options) + return response.data def list_entries( self, @@ -161,7 +198,7 @@ def list_entries( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PayoutEntry, ListPayoutEntriesResponse]: + ) -> SyncPager[PayoutEntry]: """ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. @@ -192,7 +229,7 @@ def list_entries( Returns ------- - SyncPager[PayoutEntry, ListPayoutEntriesResponse] + SyncPager[PayoutEntry] Success Examples @@ -214,9 +251,40 @@ def list_entries( for page in response.iter_pages(): yield page """ - return self._raw_client.list_entries( - payout_id, sort_order=sort_order, cursor=cursor, limit=limit, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/payouts/{jsonable_encoder(payout_id)}/payout-entries", + method="GET", + params={ + "sort_order": sort_order, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPayoutEntriesResponse, + construct_type( + type_=ListPayoutEntriesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list_entries( + payout_id, + sort_order=sort_order, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.payout_entries + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncPayoutsClient: @@ -245,7 +313,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payout, ListPayoutsResponse]: + ) -> AsyncPager[Payout]: """ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. @@ -289,7 +357,7 @@ async def list( Returns ------- - AsyncPager[Payout, ListPayoutsResponse] + AsyncPager[Payout] Success Examples @@ -315,7 +383,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -323,16 +390,47 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - location_id=location_id, - status=status, - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=cursor, - limit=limit, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/payouts", + method="GET", + params={ + "location_id": location_id, + "status": status, + "begin_time": begin_time, + "end_time": end_time, + "sort_order": sort_order, + "cursor": cursor, + "limit": limit, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPayoutsResponse, + construct_type( + type_=ListPayoutsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + location_id=location_id, + status=status, + begin_time=begin_time, + end_time=end_time, + sort_order=sort_order, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.payouts + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, payout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -373,8 +471,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(payout_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(payout_id, request_options=request_options) + return response.data async def list_entries( self, @@ -384,7 +482,7 @@ async def list_entries( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PayoutEntry, ListPayoutEntriesResponse]: + ) -> AsyncPager[PayoutEntry]: """ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. @@ -415,7 +513,7 @@ async def list_entries( Returns ------- - AsyncPager[PayoutEntry, ListPayoutEntriesResponse] + AsyncPager[PayoutEntry] Success Examples @@ -438,7 +536,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -446,6 +543,37 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list_entries( - payout_id, sort_order=sort_order, cursor=cursor, limit=limit, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/payouts/{jsonable_encoder(payout_id)}/payout-entries", + method="GET", + params={ + "sort_order": sort_order, + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPayoutEntriesResponse, + construct_type( + type_=ListPayoutEntriesResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list_entries( + payout_id, + sort_order=sort_order, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.payout_entries + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/payouts/raw_client.py b/src/square/payouts/raw_client.py index 87bfcff9..447a4721 100644 --- a/src/square/payouts/raw_client.py +++ b/src/square/payouts/raw_client.py @@ -1,128 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.http_response import HttpResponse from ..types.get_payout_response import GetPayoutResponse -from ..types.list_payout_entries_response import ListPayoutEntriesResponse -from ..types.list_payouts_response import ListPayoutsResponse -from ..types.payout import Payout -from ..types.payout_entry import PayoutEntry -from ..types.payout_status import PayoutStatus -from ..types.sort_order import SortOrder +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawPayoutsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - location_id: typing.Optional[str] = None, - status: typing.Optional[PayoutStatus] = None, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - sort_order: typing.Optional[SortOrder] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payout, ListPayoutsResponse]: - """ - Retrieves a list of all payouts for the default location. - You can filter payouts by location ID, status, time range, and order them in ascending or descending order. - To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - - Parameters - ---------- - location_id : typing.Optional[str] - The ID of the location for which to list the payouts. - By default, payouts are returned for the default (main) location associated with the seller. - - status : typing.Optional[PayoutStatus] - If provided, only payouts with the given status are returned. - - begin_time : typing.Optional[str] - The timestamp for the beginning of the payout creation time, in RFC 3339 format. - Inclusive. Default: The current time minus one year. - - end_time : typing.Optional[str] - The timestamp for the end of the payout creation time, in RFC 3339 format. - Default: The current time. - - sort_order : typing.Optional[SortOrder] - The order in which payouts are listed. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - If request parameters change between requests, subsequent results may contain duplicates or missing records. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - The default value of 100 is also the maximum allowed value. If the provided value is - greater than 100, it is ignored and the default value is used instead. - Default: `100` - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Payout, ListPayoutsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/payouts", - method="GET", - params={ - "location_id": location_id, - "status": status, - "begin_time": begin_time, - "end_time": end_time, - "sort_order": sort_order, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPayoutsResponse, - construct_type( - type_=ListPayoutsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payouts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - location_id=location_id, - status=status, - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( self, payout_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetPayoutResponse]: @@ -160,194 +54,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list_entries( - self, - payout_id: str, - *, - sort_order: typing.Optional[SortOrder] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PayoutEntry, ListPayoutEntriesResponse]: - """ - Retrieves a list of all payout entries for a specific payout. - To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - - Parameters - ---------- - payout_id : str - The ID of the payout to retrieve the information for. - - sort_order : typing.Optional[SortOrder] - The order in which payout entries are listed. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - If request parameters change between requests, subsequent results may contain duplicates or missing records. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - The default value of 100 is also the maximum allowed value. If the provided value is - greater than 100, it is ignored and the default value is used instead. - Default: `100` - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[PayoutEntry, ListPayoutEntriesResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/payouts/{jsonable_encoder(payout_id)}/payout-entries", - method="GET", - params={ - "sort_order": sort_order, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPayoutEntriesResponse, - construct_type( - type_=ListPayoutEntriesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payout_entries - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list_entries( - payout_id, - sort_order=sort_order, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawPayoutsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - location_id: typing.Optional[str] = None, - status: typing.Optional[PayoutStatus] = None, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - sort_order: typing.Optional[SortOrder] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payout, ListPayoutsResponse]: - """ - Retrieves a list of all payouts for the default location. - You can filter payouts by location ID, status, time range, and order them in ascending or descending order. - To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - - Parameters - ---------- - location_id : typing.Optional[str] - The ID of the location for which to list the payouts. - By default, payouts are returned for the default (main) location associated with the seller. - - status : typing.Optional[PayoutStatus] - If provided, only payouts with the given status are returned. - - begin_time : typing.Optional[str] - The timestamp for the beginning of the payout creation time, in RFC 3339 format. - Inclusive. Default: The current time minus one year. - - end_time : typing.Optional[str] - The timestamp for the end of the payout creation time, in RFC 3339 format. - Default: The current time. - - sort_order : typing.Optional[SortOrder] - The order in which payouts are listed. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - If request parameters change between requests, subsequent results may contain duplicates or missing records. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - The default value of 100 is also the maximum allowed value. If the provided value is - greater than 100, it is ignored and the default value is used instead. - Default: `100` - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Payout, ListPayoutsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/payouts", - method="GET", - params={ - "location_id": location_id, - "status": status, - "begin_time": begin_time, - "end_time": end_time, - "sort_order": sort_order, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPayoutsResponse, - construct_type( - type_=ListPayoutsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payouts - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - location_id=location_id, - status=status, - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def get( self, payout_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetPayoutResponse]: @@ -385,85 +99,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list_entries( - self, - payout_id: str, - *, - sort_order: typing.Optional[SortOrder] = None, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PayoutEntry, ListPayoutEntriesResponse]: - """ - Retrieves a list of all payout entries for a specific payout. - To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - - Parameters - ---------- - payout_id : str - The ID of the payout to retrieve the information for. - - sort_order : typing.Optional[SortOrder] - The order in which payout entries are listed. - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - If request parameters change between requests, subsequent results may contain duplicates or missing records. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - The default value of 100 is also the maximum allowed value. If the provided value is - greater than 100, it is ignored and the default value is used instead. - Default: `100` - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[PayoutEntry, ListPayoutEntriesResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/payouts/{jsonable_encoder(payout_id)}/payout-entries", - method="GET", - params={ - "sort_order": sort_order, - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPayoutEntriesResponse, - construct_type( - type_=ListPayoutEntriesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.payout_entries - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list_entries( - payout_id, - sort_order=sort_order, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/refunds/__init__.py b/src/square/refunds/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/refunds/__init__.py +++ b/src/square/refunds/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/refunds/client.py b/src/square/refunds/client.py index f3aa76d2..c4e9ee24 100644 --- a/src/square/refunds/client.py +++ b/src/square/refunds/client.py @@ -1,19 +1,24 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawRefundsClient +from ..types.list_payment_refunds_request_sort_field import ListPaymentRefundsRequestSortField from ..core.request_options import RequestOptions +from ..core.pagination import SyncPager +from ..types.payment_refund import PaymentRefund +from ..types.list_payment_refunds_response import ListPaymentRefundsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..requests.money import MoneyParams from ..requests.destination_details_cash_refund_details import DestinationDetailsCashRefundDetailsParams from ..requests.destination_details_external_refund_details import DestinationDetailsExternalRefundDetailsParams -from ..requests.money import MoneyParams -from ..types.get_payment_refund_response import GetPaymentRefundResponse -from ..types.list_payment_refunds_request_sort_field import ListPaymentRefundsRequestSortField -from ..types.list_payment_refunds_response import ListPaymentRefundsResponse -from ..types.payment_refund import PaymentRefund from ..types.refund_payment_response import RefundPaymentResponse -from .raw_client import AsyncRawRefundsClient, RawRefundsClient +from ..types.get_payment_refund_response import GetPaymentRefundResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawRefundsClient +from ..core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -49,7 +54,7 @@ def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentRefund, ListPaymentRefundsResponse]: + ) -> SyncPager[PaymentRefund]: """ Retrieves a list of refunds for the account making the request. @@ -130,7 +135,7 @@ def list( Returns ------- - SyncPager[PaymentRefund, ListPaymentRefundsResponse] + SyncPager[PaymentRefund] Success Examples @@ -159,20 +164,55 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=cursor, - location_id=location_id, - status=status, - source_type=source_type, - limit=limit, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/refunds", + method="GET", + params={ + "begin_time": begin_time, + "end_time": end_time, + "sort_order": sort_order, + "cursor": cursor, + "location_id": location_id, + "status": status, + "source_type": source_type, + "limit": limit, + "updated_at_begin_time": updated_at_begin_time, + "updated_at_end_time": updated_at_end_time, + "sort_field": sort_field, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPaymentRefundsResponse, + construct_type( + type_=ListPaymentRefundsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + begin_time=begin_time, + end_time=end_time, + sort_order=sort_order, + cursor=_parsed_next, + location_id=location_id, + status=status, + source_type=source_type, + limit=limit, + updated_at_begin_time=updated_at_begin_time, + updated_at_end_time=updated_at_end_time, + sort_field=sort_field, + request_options=request_options, + ) + _items = _parsed_response.refunds + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def refund_payment( self, @@ -306,7 +346,7 @@ def refund_payment( reason="Example", ) """ - _response = self._raw_client.refund_payment( + response = self._raw_client.refund_payment( idempotency_key=idempotency_key, amount_money=amount_money, app_fee_money=app_fee_money, @@ -322,7 +362,7 @@ def refund_payment( external_details=external_details, request_options=request_options, ) - return _response.data + return response.data def get( self, refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -354,8 +394,8 @@ def get( refund_id="refund_id", ) """ - _response = self._raw_client.get(refund_id, request_options=request_options) - return _response.data + response = self._raw_client.get(refund_id, request_options=request_options) + return response.data class AsyncRefundsClient: @@ -388,7 +428,7 @@ async def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentRefund, ListPaymentRefundsResponse]: + ) -> AsyncPager[PaymentRefund]: """ Retrieves a list of refunds for the account making the request. @@ -469,7 +509,7 @@ async def list( Returns ------- - AsyncPager[PaymentRefund, ListPaymentRefundsResponse] + AsyncPager[PaymentRefund] Success Examples @@ -499,7 +539,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -507,20 +546,55 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=cursor, - location_id=location_id, - status=status, - source_type=source_type, - limit=limit, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/refunds", + method="GET", + params={ + "begin_time": begin_time, + "end_time": end_time, + "sort_order": sort_order, + "cursor": cursor, + "location_id": location_id, + "status": status, + "source_type": source_type, + "limit": limit, + "updated_at_begin_time": updated_at_begin_time, + "updated_at_end_time": updated_at_end_time, + "sort_field": sort_field, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListPaymentRefundsResponse, + construct_type( + type_=ListPaymentRefundsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + begin_time=begin_time, + end_time=end_time, + sort_order=sort_order, + cursor=_parsed_next, + location_id=location_id, + status=status, + source_type=source_type, + limit=limit, + updated_at_begin_time=updated_at_begin_time, + updated_at_end_time=updated_at_end_time, + sort_field=sort_field, + request_options=request_options, + ) + _items = _parsed_response.refunds + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def refund_payment( self, @@ -662,7 +736,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.refund_payment( + response = await self._raw_client.refund_payment( idempotency_key=idempotency_key, amount_money=amount_money, app_fee_money=app_fee_money, @@ -678,7 +752,7 @@ async def main() -> None: external_details=external_details, request_options=request_options, ) - return _response.data + return response.data async def get( self, refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -718,5 +792,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(refund_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(refund_id, request_options=request_options) + return response.data diff --git a/src/square/refunds/raw_client.py b/src/square/refunds/raw_client.py index 9c19e203..750ef8f0 100644 --- a/src/square/refunds/raw_client.py +++ b/src/square/refunds/raw_client.py @@ -1,24 +1,21 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.money import MoneyParams +from ..requests.destination_details_cash_refund_details import DestinationDetailsCashRefundDetailsParams +from ..requests.destination_details_external_refund_details import DestinationDetailsExternalRefundDetailsParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.refund_payment_response import RefundPaymentResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.destination_details_cash_refund_details import DestinationDetailsCashRefundDetailsParams -from ..requests.destination_details_external_refund_details import DestinationDetailsExternalRefundDetailsParams -from ..requests.money import MoneyParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.get_payment_refund_response import GetPaymentRefundResponse -from ..types.list_payment_refunds_request_sort_field import ListPaymentRefundsRequestSortField -from ..types.list_payment_refunds_response import ListPaymentRefundsResponse -from ..types.payment_refund import PaymentRefund -from ..types.refund_payment_response import RefundPaymentResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -28,155 +25,6 @@ class RawRefundsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - sort_order: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - status: typing.Optional[str] = None, - source_type: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - updated_at_begin_time: typing.Optional[str] = None, - updated_at_end_time: typing.Optional[str] = None, - sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentRefund, ListPaymentRefundsResponse]: - """ - Retrieves a list of refunds for the account making the request. - - Results are eventually consistent, and new refunds or changes to refunds might take several - seconds to appear. - - The maximum results per page is 100. - - Parameters - ---------- - begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `created_at` field for each `PaymentRefund`. - - Default: The current time minus one year. - - end_time : typing.Optional[str] - Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `created_at` field for each `PaymentRefund`. - - Default: The current time. - - sort_order : typing.Optional[str] - The order in which results are listed by `PaymentRefund.created_at`: - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - location_id : typing.Optional[str] - Limit results to the location supplied. By default, results are returned - for all locations associated with the seller. - - status : typing.Optional[str] - If provided, only refunds with the given status are returned. - For a list of refund status values, see [PaymentRefund](entity:PaymentRefund). - - Default: If omitted, refunds are returned regardless of their status. - - source_type : typing.Optional[str] - If provided, only returns refunds whose payments have the indicated source type. - Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`. - For information about these payment source types, see - [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - - Default: If omitted, refunds are returned regardless of the source type. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - - It is possible to receive fewer results than the specified limit on a given page. - - If the supplied value is greater than 100, no more than 100 results are returned. - - Default: 100 - - updated_at_begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `updated_at` field for each `PaymentRefund`. - - Default: If omitted, the time range starts at `begin_time`. - - updated_at_end_time : typing.Optional[str] - Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `updated_at` field for each `PaymentRefund`. - - Default: The current time. - - sort_field : typing.Optional[ListPaymentRefundsRequestSortField] - The field used to sort results by. The default is `CREATED_AT`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[PaymentRefund, ListPaymentRefundsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/refunds", - method="GET", - params={ - "begin_time": begin_time, - "end_time": end_time, - "sort_order": sort_order, - "cursor": cursor, - "location_id": location_id, - "status": status, - "source_type": source_type, - "limit": limit, - "updated_at_begin_time": updated_at_begin_time, - "updated_at_end_time": updated_at_end_time, - "sort_field": sort_field, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPaymentRefundsResponse, - construct_type( - type_=ListPaymentRefundsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.refunds - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=_parsed_next, - location_id=location_id, - status=status, - source_type=source_type, - limit=limit, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def refund_payment( self, *, @@ -340,8 +188,8 @@ def refund_payment( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -379,166 +227,14 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawRefundsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - begin_time: typing.Optional[str] = None, - end_time: typing.Optional[str] = None, - sort_order: typing.Optional[str] = None, - cursor: typing.Optional[str] = None, - location_id: typing.Optional[str] = None, - status: typing.Optional[str] = None, - source_type: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - updated_at_begin_time: typing.Optional[str] = None, - updated_at_end_time: typing.Optional[str] = None, - sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentRefund, ListPaymentRefundsResponse]: - """ - Retrieves a list of refunds for the account making the request. - - Results are eventually consistent, and new refunds or changes to refunds might take several - seconds to appear. - - The maximum results per page is 100. - - Parameters - ---------- - begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `created_at` field for each `PaymentRefund`. - - Default: The current time minus one year. - - end_time : typing.Optional[str] - Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `created_at` field for each `PaymentRefund`. - - Default: The current time. - - sort_order : typing.Optional[str] - The order in which results are listed by `PaymentRefund.created_at`: - - `ASC` - Oldest to newest. - - `DESC` - Newest to oldest (default). - - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this cursor to retrieve the next set of results for the original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - location_id : typing.Optional[str] - Limit results to the location supplied. By default, results are returned - for all locations associated with the seller. - - status : typing.Optional[str] - If provided, only refunds with the given status are returned. - For a list of refund status values, see [PaymentRefund](entity:PaymentRefund). - - Default: If omitted, refunds are returned regardless of their status. - - source_type : typing.Optional[str] - If provided, only returns refunds whose payments have the indicated source type. - Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`. - For information about these payment source types, see - [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). - - Default: If omitted, refunds are returned regardless of the source type. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - - It is possible to receive fewer results than the specified limit on a given page. - - If the supplied value is greater than 100, no more than 100 results are returned. - - Default: 100 - - updated_at_begin_time : typing.Optional[str] - Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `updated_at` field for each `PaymentRefund`. - - Default: If omitted, the time range starts at `begin_time`. - - updated_at_end_time : typing.Optional[str] - Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 - format. The range is determined using the `updated_at` field for each `PaymentRefund`. - - Default: The current time. - - sort_field : typing.Optional[ListPaymentRefundsRequestSortField] - The field used to sort results by. The default is `CREATED_AT`. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[PaymentRefund, ListPaymentRefundsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/refunds", - method="GET", - params={ - "begin_time": begin_time, - "end_time": end_time, - "sort_order": sort_order, - "cursor": cursor, - "location_id": location_id, - "status": status, - "source_type": source_type, - "limit": limit, - "updated_at_begin_time": updated_at_begin_time, - "updated_at_end_time": updated_at_end_time, - "sort_field": sort_field, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListPaymentRefundsResponse, - construct_type( - type_=ListPaymentRefundsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.refunds - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - begin_time=begin_time, - end_time=end_time, - sort_order=sort_order, - cursor=_parsed_next, - location_id=location_id, - status=status, - source_type=source_type, - limit=limit, - updated_at_begin_time=updated_at_begin_time, - updated_at_end_time=updated_at_end_time, - sort_field=sort_field, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def refund_payment( self, *, @@ -702,8 +398,8 @@ async def refund_payment( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -741,5 +437,5 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/requests/__init__.py b/src/square/requests/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/requests/__init__.py +++ b/src/square/requests/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/requests/accept_dispute_response.py b/src/square/requests/accept_dispute_response.py index 358b86f6..bac64b8e 100644 --- a/src/square/requests/accept_dispute_response.py +++ b/src/square/requests/accept_dispute_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute import DisputeParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute import DisputeParams class AcceptDisputeResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/accepted_payment_methods.py b/src/square/requests/accepted_payment_methods.py index 0abbacb2..b8193815 100644 --- a/src/square/requests/accepted_payment_methods.py +++ b/src/square/requests/accepted_payment_methods.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class AcceptedPaymentMethodsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/accumulate_loyalty_points_response.py b/src/square/requests/accumulate_loyalty_points_response.py index 8d621493..6035854e 100644 --- a/src/square/requests/accumulate_loyalty_points_response.py +++ b/src/square/requests/accumulate_loyalty_points_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_event import LoyaltyEventParams diff --git a/src/square/requests/ach_details.py b/src/square/requests/ach_details.py index dc75d5f0..2a5f34dc 100644 --- a/src/square/requests/ach_details.py +++ b/src/square/requests/ach_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class AchDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/add_group_to_customer_response.py b/src/square/requests/add_group_to_customer_response.py index ecf1452b..f35bd007 100644 --- a/src/square/requests/add_group_to_customer_response.py +++ b/src/square/requests/add_group_to_customer_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/additional_recipient.py b/src/square/requests/additional_recipient.py index c86d0777..140badcb 100644 --- a/src/square/requests/additional_recipient.py +++ b/src/square/requests/additional_recipient.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/address.py b/src/square/requests/address.py index bd1e5308..7c5b5621 100644 --- a/src/square/requests/address.py +++ b/src/square/requests/address.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..core.serialization import FieldMetadata from ..types.country import Country diff --git a/src/square/requests/adjust_loyalty_points_response.py b/src/square/requests/adjust_loyalty_points_response.py index 9fd2e62a..df752da1 100644 --- a/src/square/requests/adjust_loyalty_points_response.py +++ b/src/square/requests/adjust_loyalty_points_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_event import LoyaltyEventParams diff --git a/src/square/requests/afterpay_details.py b/src/square/requests/afterpay_details.py index 98caa190..a62946a4 100644 --- a/src/square/requests/afterpay_details.py +++ b/src/square/requests/afterpay_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class AfterpayDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/application_details.py b/src/square/requests/application_details.py index bab29397..900b1554 100644 --- a/src/square/requests/application_details.py +++ b/src/square/requests/application_details.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.application_details_external_square_product import ApplicationDetailsExternalSquareProduct +import typing class ApplicationDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/appointment_segment.py b/src/square/requests/appointment_segment.py index 45dc63a1..797f81b9 100644 --- a/src/square/requests/appointment_segment.py +++ b/src/square/requests/appointment_segment.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class AppointmentSegmentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/availability.py b/src/square/requests/availability.py index 4d7446c3..71ed4d52 100644 --- a/src/square/requests/availability.py +++ b/src/square/requests/availability.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .appointment_segment import AppointmentSegmentParams diff --git a/src/square/requests/bank_account.py b/src/square/requests/bank_account.py index d5623f0e..86df7455 100644 --- a/src/square/requests/bank_account.py +++ b/src/square/requests/bank_account.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.bank_account_status import BankAccountStatus -from ..types.bank_account_type import BankAccountType from ..types.country import Country from ..types.currency import Currency +from ..types.bank_account_type import BankAccountType +import typing_extensions +import typing +from ..types.bank_account_status import BankAccountStatus class BankAccountParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bank_account_created_event.py b/src/square/requests/bank_account_created_event.py index ef1a02f6..e7aeb919 100644 --- a/src/square/requests/bank_account_created_event.py +++ b/src/square/requests/bank_account_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bank_account_created_event_data import BankAccountCreatedEventDataParams diff --git a/src/square/requests/bank_account_created_event_data.py b/src/square/requests/bank_account_created_event_data.py index b8091ab0..a4904321 100644 --- a/src/square/requests/bank_account_created_event_data.py +++ b/src/square/requests/bank_account_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bank_account_created_event_object import BankAccountCreatedEventObjectParams diff --git a/src/square/requests/bank_account_created_event_object.py b/src/square/requests/bank_account_created_event_object.py index 5b5144a0..96545ebb 100644 --- a/src/square/requests/bank_account_created_event_object.py +++ b/src/square/requests/bank_account_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .bank_account import BankAccountParams diff --git a/src/square/requests/bank_account_disabled_event.py b/src/square/requests/bank_account_disabled_event.py index 1695ebc5..f343dd8e 100644 --- a/src/square/requests/bank_account_disabled_event.py +++ b/src/square/requests/bank_account_disabled_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bank_account_disabled_event_data import BankAccountDisabledEventDataParams diff --git a/src/square/requests/bank_account_disabled_event_data.py b/src/square/requests/bank_account_disabled_event_data.py index 432f3ef0..cb3fe57d 100644 --- a/src/square/requests/bank_account_disabled_event_data.py +++ b/src/square/requests/bank_account_disabled_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bank_account_disabled_event_object import BankAccountDisabledEventObjectParams diff --git a/src/square/requests/bank_account_disabled_event_object.py b/src/square/requests/bank_account_disabled_event_object.py index 733e544a..605ddc9b 100644 --- a/src/square/requests/bank_account_disabled_event_object.py +++ b/src/square/requests/bank_account_disabled_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .bank_account import BankAccountParams diff --git a/src/square/requests/bank_account_payment_details.py b/src/square/requests/bank_account_payment_details.py index f50e0b3d..e3f18a04 100644 --- a/src/square/requests/bank_account_payment_details.py +++ b/src/square/requests/bank_account_payment_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .ach_details import AchDetailsParams from .error import ErrorParams diff --git a/src/square/requests/bank_account_verified_event.py b/src/square/requests/bank_account_verified_event.py index a0a26d87..18870d99 100644 --- a/src/square/requests/bank_account_verified_event.py +++ b/src/square/requests/bank_account_verified_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bank_account_verified_event_data import BankAccountVerifiedEventDataParams diff --git a/src/square/requests/bank_account_verified_event_data.py b/src/square/requests/bank_account_verified_event_data.py index bd1d7af5..2cf9a96b 100644 --- a/src/square/requests/bank_account_verified_event_data.py +++ b/src/square/requests/bank_account_verified_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bank_account_verified_event_object import BankAccountVerifiedEventObjectParams diff --git a/src/square/requests/bank_account_verified_event_object.py b/src/square/requests/bank_account_verified_event_object.py index 960daec5..86e18931 100644 --- a/src/square/requests/bank_account_verified_event_object.py +++ b/src/square/requests/bank_account_verified_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .bank_account import BankAccountParams diff --git a/src/square/requests/batch_change_inventory_request.py b/src/square/requests/batch_change_inventory_request.py index f0431b4b..d736b7ef 100644 --- a/src/square/requests/batch_change_inventory_request.py +++ b/src/square/requests/batch_change_inventory_request.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .inventory_change import InventoryChangeParams diff --git a/src/square/requests/batch_change_inventory_response.py b/src/square/requests/batch_change_inventory_response.py index 3082632c..f8719ffe 100644 --- a/src/square/requests/batch_change_inventory_response.py +++ b/src/square/requests/batch_change_inventory_response.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams -from .inventory_change import InventoryChangeParams from .inventory_count import InventoryCountParams +from .inventory_change import InventoryChangeParams class BatchChangeInventoryResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_create_team_members_response.py b/src/square/requests/batch_create_team_members_response.py index 21274d20..6df7f48a 100644 --- a/src/square/requests/batch_create_team_members_response.py +++ b/src/square/requests/batch_create_team_members_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .create_team_member_response import CreateTeamMemberResponseParams from .error import ErrorParams diff --git a/src/square/requests/batch_create_vendors_response.py b/src/square/requests/batch_create_vendors_response.py index 459aee16..4fd7cf78 100644 --- a/src/square/requests/batch_create_vendors_response.py +++ b/src/square/requests/batch_create_vendors_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .create_vendor_response import CreateVendorResponseParams +import typing_extensions +import typing from .error import ErrorParams +from .create_vendor_response import CreateVendorResponseParams class BatchCreateVendorsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_delete_catalog_objects_response.py b/src/square/requests/batch_delete_catalog_objects_response.py index e62f72b4..93a7bfd9 100644 --- a/src/square/requests/batch_delete_catalog_objects_response.py +++ b/src/square/requests/batch_delete_catalog_objects_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/batch_get_catalog_objects_response.py b/src/square/requests/batch_get_catalog_objects_response.py index 3365036e..cbb6c2f2 100644 --- a/src/square/requests/batch_get_catalog_objects_response.py +++ b/src/square/requests/batch_get_catalog_objects_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class BatchGetCatalogObjectsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_get_inventory_changes_response.py b/src/square/requests/batch_get_inventory_changes_response.py index 02572308..d98b9cc4 100644 --- a/src/square/requests/batch_get_inventory_changes_response.py +++ b/src/square/requests/batch_get_inventory_changes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_change import InventoryChangeParams diff --git a/src/square/requests/batch_get_inventory_counts_request.py b/src/square/requests/batch_get_inventory_counts_request.py index bc4d2231..8e681750 100644 --- a/src/square/requests/batch_get_inventory_counts_request.py +++ b/src/square/requests/batch_get_inventory_counts_request.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.inventory_state import InventoryState diff --git a/src/square/requests/batch_get_inventory_counts_response.py b/src/square/requests/batch_get_inventory_counts_response.py index 3ad8c952..df61152b 100644 --- a/src/square/requests/batch_get_inventory_counts_response.py +++ b/src/square/requests/batch_get_inventory_counts_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_count import InventoryCountParams diff --git a/src/square/requests/batch_get_orders_response.py b/src/square/requests/batch_get_orders_response.py index 0acdaa86..dd2377db 100644 --- a/src/square/requests/batch_get_orders_response.py +++ b/src/square/requests/batch_get_orders_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .order import OrderParams +from .error import ErrorParams class BatchGetOrdersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_get_vendors_response.py b/src/square/requests/batch_get_vendors_response.py index d4cf11a7..7a32de9b 100644 --- a/src/square/requests/batch_get_vendors_response.py +++ b/src/square/requests/batch_get_vendors_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .get_vendor_response import GetVendorResponseParams diff --git a/src/square/requests/batch_retrieve_inventory_changes_request.py b/src/square/requests/batch_retrieve_inventory_changes_request.py index aff54c23..d66ed4f1 100644 --- a/src/square/requests/batch_retrieve_inventory_changes_request.py +++ b/src/square/requests/batch_retrieve_inventory_changes_request.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.inventory_change_type import InventoryChangeType from ..types.inventory_state import InventoryState diff --git a/src/square/requests/batch_update_team_members_response.py b/src/square/requests/batch_update_team_members_response.py index bba659d7..769388b2 100644 --- a/src/square/requests/batch_update_team_members_response.py +++ b/src/square/requests/batch_update_team_members_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .update_team_member_response import UpdateTeamMemberResponseParams +from .error import ErrorParams class BatchUpdateTeamMembersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_update_vendors_response.py b/src/square/requests/batch_update_vendors_response.py index fd327cc1..305cc20c 100644 --- a/src/square/requests/batch_update_vendors_response.py +++ b/src/square/requests/batch_update_vendors_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .update_vendor_response import UpdateVendorResponseParams diff --git a/src/square/requests/batch_upsert_catalog_objects_response.py b/src/square/requests/batch_upsert_catalog_objects_response.py index 4d7c8106..f1118b81 100644 --- a/src/square/requests/batch_upsert_catalog_objects_response.py +++ b/src/square/requests/batch_upsert_catalog_objects_response.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_id_mapping import CatalogIdMappingParams -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams +from .catalog_id_mapping import CatalogIdMappingParams class BatchUpsertCatalogObjectsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py b/src/square/requests/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py index 91807d6f..69a5a615 100644 --- a/src/square/requests/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py +++ b/src/square/requests/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from .custom_attribute import CustomAttributeParams +import typing_extensions +import typing class BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequestParams(typing_extensions.TypedDict): diff --git a/src/square/requests/batch_upsert_customer_custom_attributes_response.py b/src/square/requests/batch_upsert_customer_custom_attributes_response.py index 31b0bb5e..ed2d79ad 100644 --- a/src/square/requests/batch_upsert_customer_custom_attributes_response.py +++ b/src/square/requests/batch_upsert_customer_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response import ( BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponseParams, ) diff --git a/src/square/requests/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py b/src/square/requests/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py index ee54f4d5..c6e6375b 100644 --- a/src/square/requests/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py +++ b/src/square/requests/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/booking.py b/src/square/requests/booking.py index 238b18f7..8542f9a1 100644 --- a/src/square/requests/booking.py +++ b/src/square/requests/booking.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.booking_booking_source import BookingBookingSource +import typing_extensions from ..types.booking_status import BookingStatus -from ..types.business_appointment_settings_booking_location_type import BusinessAppointmentSettingsBookingLocationType -from .address import AddressParams +import typing from .appointment_segment import AppointmentSegmentParams +from ..types.business_appointment_settings_booking_location_type import BusinessAppointmentSettingsBookingLocationType from .booking_creator_details import BookingCreatorDetailsParams +from ..types.booking_booking_source import BookingBookingSource +from .address import AddressParams class BookingParams(typing_extensions.TypedDict): diff --git a/src/square/requests/booking_created_event.py b/src/square/requests/booking_created_event.py index d7899af1..99117b52 100644 --- a/src/square/requests/booking_created_event.py +++ b/src/square/requests/booking_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking_created_event_data import BookingCreatedEventDataParams diff --git a/src/square/requests/booking_created_event_data.py b/src/square/requests/booking_created_event_data.py index c7b82907..cca671ad 100644 --- a/src/square/requests/booking_created_event_data.py +++ b/src/square/requests/booking_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking_created_event_object import BookingCreatedEventObjectParams diff --git a/src/square/requests/booking_created_event_object.py b/src/square/requests/booking_created_event_object.py index 7455923d..376a2a5b 100644 --- a/src/square/requests/booking_created_event_object.py +++ b/src/square/requests/booking_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .booking import BookingParams diff --git a/src/square/requests/booking_creator_details.py b/src/square/requests/booking_creator_details.py index fa8f39ec..878a8500 100644 --- a/src/square/requests/booking_creator_details.py +++ b/src/square/requests/booking_creator_details.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.booking_creator_details_creator_type import BookingCreatorDetailsCreatorType diff --git a/src/square/requests/booking_custom_attribute_definition_owned_created_event.py b/src/square/requests/booking_custom_attribute_definition_owned_created_event.py index 76423654..2f579450 100644 --- a/src/square/requests/booking_custom_attribute_definition_owned_created_event.py +++ b/src/square/requests/booking_custom_attribute_definition_owned_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/booking_custom_attribute_definition_owned_deleted_event.py b/src/square/requests/booking_custom_attribute_definition_owned_deleted_event.py index f3544ec1..52e3ecb6 100644 --- a/src/square/requests/booking_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/requests/booking_custom_attribute_definition_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/booking_custom_attribute_definition_owned_updated_event.py b/src/square/requests/booking_custom_attribute_definition_owned_updated_event.py index 18687fc1..81025b66 100644 --- a/src/square/requests/booking_custom_attribute_definition_owned_updated_event.py +++ b/src/square/requests/booking_custom_attribute_definition_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/booking_custom_attribute_definition_visible_created_event.py b/src/square/requests/booking_custom_attribute_definition_visible_created_event.py index a7640ae6..a805e525 100644 --- a/src/square/requests/booking_custom_attribute_definition_visible_created_event.py +++ b/src/square/requests/booking_custom_attribute_definition_visible_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/booking_custom_attribute_definition_visible_deleted_event.py b/src/square/requests/booking_custom_attribute_definition_visible_deleted_event.py index 5450aa76..0bc1dfbf 100644 --- a/src/square/requests/booking_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/requests/booking_custom_attribute_definition_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/booking_custom_attribute_definition_visible_updated_event.py b/src/square/requests/booking_custom_attribute_definition_visible_updated_event.py index bfb8f94a..9d3c40c8 100644 --- a/src/square/requests/booking_custom_attribute_definition_visible_updated_event.py +++ b/src/square/requests/booking_custom_attribute_definition_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/booking_custom_attribute_delete_response.py b/src/square/requests/booking_custom_attribute_delete_response.py index 50c1b51f..e2f18380 100644 --- a/src/square/requests/booking_custom_attribute_delete_response.py +++ b/src/square/requests/booking_custom_attribute_delete_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/booking_custom_attribute_owned_deleted_event.py b/src/square/requests/booking_custom_attribute_owned_deleted_event.py index a68f6667..d182bcd6 100644 --- a/src/square/requests/booking_custom_attribute_owned_deleted_event.py +++ b/src/square/requests/booking_custom_attribute_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/booking_custom_attribute_owned_updated_event.py b/src/square/requests/booking_custom_attribute_owned_updated_event.py index ccc53db9..4dc0089b 100644 --- a/src/square/requests/booking_custom_attribute_owned_updated_event.py +++ b/src/square/requests/booking_custom_attribute_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/booking_custom_attribute_upsert_request.py b/src/square/requests/booking_custom_attribute_upsert_request.py index 7296205f..5384f71a 100644 --- a/src/square/requests/booking_custom_attribute_upsert_request.py +++ b/src/square/requests/booking_custom_attribute_upsert_request.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from .custom_attribute import CustomAttributeParams +import typing_extensions +import typing class BookingCustomAttributeUpsertRequestParams(typing_extensions.TypedDict): diff --git a/src/square/requests/booking_custom_attribute_upsert_response.py b/src/square/requests/booking_custom_attribute_upsert_response.py index af3d32c6..d9f3e8e7 100644 --- a/src/square/requests/booking_custom_attribute_upsert_response.py +++ b/src/square/requests/booking_custom_attribute_upsert_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/booking_custom_attribute_visible_deleted_event.py b/src/square/requests/booking_custom_attribute_visible_deleted_event.py index 5f1ad6f9..72eedeb8 100644 --- a/src/square/requests/booking_custom_attribute_visible_deleted_event.py +++ b/src/square/requests/booking_custom_attribute_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/booking_custom_attribute_visible_updated_event.py b/src/square/requests/booking_custom_attribute_visible_updated_event.py index 636e5425..3db837ef 100644 --- a/src/square/requests/booking_custom_attribute_visible_updated_event.py +++ b/src/square/requests/booking_custom_attribute_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/booking_updated_event.py b/src/square/requests/booking_updated_event.py index 0a677d28..3b7db441 100644 --- a/src/square/requests/booking_updated_event.py +++ b/src/square/requests/booking_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking_updated_event_data import BookingUpdatedEventDataParams diff --git a/src/square/requests/booking_updated_event_data.py b/src/square/requests/booking_updated_event_data.py index 5cae0fff..f896e68d 100644 --- a/src/square/requests/booking_updated_event_data.py +++ b/src/square/requests/booking_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking_updated_event_object import BookingUpdatedEventObjectParams diff --git a/src/square/requests/booking_updated_event_object.py b/src/square/requests/booking_updated_event_object.py index e2465541..af409f66 100644 --- a/src/square/requests/booking_updated_event_object.py +++ b/src/square/requests/booking_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .booking import BookingParams diff --git a/src/square/requests/break_.py b/src/square/requests/break_.py index 3d92ee8b..411ddd30 100644 --- a/src/square/requests/break_.py +++ b/src/square/requests/break_.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class BreakParams(typing_extensions.TypedDict): diff --git a/src/square/requests/break_type.py b/src/square/requests/break_type.py index cc158217..4632bb07 100644 --- a/src/square/requests/break_type.py +++ b/src/square/requests/break_type.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class BreakTypeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_create_customer_data.py b/src/square/requests/bulk_create_customer_data.py index a31225d7..9c132274 100644 --- a/src/square/requests/bulk_create_customer_data.py +++ b/src/square/requests/bulk_create_customer_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .address import AddressParams from .customer_tax_ids import CustomerTaxIdsParams diff --git a/src/square/requests/bulk_create_customers_response.py b/src/square/requests/bulk_create_customers_response.py index 8133955f..f3addd01 100644 --- a/src/square/requests/bulk_create_customers_response.py +++ b/src/square/requests/bulk_create_customers_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .create_customer_response import CreateCustomerResponseParams from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_booking_custom_attributes_response.py b/src/square/requests/bulk_delete_booking_custom_attributes_response.py index dc814542..493f90c1 100644 --- a/src/square/requests/bulk_delete_booking_custom_attributes_response.py +++ b/src/square/requests/bulk_delete_booking_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking_custom_attribute_delete_response import BookingCustomAttributeDeleteResponseParams from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_customers_response.py b/src/square/requests/bulk_delete_customers_response.py index 47011ae2..96b4349d 100644 --- a/src/square/requests/bulk_delete_customers_response.py +++ b/src/square/requests/bulk_delete_customers_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .delete_customer_response import DeleteCustomerResponseParams from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py b/src/square/requests/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py index 414415e1..77b38c5c 100644 --- a/src/square/requests/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py +++ b/src/square/requests/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequestParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_delete_location_custom_attributes_response.py b/src/square/requests/bulk_delete_location_custom_attributes_response.py index ce23db58..e5fa7b0d 100644 --- a/src/square/requests/bulk_delete_location_custom_attributes_response.py +++ b/src/square/requests/bulk_delete_location_custom_attributes_response.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from .bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response import ( BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponseParams, ) +import typing_extensions from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py b/src/square/requests/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py index 9a45fe72..a46bf4b7 100644 --- a/src/square/requests/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py +++ b/src/square/requests/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py b/src/square/requests/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py index f2f9dbe1..83c086c8 100644 --- a/src/square/requests/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py +++ b/src/square/requests/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequestParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_delete_merchant_custom_attributes_response.py b/src/square/requests/bulk_delete_merchant_custom_attributes_response.py index 8291eaf9..686953b4 100644 --- a/src/square/requests/bulk_delete_merchant_custom_attributes_response.py +++ b/src/square/requests/bulk_delete_merchant_custom_attributes_response.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from .bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response import ( BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponseParams, ) +import typing_extensions from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py b/src/square/requests/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py index 809426e6..8d273b7c 100644 --- a/src/square/requests/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py +++ b/src/square/requests/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py b/src/square/requests/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py index f72c4a90..8007edec 100644 --- a/src/square/requests/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py +++ b/src/square/requests/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class BulkDeleteOrderCustomAttributesRequestDeleteCustomAttributeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_delete_order_custom_attributes_response.py b/src/square/requests/bulk_delete_order_custom_attributes_response.py index 353176d5..4d96949c 100644 --- a/src/square/requests/bulk_delete_order_custom_attributes_response.py +++ b/src/square/requests/bulk_delete_order_custom_attributes_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponseParams +import typing_extensions +import typing from .error import ErrorParams +from .delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponseParams class BulkDeleteOrderCustomAttributesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_publish_scheduled_shifts_data.py b/src/square/requests/bulk_publish_scheduled_shifts_data.py index 17039f6a..9a2cf290 100644 --- a/src/square/requests/bulk_publish_scheduled_shifts_data.py +++ b/src/square/requests/bulk_publish_scheduled_shifts_data.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class BulkPublishScheduledShiftsDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_publish_scheduled_shifts_response.py b/src/square/requests/bulk_publish_scheduled_shifts_response.py index 864a1e4e..c3ff4e01 100644 --- a/src/square/requests/bulk_publish_scheduled_shifts_response.py +++ b/src/square/requests/bulk_publish_scheduled_shifts_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .publish_scheduled_shift_response import PublishScheduledShiftResponseParams +from .error import ErrorParams class BulkPublishScheduledShiftsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_retrieve_bookings_response.py b/src/square/requests/bulk_retrieve_bookings_response.py index 709739f1..5fdf6e01 100644 --- a/src/square/requests/bulk_retrieve_bookings_response.py +++ b/src/square/requests/bulk_retrieve_bookings_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .get_booking_response import GetBookingResponseParams +from .error import ErrorParams class BulkRetrieveBookingsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_retrieve_channels_response.py b/src/square/requests/bulk_retrieve_channels_response.py deleted file mode 100644 index de21568b..00000000 --- a/src/square/requests/bulk_retrieve_channels_response.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .retrieve_channel_response import RetrieveChannelResponseParams - - -class BulkRetrieveChannelsResponseParams(typing_extensions.TypedDict): - """ - Defines the fields that are included in the request body for the - [BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint. - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Information about errors encountered during the request. - """ - - responses: typing_extensions.NotRequired[typing.Dict[str, RetrieveChannelResponseParams]] - """ - A map of channel IDs to channel responses which tell whether - retrieval for a specific channel is success or not. - Channel response of a success retrieval would contain channel info - whereas channel response of a failed retrieval would have error info. - """ diff --git a/src/square/requests/bulk_retrieve_customers_response.py b/src/square/requests/bulk_retrieve_customers_response.py index 098a36ab..80b03a16 100644 --- a/src/square/requests/bulk_retrieve_customers_response.py +++ b/src/square/requests/bulk_retrieve_customers_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .get_customer_response import GetCustomerResponseParams +from .error import ErrorParams class BulkRetrieveCustomersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_retrieve_team_member_booking_profiles_response.py b/src/square/requests/bulk_retrieve_team_member_booking_profiles_response.py index 844ff498..dc4163bd 100644 --- a/src/square/requests/bulk_retrieve_team_member_booking_profiles_response.py +++ b/src/square/requests/bulk_retrieve_team_member_booking_profiles_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponseParams +from .error import ErrorParams class BulkRetrieveTeamMemberBookingProfilesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_swap_plan_response.py b/src/square/requests/bulk_swap_plan_response.py index 0fc63bd6..a0ec5dbf 100644 --- a/src/square/requests/bulk_swap_plan_response.py +++ b/src/square/requests/bulk_swap_plan_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/bulk_update_customer_data.py b/src/square/requests/bulk_update_customer_data.py index 33e3dfbf..ecd5260b 100644 --- a/src/square/requests/bulk_update_customer_data.py +++ b/src/square/requests/bulk_update_customer_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .address import AddressParams from .customer_tax_ids import CustomerTaxIdsParams diff --git a/src/square/requests/bulk_update_customers_response.py b/src/square/requests/bulk_update_customers_response.py index 4fc5b3fc..3dd2b049 100644 --- a/src/square/requests/bulk_update_customers_response.py +++ b/src/square/requests/bulk_update_customers_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .update_customer_response import UpdateCustomerResponseParams +from .error import ErrorParams class BulkUpdateCustomersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_upsert_booking_custom_attributes_response.py b/src/square/requests/bulk_upsert_booking_custom_attributes_response.py index 225d7aff..429a7b32 100644 --- a/src/square/requests/bulk_upsert_booking_custom_attributes_response.py +++ b/src/square/requests/bulk_upsert_booking_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking_custom_attribute_upsert_response import BookingCustomAttributeUpsertResponseParams from .error import ErrorParams diff --git a/src/square/requests/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py b/src/square/requests/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py index f77d7329..b4b6d0df 100644 --- a/src/square/requests/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py +++ b/src/square/requests/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from .custom_attribute import CustomAttributeParams +import typing_extensions +import typing class BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequestParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_upsert_location_custom_attributes_response.py b/src/square/requests/bulk_upsert_location_custom_attributes_response.py index e751d28e..0d5e6a39 100644 --- a/src/square/requests/bulk_upsert_location_custom_attributes_response.py +++ b/src/square/requests/bulk_upsert_location_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response import ( BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponseParams, ) diff --git a/src/square/requests/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py b/src/square/requests/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py index 2059bbb3..9ab91818 100644 --- a/src/square/requests/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py +++ b/src/square/requests/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py b/src/square/requests/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py index 704e933d..87eea5e2 100644 --- a/src/square/requests/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py +++ b/src/square/requests/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from .custom_attribute import CustomAttributeParams +import typing_extensions +import typing class BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequestParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_upsert_merchant_custom_attributes_response.py b/src/square/requests/bulk_upsert_merchant_custom_attributes_response.py index b65d58a3..ea537063 100644 --- a/src/square/requests/bulk_upsert_merchant_custom_attributes_response.py +++ b/src/square/requests/bulk_upsert_merchant_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response import ( BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponseParams, ) diff --git a/src/square/requests/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py b/src/square/requests/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py index a99bec8f..3722aa95 100644 --- a/src/square/requests/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py +++ b/src/square/requests/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py b/src/square/requests/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py index 6ce71b0d..03cb9bb7 100644 --- a/src/square/requests/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py +++ b/src/square/requests/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from .custom_attribute import CustomAttributeParams +import typing_extensions +import typing class BulkUpsertOrderCustomAttributesRequestUpsertCustomAttributeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/bulk_upsert_order_custom_attributes_response.py b/src/square/requests/bulk_upsert_order_custom_attributes_response.py index b23f8555..71ab555f 100644 --- a/src/square/requests/bulk_upsert_order_custom_attributes_response.py +++ b/src/square/requests/bulk_upsert_order_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .upsert_order_custom_attribute_response import UpsertOrderCustomAttributeResponseParams diff --git a/src/square/requests/business_appointment_settings.py b/src/square/requests/business_appointment_settings.py index 4a7c0ee8..67240b1a 100644 --- a/src/square/requests/business_appointment_settings.py +++ b/src/square/requests/business_appointment_settings.py @@ -1,15 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.business_appointment_settings_alignment_time import BusinessAppointmentSettingsAlignmentTime +import typing_extensions +import typing from ..types.business_appointment_settings_booking_location_type import BusinessAppointmentSettingsBookingLocationType -from ..types.business_appointment_settings_cancellation_policy import BusinessAppointmentSettingsCancellationPolicy +from ..types.business_appointment_settings_alignment_time import BusinessAppointmentSettingsAlignmentTime from ..types.business_appointment_settings_max_appointments_per_day_limit_type import ( BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType, ) from .money import MoneyParams +from ..types.business_appointment_settings_cancellation_policy import BusinessAppointmentSettingsCancellationPolicy class BusinessAppointmentSettingsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/business_booking_profile.py b/src/square/requests/business_booking_profile.py index bb0f7daa..fb9f7696 100644 --- a/src/square/requests/business_booking_profile.py +++ b/src/square/requests/business_booking_profile.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.business_booking_profile_booking_policy import BusinessBookingProfileBookingPolicy +import typing_extensions +import typing from ..types.business_booking_profile_customer_timezone_choice import BusinessBookingProfileCustomerTimezoneChoice +from ..types.business_booking_profile_booking_policy import BusinessBookingProfileBookingPolicy from .business_appointment_settings import BusinessAppointmentSettingsParams diff --git a/src/square/requests/business_hours.py b/src/square/requests/business_hours.py index 81ebf97e..758aeade 100644 --- a/src/square/requests/business_hours.py +++ b/src/square/requests/business_hours.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .business_hours_period import BusinessHoursPeriodParams diff --git a/src/square/requests/business_hours_period.py b/src/square/requests/business_hours_period.py index 054973ad..887c08a3 100644 --- a/src/square/requests/business_hours_period.py +++ b/src/square/requests/business_hours_period.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.day_of_week import DayOfWeek +import typing class BusinessHoursPeriodParams(typing_extensions.TypedDict): diff --git a/src/square/requests/buy_now_pay_later_details.py b/src/square/requests/buy_now_pay_later_details.py index ebb5c7d0..be192e33 100644 --- a/src/square/requests/buy_now_pay_later_details.py +++ b/src/square/requests/buy_now_pay_later_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .afterpay_details import AfterpayDetailsParams from .clearpay_details import ClearpayDetailsParams diff --git a/src/square/requests/calculate_loyalty_points_response.py b/src/square/requests/calculate_loyalty_points_response.py index 51e51f9c..b636b3f9 100644 --- a/src/square/requests/calculate_loyalty_points_response.py +++ b/src/square/requests/calculate_loyalty_points_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/calculate_order_response.py b/src/square/requests/calculate_order_response.py index cf4495d0..4e9c7aba 100644 --- a/src/square/requests/calculate_order_response.py +++ b/src/square/requests/calculate_order_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .order import OrderParams +import typing +from .error import ErrorParams class CalculateOrderResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/cancel_booking_response.py b/src/square/requests/cancel_booking_response.py index 76174beb..21150235 100644 --- a/src/square/requests/cancel_booking_response.py +++ b/src/square/requests/cancel_booking_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .booking import BookingParams +import typing from .error import ErrorParams diff --git a/src/square/requests/cancel_invoice_response.py b/src/square/requests/cancel_invoice_response.py index 2501bc75..09263787 100644 --- a/src/square/requests/cancel_invoice_response.py +++ b/src/square/requests/cancel_invoice_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .invoice import InvoiceParams +import typing +from .error import ErrorParams class CancelInvoiceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/cancel_loyalty_promotion_response.py b/src/square/requests/cancel_loyalty_promotion_response.py index ce216b4d..3ce7d076 100644 --- a/src/square/requests/cancel_loyalty_promotion_response.py +++ b/src/square/requests/cancel_loyalty_promotion_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_promotion import LoyaltyPromotionParams diff --git a/src/square/requests/cancel_payment_by_idempotency_key_response.py b/src/square/requests/cancel_payment_by_idempotency_key_response.py index ce763ea2..f20cec37 100644 --- a/src/square/requests/cancel_payment_by_idempotency_key_response.py +++ b/src/square/requests/cancel_payment_by_idempotency_key_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/cancel_payment_response.py b/src/square/requests/cancel_payment_response.py index 332dfce7..376577e0 100644 --- a/src/square/requests/cancel_payment_response.py +++ b/src/square/requests/cancel_payment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment import PaymentParams diff --git a/src/square/requests/cancel_subscription_response.py b/src/square/requests/cancel_subscription_response.py index 5fcd0f98..c2420103 100644 --- a/src/square/requests/cancel_subscription_response.py +++ b/src/square/requests/cancel_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams from .subscription_action import SubscriptionActionParams diff --git a/src/square/requests/cancel_terminal_action_response.py b/src/square/requests/cancel_terminal_action_response.py index f52ffeea..6595afc6 100644 --- a/src/square/requests/cancel_terminal_action_response.py +++ b/src/square/requests/cancel_terminal_action_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_action import TerminalActionParams diff --git a/src/square/requests/cancel_terminal_checkout_response.py b/src/square/requests/cancel_terminal_checkout_response.py index 29fc794b..703c4d4a 100644 --- a/src/square/requests/cancel_terminal_checkout_response.py +++ b/src/square/requests/cancel_terminal_checkout_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/cancel_terminal_refund_response.py b/src/square/requests/cancel_terminal_refund_response.py index 72fee36c..fb81fc57 100644 --- a/src/square/requests/cancel_terminal_refund_response.py +++ b/src/square/requests/cancel_terminal_refund_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/cancel_transfer_order_response.py b/src/square/requests/cancel_transfer_order_response.py deleted file mode 100644 index ec1da7b5..00000000 --- a/src/square/requests/cancel_transfer_order_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class CancelTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response for canceling a transfer order - """ - - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The updated transfer order with status changed to CANCELED - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/capture_transaction_response.py b/src/square/requests/capture_transaction_response.py index 841db9d4..89a83fc4 100644 --- a/src/square/requests/capture_transaction_response.py +++ b/src/square/requests/capture_transaction_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/card.py b/src/square/requests/card.py index b7168e59..cd699fd1 100644 --- a/src/square/requests/card.py +++ b/src/square/requests/card.py @@ -1,15 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..core.serialization import FieldMetadata +import typing_extensions from ..types.card_brand import CardBrand +from ..core.serialization import FieldMetadata +import typing +from .address import AddressParams +from ..types.card_type import CardType +from ..types.card_prepaid_type import CardPrepaidType from ..types.card_co_brand import CardCoBrand from ..types.card_issuer_alert import CardIssuerAlert -from ..types.card_prepaid_type import CardPrepaidType -from ..types.card_type import CardType -from .address import AddressParams class CardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/card_automatically_updated_event.py b/src/square/requests/card_automatically_updated_event.py index 09ca07df..33b18830 100644 --- a/src/square/requests/card_automatically_updated_event.py +++ b/src/square/requests/card_automatically_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_automatically_updated_event_data import CardAutomaticallyUpdatedEventDataParams diff --git a/src/square/requests/card_automatically_updated_event_data.py b/src/square/requests/card_automatically_updated_event_data.py index 1788bc8e..b336fa9d 100644 --- a/src/square/requests/card_automatically_updated_event_data.py +++ b/src/square/requests/card_automatically_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_automatically_updated_event_object import CardAutomaticallyUpdatedEventObjectParams diff --git a/src/square/requests/card_automatically_updated_event_object.py b/src/square/requests/card_automatically_updated_event_object.py index ca33c822..f05f3cdc 100644 --- a/src/square/requests/card_automatically_updated_event_object.py +++ b/src/square/requests/card_automatically_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .card import CardParams diff --git a/src/square/requests/card_created_event.py b/src/square/requests/card_created_event.py index 9b308dd5..0de7144b 100644 --- a/src/square/requests/card_created_event.py +++ b/src/square/requests/card_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_created_event_data import CardCreatedEventDataParams diff --git a/src/square/requests/card_created_event_data.py b/src/square/requests/card_created_event_data.py index e888fc7c..5d9b3732 100644 --- a/src/square/requests/card_created_event_data.py +++ b/src/square/requests/card_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_created_event_object import CardCreatedEventObjectParams diff --git a/src/square/requests/card_created_event_object.py b/src/square/requests/card_created_event_object.py index aa3f43c7..fe5e8ff7 100644 --- a/src/square/requests/card_created_event_object.py +++ b/src/square/requests/card_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .card import CardParams diff --git a/src/square/requests/card_disabled_event.py b/src/square/requests/card_disabled_event.py index 64547c75..93059b5b 100644 --- a/src/square/requests/card_disabled_event.py +++ b/src/square/requests/card_disabled_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_disabled_event_data import CardDisabledEventDataParams diff --git a/src/square/requests/card_disabled_event_data.py b/src/square/requests/card_disabled_event_data.py index 61f2f606..4ff5a0c0 100644 --- a/src/square/requests/card_disabled_event_data.py +++ b/src/square/requests/card_disabled_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_disabled_event_object import CardDisabledEventObjectParams diff --git a/src/square/requests/card_disabled_event_object.py b/src/square/requests/card_disabled_event_object.py index a19ac583..f2f94ad3 100644 --- a/src/square/requests/card_disabled_event_object.py +++ b/src/square/requests/card_disabled_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .card import CardParams diff --git a/src/square/requests/card_forgotten_event.py b/src/square/requests/card_forgotten_event.py index 1d694cd7..c1a7e6b4 100644 --- a/src/square/requests/card_forgotten_event.py +++ b/src/square/requests/card_forgotten_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_forgotten_event_data import CardForgottenEventDataParams diff --git a/src/square/requests/card_forgotten_event_card.py b/src/square/requests/card_forgotten_event_card.py index abb68064..6c836f26 100644 --- a/src/square/requests/card_forgotten_event_card.py +++ b/src/square/requests/card_forgotten_event_card.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CardForgottenEventCardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/card_forgotten_event_data.py b/src/square/requests/card_forgotten_event_data.py index d58d1242..0a158560 100644 --- a/src/square/requests/card_forgotten_event_data.py +++ b/src/square/requests/card_forgotten_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_forgotten_event_object import CardForgottenEventObjectParams diff --git a/src/square/requests/card_forgotten_event_object.py b/src/square/requests/card_forgotten_event_object.py index 83df79d3..00fdf84f 100644 --- a/src/square/requests/card_forgotten_event_object.py +++ b/src/square/requests/card_forgotten_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .card_forgotten_event_card import CardForgottenEventCardParams diff --git a/src/square/requests/card_payment_details.py b/src/square/requests/card_payment_details.py index 1b2e1f36..d479f4fe 100644 --- a/src/square/requests/card_payment_details.py +++ b/src/square/requests/card_payment_details.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card import CardParams -from .card_payment_timeline import CardPaymentTimelineParams from .device_details import DeviceDetailsParams +from .card_payment_timeline import CardPaymentTimelineParams from .error import ErrorParams @@ -14,7 +14,7 @@ class CardPaymentDetailsParams(typing_extensions.TypedDict): Reflects the current status of a card payment. Contains only non-confidential information. """ - status: typing_extensions.NotRequired[str] + status: typing_extensions.NotRequired[typing.Optional[str]] """ The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or FAILED. @@ -25,58 +25,58 @@ class CardPaymentDetailsParams(typing_extensions.TypedDict): The credit card's non-confidential details. """ - entry_method: typing_extensions.NotRequired[str] + entry_method: typing_extensions.NotRequired[typing.Optional[str]] """ The method used to enter the card's details for the payment. The method can be `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. """ - cvv_status: typing_extensions.NotRequired[str] + cvv_status: typing_extensions.NotRequired[typing.Optional[str]] """ The status code returned from the Card Verification Value (CVV) check. The code can be `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. """ - avs_status: typing_extensions.NotRequired[str] + avs_status: typing_extensions.NotRequired[typing.Optional[str]] """ The status code returned from the Address Verification System (AVS) check. The code can be `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. """ - auth_result_code: typing_extensions.NotRequired[str] + auth_result_code: typing_extensions.NotRequired[typing.Optional[str]] """ The status code returned by the card issuer that describes the payment's authorization status. """ - application_identifier: typing_extensions.NotRequired[str] + application_identifier: typing_extensions.NotRequired[typing.Optional[str]] """ For EMV payments, the application ID identifies the EMV application used for the payment. """ - application_name: typing_extensions.NotRequired[str] + application_name: typing_extensions.NotRequired[typing.Optional[str]] """ For EMV payments, the human-readable name of the EMV application used for the payment. """ - application_cryptogram: typing_extensions.NotRequired[str] + application_cryptogram: typing_extensions.NotRequired[typing.Optional[str]] """ For EMV payments, the cryptogram generated for the payment. """ - verification_method: typing_extensions.NotRequired[str] + verification_method: typing_extensions.NotRequired[typing.Optional[str]] """ For EMV payments, the method used to verify the cardholder's identity. The method can be `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. """ - verification_results: typing_extensions.NotRequired[str] + verification_results: typing_extensions.NotRequired[typing.Optional[str]] """ For EMV payments, the results of the cardholder verification. The result can be `SUCCESS`, `FAILURE`, or `UNKNOWN`. """ - statement_description: typing_extensions.NotRequired[str] + statement_description: typing_extensions.NotRequired[typing.Optional[str]] """ The statement description sent to the card networks. @@ -96,13 +96,13 @@ class CardPaymentDetailsParams(typing_extensions.TypedDict): The timeline for card payments. """ - refund_requires_card_presence: typing_extensions.NotRequired[bool] + refund_requires_card_presence: typing_extensions.NotRequired[typing.Optional[bool]] """ Whether the card must be physically present for the payment to be refunded. If set to `true`, the card must be present. """ - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] + errors: typing_extensions.NotRequired[typing.Optional[typing.Sequence[ErrorParams]]] """ Information about errors encountered during the request. """ diff --git a/src/square/requests/card_payment_timeline.py b/src/square/requests/card_payment_timeline.py index b9ac800e..b75bf94a 100644 --- a/src/square/requests/card_payment_timeline.py +++ b/src/square/requests/card_payment_timeline.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CardPaymentTimelineParams(typing_extensions.TypedDict): diff --git a/src/square/requests/card_updated_event.py b/src/square/requests/card_updated_event.py index d3885e3e..b135f1f9 100644 --- a/src/square/requests/card_updated_event.py +++ b/src/square/requests/card_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_updated_event_data import CardUpdatedEventDataParams diff --git a/src/square/requests/card_updated_event_data.py b/src/square/requests/card_updated_event_data.py index c85fc732..2d191fd0 100644 --- a/src/square/requests/card_updated_event_data.py +++ b/src/square/requests/card_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .card_updated_event_object import CardUpdatedEventObjectParams diff --git a/src/square/requests/card_updated_event_object.py b/src/square/requests/card_updated_event_object.py index b13c86b6..0359bf6e 100644 --- a/src/square/requests/card_updated_event_object.py +++ b/src/square/requests/card_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .card import CardParams diff --git a/src/square/requests/cash_app_details.py b/src/square/requests/cash_app_details.py index 6dd98467..1c11aa6e 100644 --- a/src/square/requests/cash_app_details.py +++ b/src/square/requests/cash_app_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CashAppDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/cash_drawer_device.py b/src/square/requests/cash_drawer_device.py index 9e8e4736..44474514 100644 --- a/src/square/requests/cash_drawer_device.py +++ b/src/square/requests/cash_drawer_device.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CashDrawerDeviceParams(typing_extensions.TypedDict): diff --git a/src/square/requests/cash_drawer_shift.py b/src/square/requests/cash_drawer_shift.py index 706715db..b2316697 100644 --- a/src/square/requests/cash_drawer_shift.py +++ b/src/square/requests/cash_drawer_shift.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.cash_drawer_shift_state import CashDrawerShiftState -from .cash_drawer_device import CashDrawerDeviceParams +import typing from .money import MoneyParams +from .cash_drawer_device import CashDrawerDeviceParams class CashDrawerShiftParams(typing_extensions.TypedDict): diff --git a/src/square/requests/cash_drawer_shift_event.py b/src/square/requests/cash_drawer_shift_event.py index 30fa53bc..924ff154 100644 --- a/src/square/requests/cash_drawer_shift_event.py +++ b/src/square/requests/cash_drawer_shift_event.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.cash_drawer_event_type import CashDrawerEventType from .money import MoneyParams +import typing class CashDrawerShiftEventParams(typing_extensions.TypedDict): diff --git a/src/square/requests/cash_drawer_shift_summary.py b/src/square/requests/cash_drawer_shift_summary.py index c8cb0c80..716b2d75 100644 --- a/src/square/requests/cash_drawer_shift_summary.py +++ b/src/square/requests/cash_drawer_shift_summary.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.cash_drawer_shift_state import CashDrawerShiftState +import typing from .money import MoneyParams diff --git a/src/square/requests/cash_payment_details.py b/src/square/requests/cash_payment_details.py index e34a3df9..9b758cac 100644 --- a/src/square/requests/cash_payment_details.py +++ b/src/square/requests/cash_payment_details.py @@ -2,6 +2,7 @@ import typing_extensions from .money import MoneyParams +import typing_extensions class CashPaymentDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_availability_period.py b/src/square/requests/catalog_availability_period.py index 1aa5bd2a..449c166a 100644 --- a/src/square/requests/catalog_availability_period.py +++ b/src/square/requests/catalog_availability_period.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.day_of_week import DayOfWeek diff --git a/src/square/requests/catalog_category.py b/src/square/requests/catalog_category.py index 65f5b76b..6bdb97fb 100644 --- a/src/square/requests/catalog_category.py +++ b/src/square/requests/catalog_category.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions +import typing_extensions +import typing from ..types.catalog_category_type import CatalogCategoryType from .catalog_ecom_seo_data import CatalogEcomSeoDataParams from .category_path_to_root_node import CategoryPathToRootNodeParams +import typing if typing.TYPE_CHECKING: from .catalog_object_category import CatalogObjectCategoryParams diff --git a/src/square/requests/catalog_custom_attribute_definition.py b/src/square/requests/catalog_custom_attribute_definition.py index 1e978830..7a4d44fc 100644 --- a/src/square/requests/catalog_custom_attribute_definition.py +++ b/src/square/requests/catalog_custom_attribute_definition.py @@ -1,18 +1,18 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.catalog_custom_attribute_definition_app_visibility import CatalogCustomAttributeDefinitionAppVisibility +from ..types.catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType +import typing_extensions +import typing +from .source_application import SourceApplicationParams +from ..types.catalog_object_type import CatalogObjectType from ..types.catalog_custom_attribute_definition_seller_visibility import ( CatalogCustomAttributeDefinitionSellerVisibility, ) -from ..types.catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType -from ..types.catalog_object_type import CatalogObjectType +from ..types.catalog_custom_attribute_definition_app_visibility import CatalogCustomAttributeDefinitionAppVisibility +from .catalog_custom_attribute_definition_string_config import CatalogCustomAttributeDefinitionStringConfigParams from .catalog_custom_attribute_definition_number_config import CatalogCustomAttributeDefinitionNumberConfigParams from .catalog_custom_attribute_definition_selection_config import CatalogCustomAttributeDefinitionSelectionConfigParams -from .catalog_custom_attribute_definition_string_config import CatalogCustomAttributeDefinitionStringConfigParams -from .source_application import SourceApplicationParams class CatalogCustomAttributeDefinitionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_custom_attribute_definition_number_config.py b/src/square/requests/catalog_custom_attribute_definition_number_config.py index 7710bf10..0a35d32d 100644 --- a/src/square/requests/catalog_custom_attribute_definition_number_config.py +++ b/src/square/requests/catalog_custom_attribute_definition_number_config.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogCustomAttributeDefinitionNumberConfigParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_custom_attribute_definition_selection_config.py b/src/square/requests/catalog_custom_attribute_definition_selection_config.py index ad5b4e65..006f636a 100644 --- a/src/square/requests/catalog_custom_attribute_definition_selection_config.py +++ b/src/square/requests/catalog_custom_attribute_definition_selection_config.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .catalog_custom_attribute_definition_selection_config_custom_attribute_selection import ( CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelectionParams, ) diff --git a/src/square/requests/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py b/src/square/requests/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py index abfe6ea9..92f688b7 100644 --- a/src/square/requests/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py +++ b/src/square/requests/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelectionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_custom_attribute_definition_string_config.py b/src/square/requests/catalog_custom_attribute_definition_string_config.py index fb7e6aac..85bd17a4 100644 --- a/src/square/requests/catalog_custom_attribute_definition_string_config.py +++ b/src/square/requests/catalog_custom_attribute_definition_string_config.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogCustomAttributeDefinitionStringConfigParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_custom_attribute_value.py b/src/square/requests/catalog_custom_attribute_value.py index 83c7ea61..ccb9cae3 100644 --- a/src/square/requests/catalog_custom_attribute_value.py +++ b/src/square/requests/catalog_custom_attribute_value.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType diff --git a/src/square/requests/catalog_discount.py b/src/square/requests/catalog_discount.py index 36666e66..b94ea17c 100644 --- a/src/square/requests/catalog_discount.py +++ b/src/square/requests/catalog_discount.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.catalog_discount_modify_tax_basis import CatalogDiscountModifyTaxBasis +import typing_extensions +import typing from ..types.catalog_discount_type import CatalogDiscountType from .money import MoneyParams +from ..types.catalog_discount_modify_tax_basis import CatalogDiscountModifyTaxBasis class CatalogDiscountParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_ecom_seo_data.py b/src/square/requests/catalog_ecom_seo_data.py index 62395f76..856e84a1 100644 --- a/src/square/requests/catalog_ecom_seo_data.py +++ b/src/square/requests/catalog_ecom_seo_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogEcomSeoDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_id_mapping.py b/src/square/requests/catalog_id_mapping.py index 8cf5abd2..c0546499 100644 --- a/src/square/requests/catalog_id_mapping.py +++ b/src/square/requests/catalog_id_mapping.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogIdMappingParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_image.py b/src/square/requests/catalog_image.py index 2cdeb97d..b9d1a689 100644 --- a/src/square/requests/catalog_image.py +++ b/src/square/requests/catalog_image.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogImageParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_info_response.py b/src/square/requests/catalog_info_response.py index 6a71bd5d..496b3aaf 100644 --- a/src/square/requests/catalog_info_response.py +++ b/src/square/requests/catalog_info_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_info_response_limits import CatalogInfoResponseLimitsParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_info_response_limits import CatalogInfoResponseLimitsParams from .standard_unit_description_group import StandardUnitDescriptionGroupParams diff --git a/src/square/requests/catalog_info_response_limits.py b/src/square/requests/catalog_info_response_limits.py index af1cfca3..75bd739c 100644 --- a/src/square/requests/catalog_info_response_limits.py +++ b/src/square/requests/catalog_info_response_limits.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogInfoResponseLimitsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_item.py b/src/square/requests/catalog_item.py index 633abbf1..e9b7407e 100644 --- a/src/square/requests/catalog_item.py +++ b/src/square/requests/catalog_item.py @@ -1,16 +1,16 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions -from ..types.catalog_item_product_type import CatalogItemProductType -from .catalog_ecom_seo_data import CatalogEcomSeoDataParams -from .catalog_item_food_and_beverage_details import CatalogItemFoodAndBeverageDetailsParams +import typing_extensions +import typing from .catalog_item_modifier_list_info import CatalogItemModifierListInfoParams +from ..types.catalog_item_product_type import CatalogItemProductType from .catalog_item_option_for_item import CatalogItemOptionForItemParams from .catalog_object_category import CatalogObjectCategoryParams +from .catalog_ecom_seo_data import CatalogEcomSeoDataParams +from .catalog_item_food_and_beverage_details import CatalogItemFoodAndBeverageDetailsParams +import typing if typing.TYPE_CHECKING: from .catalog_object import CatalogObjectParams diff --git a/src/square/requests/catalog_item_food_and_beverage_details.py b/src/square/requests/catalog_item_food_and_beverage_details.py index 37b74152..2b3c1602 100644 --- a/src/square/requests/catalog_item_food_and_beverage_details.py +++ b/src/square/requests/catalog_item_food_and_beverage_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .catalog_item_food_and_beverage_details_dietary_preference import ( CatalogItemFoodAndBeverageDetailsDietaryPreferenceParams, ) diff --git a/src/square/requests/catalog_item_food_and_beverage_details_dietary_preference.py b/src/square/requests/catalog_item_food_and_beverage_details_dietary_preference.py index 375db540..72ba99bb 100644 --- a/src/square/requests/catalog_item_food_and_beverage_details_dietary_preference.py +++ b/src/square/requests/catalog_item_food_and_beverage_details_dietary_preference.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference import ( - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference, -) +import typing_extensions from ..types.catalog_item_food_and_beverage_details_dietary_preference_type import ( CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, ) +from ..types.catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference import ( + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference, +) +import typing class CatalogItemFoodAndBeverageDetailsDietaryPreferenceParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_item_food_and_beverage_details_ingredient.py b/src/square/requests/catalog_item_food_and_beverage_details_ingredient.py index e8e46d02..b9fe63e2 100644 --- a/src/square/requests/catalog_item_food_and_beverage_details_ingredient.py +++ b/src/square/requests/catalog_item_food_and_beverage_details_ingredient.py @@ -1,7 +1,6 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.catalog_item_food_and_beverage_details_dietary_preference_type import ( CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, @@ -9,6 +8,7 @@ from ..types.catalog_item_food_and_beverage_details_ingredient_standard_ingredient import ( CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient, ) +import typing class CatalogItemFoodAndBeverageDetailsIngredientParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_item_modifier_list_info.py b/src/square/requests/catalog_item_modifier_list_info.py index ad9652f9..8adf0b38 100644 --- a/src/square/requests/catalog_item_modifier_list_info.py +++ b/src/square/requests/catalog_item_modifier_list_info.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .catalog_modifier_override import CatalogModifierOverrideParams @@ -57,6 +57,6 @@ class CatalogItemModifierListInfoParams(typing_extensions.TypedDict): to a `CatalogItem` instance. """ - allow_quantities: typing_extensions.NotRequired[typing.Any] - is_conversational: typing_extensions.NotRequired[typing.Any] - hidden_from_customer_override: typing_extensions.NotRequired[typing.Any] + allow_quantities: typing_extensions.NotRequired[typing.Optional[typing.Any]] + is_conversational: typing_extensions.NotRequired[typing.Optional[typing.Any]] + hidden_from_customer_override: typing_extensions.NotRequired[typing.Optional[typing.Any]] diff --git a/src/square/requests/catalog_item_option.py b/src/square/requests/catalog_item_option.py index 63a3ac9c..22745c42 100644 --- a/src/square/requests/catalog_item_option.py +++ b/src/square/requests/catalog_item_option.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions +import typing_extensions +import typing +import typing if typing.TYPE_CHECKING: from .catalog_object import CatalogObjectParams diff --git a/src/square/requests/catalog_item_option_for_item.py b/src/square/requests/catalog_item_option_for_item.py index 51c82186..a77e9826 100644 --- a/src/square/requests/catalog_item_option_for_item.py +++ b/src/square/requests/catalog_item_option_for_item.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogItemOptionForItemParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_item_option_value.py b/src/square/requests/catalog_item_option_value.py index 0c639274..92241f91 100644 --- a/src/square/requests/catalog_item_option_value.py +++ b/src/square/requests/catalog_item_option_value.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogItemOptionValueParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_item_option_value_for_item_variation.py b/src/square/requests/catalog_item_option_value_for_item_variation.py index 62ddd96f..ed53a181 100644 --- a/src/square/requests/catalog_item_option_value_for_item_variation.py +++ b/src/square/requests/catalog_item_option_value_for_item_variation.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogItemOptionValueForItemVariationParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_item_variation.py b/src/square/requests/catalog_item_variation.py index c819bfdf..d28c59c3 100644 --- a/src/square/requests/catalog_item_variation.py +++ b/src/square/requests/catalog_item_variation.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.catalog_pricing_type import CatalogPricingType +from .money import MoneyParams +from .item_variation_location_overrides import ItemVariationLocationOverridesParams from ..types.inventory_alert_type import InventoryAlertType from .catalog_item_option_value_for_item_variation import CatalogItemOptionValueForItemVariationParams from .catalog_stock_conversion import CatalogStockConversionParams -from .item_variation_location_overrides import ItemVariationLocationOverridesParams -from .money import MoneyParams class CatalogItemVariationParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_measurement_unit.py b/src/square/requests/catalog_measurement_unit.py index 21542934..b2eb24c1 100644 --- a/src/square/requests/catalog_measurement_unit.py +++ b/src/square/requests/catalog_measurement_unit.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .measurement_unit import MeasurementUnitParams +import typing class CatalogMeasurementUnitParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_modifier.py b/src/square/requests/catalog_modifier.py index e6567414..e2f85572 100644 --- a/src/square/requests/catalog_modifier.py +++ b/src/square/requests/catalog_modifier.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .modifier_location_overrides import ModifierLocationOverridesParams +import typing_extensions +import typing from .money import MoneyParams +from .modifier_location_overrides import ModifierLocationOverridesParams class CatalogModifierParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_modifier_list.py b/src/square/requests/catalog_modifier_list.py index e0571439..d7d16801 100644 --- a/src/square/requests/catalog_modifier_list.py +++ b/src/square/requests/catalog_modifier_list.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions -from ..types.catalog_modifier_list_modifier_type import CatalogModifierListModifierType +import typing_extensions +import typing from ..types.catalog_modifier_list_selection_type import CatalogModifierListSelectionType +from ..types.catalog_modifier_list_modifier_type import CatalogModifierListModifierType +import typing if typing.TYPE_CHECKING: from .catalog_object import CatalogObjectParams diff --git a/src/square/requests/catalog_modifier_override.py b/src/square/requests/catalog_modifier_override.py index dd042fb2..70fc8525 100644 --- a/src/square/requests/catalog_modifier_override.py +++ b/src/square/requests/catalog_modifier_override.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogModifierOverrideParams(typing_extensions.TypedDict): @@ -20,5 +20,5 @@ class CatalogModifierOverrideParams(typing_extensions.TypedDict): __Deprecated__: Use `on_by_default_override` instead. """ - hidden_online_override: typing_extensions.NotRequired[typing.Any] - on_by_default_override: typing_extensions.NotRequired[typing.Any] + hidden_online_override: typing_extensions.NotRequired[typing.Optional[typing.Any]] + on_by_default_override: typing_extensions.NotRequired[typing.Optional[typing.Any]] diff --git a/src/square/requests/catalog_object.py b/src/square/requests/catalog_object.py index 2afcbf44..0356a1ee 100644 --- a/src/square/requests/catalog_object.py +++ b/src/square/requests/catalog_object.py @@ -1,48 +1,379 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +import typing_extensions +import typing +import typing_extensions +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata +from .catalog_image import CatalogImageParams +from .catalog_item_variation import CatalogItemVariationParams +from .catalog_tax import CatalogTaxParams +from .catalog_discount import CatalogDiscountParams +from .catalog_modifier import CatalogModifierParams +from .catalog_pricing_rule import CatalogPricingRuleParams +from .catalog_product_set import CatalogProductSetParams +from .catalog_time_period import CatalogTimePeriodParams +from .catalog_measurement_unit import CatalogMeasurementUnitParams +from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariationParams +from .catalog_item_option_value import CatalogItemOptionValueParams +from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinitionParams +from .catalog_quick_amounts_settings import CatalogQuickAmountsSettingsParams +from .catalog_availability_period import CatalogAvailabilityPeriodParams import typing - -from .catalog_object_availability_period import CatalogObjectAvailabilityPeriodParams -from .catalog_object_category import CatalogObjectCategoryParams -from .catalog_object_custom_attribute_definition import CatalogObjectCustomAttributeDefinitionParams -from .catalog_object_discount import CatalogObjectDiscountParams -from .catalog_object_image import CatalogObjectImageParams -from .catalog_object_item_option_value import CatalogObjectItemOptionValueParams -from .catalog_object_item_variation import CatalogObjectItemVariationParams -from .catalog_object_measurement_unit import CatalogObjectMeasurementUnitParams -from .catalog_object_modifier import CatalogObjectModifierParams -from .catalog_object_pricing_rule import CatalogObjectPricingRuleParams -from .catalog_object_product_set import CatalogObjectProductSetParams -from .catalog_object_quick_amounts_settings import CatalogObjectQuickAmountsSettingsParams -from .catalog_object_subscription_plan_variation import CatalogObjectSubscriptionPlanVariationParams -from .catalog_object_tax import CatalogObjectTaxParams -from .catalog_object_time_period import CatalogObjectTimePeriodParams if typing.TYPE_CHECKING: - from .catalog_object_item import CatalogObjectItemParams - from .catalog_object_item_option import CatalogObjectItemOptionParams - from .catalog_object_modifier_list import CatalogObjectModifierListParams - from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlanParams + from .catalog_item import CatalogItemParams + from .catalog_category import CatalogCategoryParams + from .catalog_modifier_list import CatalogModifierListParams + from .catalog_item_option import CatalogItemOptionParams + from .catalog_subscription_plan import CatalogSubscriptionPlanParams + + +class CatalogObject_ItemParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM"] + item_data: typing_extensions.NotRequired["CatalogItemParams"] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ImageParams(typing_extensions.TypedDict): + type: typing.Literal["IMAGE"] + image_data: typing_extensions.NotRequired[CatalogImageParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_CategoryParams(typing_extensions.TypedDict): + type: typing.Literal["CATEGORY"] + id: typing_extensions.NotRequired[str] + ordinal: typing_extensions.NotRequired[typing.Optional[int]] + type: typing_extensions.NotRequired[typing.Literal["CATEGORY"]] + category_data: typing_extensions.NotRequired["CatalogCategoryParams"] + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ItemVariationParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM_VARIATION"] + item_variation_data: typing_extensions.NotRequired[CatalogItemVariationParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_TaxParams(typing_extensions.TypedDict): + type: typing.Literal["TAX"] + tax_data: typing_extensions.NotRequired[CatalogTaxParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_DiscountParams(typing_extensions.TypedDict): + type: typing.Literal["DISCOUNT"] + discount_data: typing_extensions.NotRequired[CatalogDiscountParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ModifierListParams(typing_extensions.TypedDict): + type: typing.Literal["MODIFIER_LIST"] + modifier_list_data: typing_extensions.NotRequired["CatalogModifierListParams"] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ModifierParams(typing_extensions.TypedDict): + type: typing.Literal["MODIFIER"] + modifier_data: typing_extensions.NotRequired[CatalogModifierParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_PricingRuleParams(typing_extensions.TypedDict): + type: typing.Literal["PRICING_RULE"] + pricing_rule_data: typing_extensions.NotRequired[CatalogPricingRuleParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ProductSetParams(typing_extensions.TypedDict): + type: typing.Literal["PRODUCT_SET"] + product_set_data: typing_extensions.NotRequired[CatalogProductSetParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_TimePeriodParams(typing_extensions.TypedDict): + type: typing.Literal["TIME_PERIOD"] + time_period_data: typing_extensions.NotRequired[CatalogTimePeriodParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_MeasurementUnitParams(typing_extensions.TypedDict): + type: typing.Literal["MEASUREMENT_UNIT"] + measurement_unit_data: typing_extensions.NotRequired[CatalogMeasurementUnitParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_SubscriptionPlanVariationParams(typing_extensions.TypedDict): + type: typing.Literal["SUBSCRIPTION_PLAN_VARIATION"] + subscription_plan_variation_data: typing_extensions.NotRequired[CatalogSubscriptionPlanVariationParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ItemOptionParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM_OPTION"] + item_option_data: typing_extensions.NotRequired["CatalogItemOptionParams"] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_ItemOptionValParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM_OPTION_VAL"] + item_option_value_data: typing_extensions.NotRequired[CatalogItemOptionValueParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_CustomAttributeDefinitionParams(typing_extensions.TypedDict): + type: typing.Literal["CUSTOM_ATTRIBUTE_DEFINITION"] + custom_attribute_definition_data: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_QuickAmountsSettingsParams(typing_extensions.TypedDict): + type: typing.Literal["QUICK_AMOUNTS_SETTINGS"] + quick_amounts_settings_data: typing_extensions.NotRequired[CatalogQuickAmountsSettingsParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_SubscriptionPlanParams(typing_extensions.TypedDict): + type: typing.Literal["SUBSCRIPTION_PLAN"] + subscription_plan_data: typing_extensions.NotRequired["CatalogSubscriptionPlanParams"] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + +class CatalogObject_AvailabilityPeriodParams(typing_extensions.TypedDict): + type: typing.Literal["AVAILABILITY_PERIOD"] + availability_period_data: typing_extensions.NotRequired[CatalogAvailabilityPeriodParams] + id: str + updated_at: typing_extensions.NotRequired[str] + version: typing_extensions.NotRequired[int] + is_deleted: typing_extensions.NotRequired[bool] + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + present_at_all_locations: typing_extensions.NotRequired[bool] + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + image_id: typing_extensions.NotRequired[str] + + CatalogObjectParams = typing.Union[ - "CatalogObjectItemParams", - CatalogObjectImageParams, - CatalogObjectCategoryParams, - CatalogObjectItemVariationParams, - CatalogObjectTaxParams, - CatalogObjectDiscountParams, - "CatalogObjectModifierListParams", - CatalogObjectModifierParams, - CatalogObjectPricingRuleParams, - CatalogObjectProductSetParams, - CatalogObjectTimePeriodParams, - CatalogObjectMeasurementUnitParams, - CatalogObjectSubscriptionPlanVariationParams, - "CatalogObjectItemOptionParams", - CatalogObjectItemOptionValueParams, - CatalogObjectCustomAttributeDefinitionParams, - CatalogObjectQuickAmountsSettingsParams, - "CatalogObjectSubscriptionPlanParams", - CatalogObjectAvailabilityPeriodParams, + CatalogObject_ItemParams, + CatalogObject_ImageParams, + CatalogObject_CategoryParams, + CatalogObject_ItemVariationParams, + CatalogObject_TaxParams, + CatalogObject_DiscountParams, + CatalogObject_ModifierListParams, + CatalogObject_ModifierParams, + CatalogObject_PricingRuleParams, + CatalogObject_ProductSetParams, + CatalogObject_TimePeriodParams, + CatalogObject_MeasurementUnitParams, + CatalogObject_SubscriptionPlanVariationParams, + CatalogObject_ItemOptionParams, + CatalogObject_ItemOptionValParams, + CatalogObject_CustomAttributeDefinitionParams, + CatalogObject_QuickAmountsSettingsParams, + CatalogObject_SubscriptionPlanParams, + CatalogObject_AvailabilityPeriodParams, ] diff --git a/src/square/requests/catalog_object_availability_period.py b/src/square/requests/catalog_object_availability_period.py index 0139b550..7045a6b5 100644 --- a/src/square/requests/catalog_object_availability_period.py +++ b/src/square/requests/catalog_object_availability_period.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata from .catalog_availability_period import CatalogAvailabilityPeriodParams -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectAvailabilityPeriodParams(typing_extensions.TypedDict): - type: typing.Literal["AVAILABILITY_PERIOD"] +class CatalogObjectAvailabilityPeriodParams(CatalogObjectBaseParams): availability_period_data: typing_extensions.NotRequired[CatalogAvailabilityPeriodParams] """ Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_base.py b/src/square/requests/catalog_object_base.py index 1f6ec6c0..c754c3ce 100644 --- a/src/square/requests/catalog_object_base.py +++ b/src/square/requests/catalog_object_base.py @@ -1,22 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..core.serialization import FieldMetadata -from ..types.catalog_object_type import CatalogObjectType +import typing_extensions +import typing from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata class CatalogObjectBaseParams(typing_extensions.TypedDict): - type: CatalogObjectType - """ - The type of this object. Each object type has expected - properties expressed in a structured format within its corresponding `*_data` field below. - See [CatalogObjectType](#type-catalogobjecttype) for possible values - """ - id: str """ An identifier to reference this object in the catalog. When a new `CatalogObject` diff --git a/src/square/requests/catalog_object_batch.py b/src/square/requests/catalog_object_batch.py index 0a9c7f8f..7ed9ff54 100644 --- a/src/square/requests/catalog_object_batch.py +++ b/src/square/requests/catalog_object_batch.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from .catalog_object import CatalogObjectParams diff --git a/src/square/requests/catalog_object_category.py b/src/square/requests/catalog_object_category.py index 69d3d820..8b19cba6 100644 --- a/src/square/requests/catalog_object_category.py +++ b/src/square/requests/catalog_object_category.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions -from ..core.serialization import FieldMetadata +import typing_extensions +import typing from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata +import typing if typing.TYPE_CHECKING: from .catalog_category import CatalogCategoryParams @@ -30,7 +30,7 @@ class CatalogObjectCategoryParams(typing_extensions.TypedDict): The order of the object within the context of the category. """ - type: typing.Literal["CATEGORY"] + type: typing_extensions.NotRequired[typing.Literal["CATEGORY"]] category_data: typing_extensions.NotRequired["CatalogCategoryParams"] """ Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`. diff --git a/src/square/requests/catalog_object_custom_attribute_definition.py b/src/square/requests/catalog_object_custom_attribute_definition.py index 81c8be8b..7c31cc5d 100644 --- a/src/square/requests/catalog_object_custom_attribute_definition.py +++ b/src/square/requests/catalog_object_custom_attribute_definition.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinitionParams -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectCustomAttributeDefinitionParams(typing_extensions.TypedDict): - type: typing.Literal["CUSTOM_ATTRIBUTE_DEFINITION"] +class CatalogObjectCustomAttributeDefinitionParams(CatalogObjectBaseParams): custom_attribute_definition_data: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionParams] """ Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_discount.py b/src/square/requests/catalog_object_discount.py index 23989e6b..2c2807fa 100644 --- a/src/square/requests/catalog_object_discount.py +++ b/src/square/requests/catalog_object_discount.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_discount import CatalogDiscountParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectDiscountParams(typing_extensions.TypedDict): - type: typing.Literal["DISCOUNT"] +class CatalogObjectDiscountParams(CatalogObjectBaseParams): discount_data: typing_extensions.NotRequired[CatalogDiscountParams] """ Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_image.py b/src/square/requests/catalog_object_image.py index 54aa5c0b..85d43b80 100644 --- a/src/square/requests/catalog_object_image.py +++ b/src/square/requests/catalog_object_image.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_image import CatalogImageParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectImageParams(typing_extensions.TypedDict): - type: typing.Literal["IMAGE"] +class CatalogObjectImageParams(CatalogObjectBaseParams): image_data: typing_extensions.NotRequired[CatalogImageParams] """ Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_item.py b/src/square/requests/catalog_object_item.py index 8076b3d3..588c6466 100644 --- a/src/square/requests/catalog_object_item.py +++ b/src/square/requests/catalog_object_item.py @@ -1,103 +1,16 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams -from .catalog_v1id import CatalogV1IdParams +import typing if typing.TYPE_CHECKING: from .catalog_item import CatalogItemParams -class CatalogObjectItemParams(typing_extensions.TypedDict): - type: typing.Literal["ITEM"] +class CatalogObjectItemParams(CatalogObjectBaseParams): item_data: typing_extensions.NotRequired["CatalogItemParams"] """ Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_item_option.py b/src/square/requests/catalog_object_item_option.py index 667b6b81..210f3a58 100644 --- a/src/square/requests/catalog_object_item_option.py +++ b/src/square/requests/catalog_object_item_option.py @@ -1,103 +1,16 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams -from .catalog_v1id import CatalogV1IdParams +import typing if typing.TYPE_CHECKING: from .catalog_item_option import CatalogItemOptionParams -class CatalogObjectItemOptionParams(typing_extensions.TypedDict): - type: typing.Literal["ITEM_OPTION"] +class CatalogObjectItemOptionParams(CatalogObjectBaseParams): item_option_data: typing_extensions.NotRequired["CatalogItemOptionParams"] """ Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_item_option_value.py b/src/square/requests/catalog_object_item_option_value.py index 5cea87b2..c675c724 100644 --- a/src/square/requests/catalog_object_item_option_value.py +++ b/src/square/requests/catalog_object_item_option_value.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_item_option_value import CatalogItemOptionValueParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectItemOptionValueParams(typing_extensions.TypedDict): - type: typing.Literal["ITEM_OPTION_VAL"] +class CatalogObjectItemOptionValueParams(CatalogObjectBaseParams): item_option_value_data: typing_extensions.NotRequired[CatalogItemOptionValueParams] """ Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_item_variation.py b/src/square/requests/catalog_object_item_variation.py index 166e6ab6..7e1e7d56 100644 --- a/src/square/requests/catalog_object_item_variation.py +++ b/src/square/requests/catalog_object_item_variation.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_item_variation import CatalogItemVariationParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectItemVariationParams(typing_extensions.TypedDict): - type: typing.Literal["ITEM_VARIATION"] +class CatalogObjectItemVariationParams(CatalogObjectBaseParams): item_variation_data: typing_extensions.NotRequired[CatalogItemVariationParams] """ Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_measurement_unit.py b/src/square/requests/catalog_object_measurement_unit.py index d4f682fb..e529b7dc 100644 --- a/src/square/requests/catalog_object_measurement_unit.py +++ b/src/square/requests/catalog_object_measurement_unit.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_measurement_unit import CatalogMeasurementUnitParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectMeasurementUnitParams(typing_extensions.TypedDict): - type: typing.Literal["MEASUREMENT_UNIT"] +class CatalogObjectMeasurementUnitParams(CatalogObjectBaseParams): measurement_unit_data: typing_extensions.NotRequired[CatalogMeasurementUnitParams] """ Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_modifier.py b/src/square/requests/catalog_object_modifier.py index 0a2f523e..2e384dcf 100644 --- a/src/square/requests/catalog_object_modifier.py +++ b/src/square/requests/catalog_object_modifier.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_modifier import CatalogModifierParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectModifierParams(typing_extensions.TypedDict): - type: typing.Literal["MODIFIER"] +class CatalogObjectModifierParams(CatalogObjectBaseParams): modifier_data: typing_extensions.NotRequired[CatalogModifierParams] """ Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_modifier_list.py b/src/square/requests/catalog_object_modifier_list.py index 80d4f27a..783d5e57 100644 --- a/src/square/requests/catalog_object_modifier_list.py +++ b/src/square/requests/catalog_object_modifier_list.py @@ -1,103 +1,16 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams -from .catalog_v1id import CatalogV1IdParams +import typing if typing.TYPE_CHECKING: from .catalog_modifier_list import CatalogModifierListParams -class CatalogObjectModifierListParams(typing_extensions.TypedDict): - type: typing.Literal["MODIFIER_LIST"] +class CatalogObjectModifierListParams(CatalogObjectBaseParams): modifier_list_data: typing_extensions.NotRequired["CatalogModifierListParams"] """ Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_pricing_rule.py b/src/square/requests/catalog_object_pricing_rule.py index 05fe7516..b70343b8 100644 --- a/src/square/requests/catalog_object_pricing_rule.py +++ b/src/square/requests/catalog_object_pricing_rule.py @@ -1,100 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_pricing_rule import CatalogPricingRuleParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectPricingRuleParams(typing_extensions.TypedDict): - type: typing.Literal["PRICING_RULE"] +class CatalogObjectPricingRuleParams(CatalogObjectBaseParams): pricing_rule_data: typing_extensions.NotRequired[CatalogPricingRuleParams] """ Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`. A `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_product_set.py b/src/square/requests/catalog_object_product_set.py index 11b19f89..77c45baa 100644 --- a/src/square/requests/catalog_object_product_set.py +++ b/src/square/requests/catalog_object_product_set.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_product_set import CatalogProductSetParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectProductSetParams(typing_extensions.TypedDict): - type: typing.Literal["PRODUCT_SET"] +class CatalogObjectProductSetParams(CatalogObjectBaseParams): product_set_data: typing_extensions.NotRequired[CatalogProductSetParams] """ Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_quick_amounts_settings.py b/src/square/requests/catalog_object_quick_amounts_settings.py index e8178b86..5a44595d 100644 --- a/src/square/requests/catalog_object_quick_amounts_settings.py +++ b/src/square/requests/catalog_object_quick_amounts_settings.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_quick_amounts_settings import CatalogQuickAmountsSettingsParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectQuickAmountsSettingsParams(typing_extensions.TypedDict): - type: typing.Literal["QUICK_AMOUNTS_SETTINGS"] +class CatalogObjectQuickAmountsSettingsParams(CatalogObjectBaseParams): quick_amounts_settings_data: typing_extensions.NotRequired[CatalogQuickAmountsSettingsParams] """ Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_reference.py b/src/square/requests/catalog_object_reference.py index 50b60111..0a1d72ae 100644 --- a/src/square/requests/catalog_object_reference.py +++ b/src/square/requests/catalog_object_reference.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogObjectReferenceParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_object_subscription_plan.py b/src/square/requests/catalog_object_subscription_plan.py index fa08f44a..12d8032b 100644 --- a/src/square/requests/catalog_object_subscription_plan.py +++ b/src/square/requests/catalog_object_subscription_plan.py @@ -1,103 +1,16 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams -from .catalog_v1id import CatalogV1IdParams +import typing if typing.TYPE_CHECKING: from .catalog_subscription_plan import CatalogSubscriptionPlanParams -class CatalogObjectSubscriptionPlanParams(typing_extensions.TypedDict): - type: typing.Literal["SUBSCRIPTION_PLAN"] +class CatalogObjectSubscriptionPlanParams(CatalogObjectBaseParams): subscription_plan_data: typing_extensions.NotRequired["CatalogSubscriptionPlanParams"] """ Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_subscription_plan_variation.py b/src/square/requests/catalog_object_subscription_plan_variation.py index e6df5ab9..4b0bf2f5 100644 --- a/src/square/requests/catalog_object_subscription_plan_variation.py +++ b/src/square/requests/catalog_object_subscription_plan_variation.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariationParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectSubscriptionPlanVariationParams(typing_extensions.TypedDict): - type: typing.Literal["SUBSCRIPTION_PLAN_VARIATION"] +class CatalogObjectSubscriptionPlanVariationParams(CatalogObjectBaseParams): subscription_plan_variation_data: typing_extensions.NotRequired[CatalogSubscriptionPlanVariationParams] """ Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_tax.py b/src/square/requests/catalog_object_tax.py index 4ec491db..060b9bba 100644 --- a/src/square/requests/catalog_object_tax.py +++ b/src/square/requests/catalog_object_tax.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_tax import CatalogTaxParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectTaxParams(typing_extensions.TypedDict): - type: typing.Literal["TAX"] +class CatalogObjectTaxParams(CatalogObjectBaseParams): tax_data: typing_extensions.NotRequired[CatalogTaxParams] """ Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_object_time_period.py b/src/square/requests/catalog_object_time_period.py index bc5cd05e..77007105 100644 --- a/src/square/requests/catalog_object_time_period.py +++ b/src/square/requests/catalog_object_time_period.py @@ -1,99 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from .catalog_object_base import CatalogObjectBaseParams import typing_extensions -from ..core.serialization import FieldMetadata -from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_time_period import CatalogTimePeriodParams -from .catalog_v1id import CatalogV1IdParams -class CatalogObjectTimePeriodParams(typing_extensions.TypedDict): - type: typing.Literal["TIME_PERIOD"] +class CatalogObjectTimePeriodParams(CatalogObjectBaseParams): time_period_data: typing_extensions.NotRequired[CatalogTimePeriodParams] """ Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. """ - - id: str - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing_extensions.NotRequired[int] - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing_extensions.NotRequired[bool] - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.NotRequired[ - typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] - ] - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing_extensions.NotRequired[bool] - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing_extensions.NotRequired[str] - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ diff --git a/src/square/requests/catalog_pricing_rule.py b/src/square/requests/catalog_pricing_rule.py index ccaf45f5..2091d508 100644 --- a/src/square/requests/catalog_pricing_rule.py +++ b/src/square/requests/catalog_pricing_rule.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.exclude_strategy import ExcludeStrategy from .money import MoneyParams diff --git a/src/square/requests/catalog_product_set.py b/src/square/requests/catalog_product_set.py index a023184f..93b3966e 100644 --- a/src/square/requests/catalog_product_set.py +++ b/src/square/requests/catalog_product_set.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogProductSetParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query.py b/src/square/requests/catalog_query.py index feb7bd5b..dedb774e 100644 --- a/src/square/requests/catalog_query.py +++ b/src/square/requests/catalog_query.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions +from .catalog_query_sorted_attribute import CatalogQuerySortedAttributeParams from .catalog_query_exact import CatalogQueryExactParams -from .catalog_query_item_variations_for_item_option_values import CatalogQueryItemVariationsForItemOptionValuesParams -from .catalog_query_items_for_item_options import CatalogQueryItemsForItemOptionsParams -from .catalog_query_items_for_modifier_list import CatalogQueryItemsForModifierListParams -from .catalog_query_items_for_tax import CatalogQueryItemsForTaxParams +from .catalog_query_set import CatalogQuerySetParams from .catalog_query_prefix import CatalogQueryPrefixParams from .catalog_query_range import CatalogQueryRangeParams -from .catalog_query_set import CatalogQuerySetParams -from .catalog_query_sorted_attribute import CatalogQuerySortedAttributeParams from .catalog_query_text import CatalogQueryTextParams +from .catalog_query_items_for_tax import CatalogQueryItemsForTaxParams +from .catalog_query_items_for_modifier_list import CatalogQueryItemsForModifierListParams +from .catalog_query_items_for_item_options import CatalogQueryItemsForItemOptionsParams +from .catalog_query_item_variations_for_item_option_values import CatalogQueryItemVariationsForItemOptionValuesParams class CatalogQueryParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_item_variations_for_item_option_values.py b/src/square/requests/catalog_query_item_variations_for_item_option_values.py index f8b3bdda..37b5ca1c 100644 --- a/src/square/requests/catalog_query_item_variations_for_item_option_values.py +++ b/src/square/requests/catalog_query_item_variations_for_item_option_values.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogQueryItemVariationsForItemOptionValuesParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_items_for_item_options.py b/src/square/requests/catalog_query_items_for_item_options.py index f9044c50..9a89c081 100644 --- a/src/square/requests/catalog_query_items_for_item_options.py +++ b/src/square/requests/catalog_query_items_for_item_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogQueryItemsForItemOptionsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_items_for_modifier_list.py b/src/square/requests/catalog_query_items_for_modifier_list.py index e687e450..f4660dda 100644 --- a/src/square/requests/catalog_query_items_for_modifier_list.py +++ b/src/square/requests/catalog_query_items_for_modifier_list.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing class CatalogQueryItemsForModifierListParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_items_for_tax.py b/src/square/requests/catalog_query_items_for_tax.py index 52b43657..3cacda3d 100644 --- a/src/square/requests/catalog_query_items_for_tax.py +++ b/src/square/requests/catalog_query_items_for_tax.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing class CatalogQueryItemsForTaxParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_range.py b/src/square/requests/catalog_query_range.py index 49c14e3a..51c68820 100644 --- a/src/square/requests/catalog_query_range.py +++ b/src/square/requests/catalog_query_range.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogQueryRangeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_set.py b/src/square/requests/catalog_query_set.py index f288e1ce..62d39852 100644 --- a/src/square/requests/catalog_query_set.py +++ b/src/square/requests/catalog_query_set.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing class CatalogQuerySetParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_query_sorted_attribute.py b/src/square/requests/catalog_query_sorted_attribute.py index 6d23fd43..ba131111 100644 --- a/src/square/requests/catalog_query_sorted_attribute.py +++ b/src/square/requests/catalog_query_sorted_attribute.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.sort_order import SortOrder diff --git a/src/square/requests/catalog_query_text.py b/src/square/requests/catalog_query_text.py index 071dab0d..e1ab5e71 100644 --- a/src/square/requests/catalog_query_text.py +++ b/src/square/requests/catalog_query_text.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing class CatalogQueryTextParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_quick_amount.py b/src/square/requests/catalog_quick_amount.py index ad2a4c9e..3a71a2d3 100644 --- a/src/square/requests/catalog_quick_amount.py +++ b/src/square/requests/catalog_quick_amount.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..types.catalog_quick_amount_type import CatalogQuickAmountType from .money import MoneyParams +import typing_extensions +import typing class CatalogQuickAmountParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_quick_amounts_settings.py b/src/square/requests/catalog_quick_amounts_settings.py index f66735eb..c60f901a 100644 --- a/src/square/requests/catalog_quick_amounts_settings.py +++ b/src/square/requests/catalog_quick_amounts_settings.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..types.catalog_quick_amounts_settings_option import CatalogQuickAmountsSettingsOption +import typing_extensions +import typing from .catalog_quick_amount import CatalogQuickAmountParams diff --git a/src/square/requests/catalog_subscription_plan.py b/src/square/requests/catalog_subscription_plan.py index 090af2db..14977a0b 100644 --- a/src/square/requests/catalog_subscription_plan.py +++ b/src/square/requests/catalog_subscription_plan.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions +import typing_extensions +import typing from .subscription_phase import SubscriptionPhaseParams +import typing if typing.TYPE_CHECKING: from .catalog_object import CatalogObjectParams diff --git a/src/square/requests/catalog_subscription_plan_variation.py b/src/square/requests/catalog_subscription_plan_variation.py index 124cc9aa..d4539bb3 100644 --- a/src/square/requests/catalog_subscription_plan_variation.py +++ b/src/square/requests/catalog_subscription_plan_variation.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from .subscription_phase import SubscriptionPhaseParams +import typing_extensions class CatalogSubscriptionPlanVariationParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_tax.py b/src/square/requests/catalog_tax.py index 57bbdf81..ec388d82 100644 --- a/src/square/requests/catalog_tax.py +++ b/src/square/requests/catalog_tax.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.tax_calculation_phase import TaxCalculationPhase from ..types.tax_inclusion_type import TaxInclusionType diff --git a/src/square/requests/catalog_time_period.py b/src/square/requests/catalog_time_period.py index 0898e791..99b2f94b 100644 --- a/src/square/requests/catalog_time_period.py +++ b/src/square/requests/catalog_time_period.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CatalogTimePeriodParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_v1id.py b/src/square/requests/catalog_v1id.py index 3459f9ca..419939fa 100644 --- a/src/square/requests/catalog_v1id.py +++ b/src/square/requests/catalog_v1id.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..core.serialization import FieldMetadata diff --git a/src/square/requests/catalog_version_updated_event.py b/src/square/requests/catalog_version_updated_event.py index cec06226..63a2e029 100644 --- a/src/square/requests/catalog_version_updated_event.py +++ b/src/square/requests/catalog_version_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .catalog_version_updated_event_data import CatalogVersionUpdatedEventDataParams diff --git a/src/square/requests/catalog_version_updated_event_catalog_version.py b/src/square/requests/catalog_version_updated_event_catalog_version.py index aafd00f5..e5ec5261 100644 --- a/src/square/requests/catalog_version_updated_event_catalog_version.py +++ b/src/square/requests/catalog_version_updated_event_catalog_version.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class CatalogVersionUpdatedEventCatalogVersionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/catalog_version_updated_event_data.py b/src/square/requests/catalog_version_updated_event_data.py index 35f72bc2..28c73268 100644 --- a/src/square/requests/catalog_version_updated_event_data.py +++ b/src/square/requests/catalog_version_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .catalog_version_updated_event_object import CatalogVersionUpdatedEventObjectParams diff --git a/src/square/requests/catalog_version_updated_event_object.py b/src/square/requests/catalog_version_updated_event_object.py index 66c3067e..fc6d080f 100644 --- a/src/square/requests/catalog_version_updated_event_object.py +++ b/src/square/requests/catalog_version_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .catalog_version_updated_event_catalog_version import CatalogVersionUpdatedEventCatalogVersionParams diff --git a/src/square/requests/category_path_to_root_node.py b/src/square/requests/category_path_to_root_node.py index 55d05a94..2fe269ad 100644 --- a/src/square/requests/category_path_to_root_node.py +++ b/src/square/requests/category_path_to_root_node.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CategoryPathToRootNodeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/change_billing_anchor_date_response.py b/src/square/requests/change_billing_anchor_date_response.py index fcfc9c8e..7f075adb 100644 --- a/src/square/requests/change_billing_anchor_date_response.py +++ b/src/square/requests/change_billing_anchor_date_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams from .subscription_action import SubscriptionActionParams diff --git a/src/square/requests/channel.py b/src/square/requests/channel.py deleted file mode 100644 index e636e2a2..00000000 --- a/src/square/requests/channel.py +++ /dev/null @@ -1,52 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ..types.channel_status import ChannelStatus -from .reference import ReferenceParams - - -class ChannelParams(typing_extensions.TypedDict): - id: typing_extensions.NotRequired[str] - """ - The channel's unique ID. - """ - - merchant_id: typing_extensions.NotRequired[str] - """ - The unique ID of the merchant this channel belongs to. - """ - - name: typing_extensions.NotRequired[typing.Optional[str]] - """ - The name of the channel. - """ - - version: typing_extensions.NotRequired[int] - """ - The version number which is incremented each time an update is made to the channel. - """ - - reference: typing_extensions.NotRequired[ReferenceParams] - """ - Represents an entity the channel is associated with. - """ - - status: typing_extensions.NotRequired[ChannelStatus] - """ - Status of the channel. - See [Status](#type-status) for possible values - """ - - created_at: typing_extensions.NotRequired[str] - """ - The timestamp for when the channel was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). - """ - - updated_at: typing_extensions.NotRequired[str] - """ - The timestamp for when the channel was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). - """ diff --git a/src/square/requests/checkout.py b/src/square/requests/checkout.py index 3c18bf94..9aaa6f4f 100644 --- a/src/square/requests/checkout.py +++ b/src/square/requests/checkout.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .additional_recipient import AdditionalRecipientParams +import typing_extensions +import typing from .address import AddressParams from .order import OrderParams +from .additional_recipient import AdditionalRecipientParams class CheckoutParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_location_settings.py b/src/square/requests/checkout_location_settings.py index f109a3c7..698da4e5 100644 --- a/src/square/requests/checkout_location_settings.py +++ b/src/square/requests/checkout_location_settings.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .checkout_location_settings_branding import CheckoutLocationSettingsBrandingParams -from .checkout_location_settings_coupons import CheckoutLocationSettingsCouponsParams +import typing_extensions +import typing from .checkout_location_settings_policy import CheckoutLocationSettingsPolicyParams +from .checkout_location_settings_branding import CheckoutLocationSettingsBrandingParams from .checkout_location_settings_tipping import CheckoutLocationSettingsTippingParams +from .checkout_location_settings_coupons import CheckoutLocationSettingsCouponsParams class CheckoutLocationSettingsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_location_settings_branding.py b/src/square/requests/checkout_location_settings_branding.py index ea977dde..4ede71ae 100644 --- a/src/square/requests/checkout_location_settings_branding.py +++ b/src/square/requests/checkout_location_settings_branding.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.checkout_location_settings_branding_button_shape import CheckoutLocationSettingsBrandingButtonShape +import typing_extensions from ..types.checkout_location_settings_branding_header_type import CheckoutLocationSettingsBrandingHeaderType +import typing +from ..types.checkout_location_settings_branding_button_shape import CheckoutLocationSettingsBrandingButtonShape class CheckoutLocationSettingsBrandingParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_location_settings_coupons.py b/src/square/requests/checkout_location_settings_coupons.py index 444fb3ed..4198cb5b 100644 --- a/src/square/requests/checkout_location_settings_coupons.py +++ b/src/square/requests/checkout_location_settings_coupons.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CheckoutLocationSettingsCouponsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_location_settings_policy.py b/src/square/requests/checkout_location_settings_policy.py index 4e15cdfd..e1463504 100644 --- a/src/square/requests/checkout_location_settings_policy.py +++ b/src/square/requests/checkout_location_settings_policy.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CheckoutLocationSettingsPolicyParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_location_settings_tipping.py b/src/square/requests/checkout_location_settings_tipping.py index 6edad740..186d2ba0 100644 --- a/src/square/requests/checkout_location_settings_tipping.py +++ b/src/square/requests/checkout_location_settings_tipping.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/checkout_merchant_settings.py b/src/square/requests/checkout_merchant_settings.py index ae593f18..0b399083 100644 --- a/src/square/requests/checkout_merchant_settings.py +++ b/src/square/requests/checkout_merchant_settings.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .checkout_merchant_settings_payment_methods import CheckoutMerchantSettingsPaymentMethodsParams diff --git a/src/square/requests/checkout_merchant_settings_payment_methods.py b/src/square/requests/checkout_merchant_settings_payment_methods.py index 020559c5..7fb4ddb0 100644 --- a/src/square/requests/checkout_merchant_settings_payment_methods.py +++ b/src/square/requests/checkout_merchant_settings_payment_methods.py @@ -1,12 +1,13 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from .checkout_merchant_settings_payment_methods_afterpay_clearpay import ( - CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayParams, -) +import typing_extensions from .checkout_merchant_settings_payment_methods_payment_method import ( CheckoutMerchantSettingsPaymentMethodsPaymentMethodParams, ) +from .checkout_merchant_settings_payment_methods_afterpay_clearpay import ( + CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayParams, +) class CheckoutMerchantSettingsPaymentMethodsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_merchant_settings_payment_methods_afterpay_clearpay.py b/src/square/requests/checkout_merchant_settings_payment_methods_afterpay_clearpay.py index bba8c450..bffc8868 100644 --- a/src/square/requests/checkout_merchant_settings_payment_methods_afterpay_clearpay.py +++ b/src/square/requests/checkout_merchant_settings_payment_methods_afterpay_clearpay.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range import ( CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRangeParams, diff --git a/src/square/requests/checkout_merchant_settings_payment_methods_payment_method.py b/src/square/requests/checkout_merchant_settings_payment_methods_payment_method.py index 4d5452ad..d36f29ca 100644 --- a/src/square/requests/checkout_merchant_settings_payment_methods_payment_method.py +++ b/src/square/requests/checkout_merchant_settings_payment_methods_payment_method.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CheckoutMerchantSettingsPaymentMethodsPaymentMethodParams(typing_extensions.TypedDict): diff --git a/src/square/requests/checkout_options.py b/src/square/requests/checkout_options.py index dfacdba6..76ca2325 100644 --- a/src/square/requests/checkout_options.py +++ b/src/square/requests/checkout_options.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .accepted_payment_methods import AcceptedPaymentMethodsParams +import typing_extensions +import typing from .custom_field import CustomFieldParams +from .accepted_payment_methods import AcceptedPaymentMethodsParams from .money import MoneyParams from .shipping_fee import ShippingFeeParams diff --git a/src/square/requests/clearpay_details.py b/src/square/requests/clearpay_details.py index 5a3ce9cc..0395fca0 100644 --- a/src/square/requests/clearpay_details.py +++ b/src/square/requests/clearpay_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class ClearpayDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/clone_order_response.py b/src/square/requests/clone_order_response.py index 647b1a39..a28752ba 100644 --- a/src/square/requests/clone_order_response.py +++ b/src/square/requests/clone_order_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .order import OrderParams +import typing +from .error import ErrorParams class CloneOrderResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/collected_data.py b/src/square/requests/collected_data.py index f2c3e03c..1d5a9c34 100644 --- a/src/square/requests/collected_data.py +++ b/src/square/requests/collected_data.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class CollectedDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/complete_payment_response.py b/src/square/requests/complete_payment_response.py index 9da10b37..be6e3440 100644 --- a/src/square/requests/complete_payment_response.py +++ b/src/square/requests/complete_payment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment import PaymentParams diff --git a/src/square/requests/component.py b/src/square/requests/component.py index e302f940..f6614d4b 100644 --- a/src/square/requests/component.py +++ b/src/square/requests/component.py @@ -2,11 +2,12 @@ import typing_extensions from ..types.component_component_type import ComponentComponentType +import typing_extensions from .device_component_details_application_details import DeviceComponentDetailsApplicationDetailsParams -from .device_component_details_battery_details import DeviceComponentDetailsBatteryDetailsParams from .device_component_details_card_reader_details import DeviceComponentDetailsCardReaderDetailsParams -from .device_component_details_ethernet_details import DeviceComponentDetailsEthernetDetailsParams +from .device_component_details_battery_details import DeviceComponentDetailsBatteryDetailsParams from .device_component_details_wi_fi_details import DeviceComponentDetailsWiFiDetailsParams +from .device_component_details_ethernet_details import DeviceComponentDetailsEthernetDetailsParams class ComponentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/confirmation_decision.py b/src/square/requests/confirmation_decision.py index 4bce49dd..227faed6 100644 --- a/src/square/requests/confirmation_decision.py +++ b/src/square/requests/confirmation_decision.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class ConfirmationDecisionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/confirmation_options.py b/src/square/requests/confirmation_options.py index df4d74f5..313c64b1 100644 --- a/src/square/requests/confirmation_options.py +++ b/src/square/requests/confirmation_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .confirmation_decision import ConfirmationDecisionParams diff --git a/src/square/requests/coordinates.py b/src/square/requests/coordinates.py index fcd6468f..a38514ed 100644 --- a/src/square/requests/coordinates.py +++ b/src/square/requests/coordinates.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CoordinatesParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_booking_custom_attribute_definition_response.py b/src/square/requests/create_booking_custom_attribute_definition_response.py index 3647b971..393aed29 100644 --- a/src/square/requests/create_booking_custom_attribute_definition_response.py +++ b/src/square/requests/create_booking_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_booking_response.py b/src/square/requests/create_booking_response.py index d6901d37..2701ebb6 100644 --- a/src/square/requests/create_booking_response.py +++ b/src/square/requests/create_booking_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .booking import BookingParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_break_type_response.py b/src/square/requests/create_break_type_response.py index 92c1f4e2..980ba009 100644 --- a/src/square/requests/create_break_type_response.py +++ b/src/square/requests/create_break_type_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .break_type import BreakTypeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_card_response.py b/src/square/requests/create_card_response.py index a793c302..a6c38a95 100644 --- a/src/square/requests/create_card_response.py +++ b/src/square/requests/create_card_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .card import CardParams +import typing_extensions +import typing from .error import ErrorParams +from .card import CardParams class CreateCardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_catalog_image_request.py b/src/square/requests/create_catalog_image_request.py index bce1b221..ed2c7751 100644 --- a/src/square/requests/create_catalog_image_request.py +++ b/src/square/requests/create_catalog_image_request.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .catalog_object import CatalogObjectParams diff --git a/src/square/requests/create_catalog_image_response.py b/src/square/requests/create_catalog_image_response.py index 1e4adee5..f9bb3e2d 100644 --- a/src/square/requests/create_catalog_image_response.py +++ b/src/square/requests/create_catalog_image_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class CreateCatalogImageResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_checkout_response.py b/src/square/requests/create_checkout_response.py index fdb0a729..a0c20d6d 100644 --- a/src/square/requests/create_checkout_response.py +++ b/src/square/requests/create_checkout_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .checkout import CheckoutParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_customer_card_response.py b/src/square/requests/create_customer_card_response.py index 8b296f24..3de25ecc 100644 --- a/src/square/requests/create_customer_card_response.py +++ b/src/square/requests/create_customer_card_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .card import CardParams +import typing_extensions +import typing from .error import ErrorParams +from .card import CardParams class CreateCustomerCardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_customer_custom_attribute_definition_response.py b/src/square/requests/create_customer_custom_attribute_definition_response.py index 9db205d3..f2720b46 100644 --- a/src/square/requests/create_customer_custom_attribute_definition_response.py +++ b/src/square/requests/create_customer_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_customer_group_response.py b/src/square/requests/create_customer_group_response.py index 04427382..b9562c8a 100644 --- a/src/square/requests/create_customer_group_response.py +++ b/src/square/requests/create_customer_group_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_group import CustomerGroupParams +import typing_extensions +import typing from .error import ErrorParams +from .customer_group import CustomerGroupParams class CreateCustomerGroupResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_customer_response.py b/src/square/requests/create_customer_response.py index 050ac978..4f344184 100644 --- a/src/square/requests/create_customer_response.py +++ b/src/square/requests/create_customer_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer import CustomerParams +import typing_extensions +import typing from .error import ErrorParams +from .customer import CustomerParams class CreateCustomerResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_device_code_response.py b/src/square/requests/create_device_code_response.py index f636eb6d..b5063389 100644 --- a/src/square/requests/create_device_code_response.py +++ b/src/square/requests/create_device_code_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .device_code import DeviceCodeParams +import typing_extensions +import typing from .error import ErrorParams +from .device_code import DeviceCodeParams class CreateDeviceCodeResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_dispute_evidence_file_request.py b/src/square/requests/create_dispute_evidence_file_request.py index 1e3b9bd0..aab11da4 100644 --- a/src/square/requests/create_dispute_evidence_file_request.py +++ b/src/square/requests/create_dispute_evidence_file_request.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.dispute_evidence_type import DisputeEvidenceType diff --git a/src/square/requests/create_dispute_evidence_file_response.py b/src/square/requests/create_dispute_evidence_file_response.py index 64e6f115..1517e8ab 100644 --- a/src/square/requests/create_dispute_evidence_file_response.py +++ b/src/square/requests/create_dispute_evidence_file_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute_evidence import DisputeEvidenceParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute_evidence import DisputeEvidenceParams class CreateDisputeEvidenceFileResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_dispute_evidence_text_response.py b/src/square/requests/create_dispute_evidence_text_response.py index bcc2364b..94001032 100644 --- a/src/square/requests/create_dispute_evidence_text_response.py +++ b/src/square/requests/create_dispute_evidence_text_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute_evidence import DisputeEvidenceParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute_evidence import DisputeEvidenceParams class CreateDisputeEvidenceTextResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_gift_card_activity_response.py b/src/square/requests/create_gift_card_activity_response.py index 89f46ff3..675e07b8 100644 --- a/src/square/requests/create_gift_card_activity_response.py +++ b/src/square/requests/create_gift_card_activity_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card_activity import GiftCardActivityParams diff --git a/src/square/requests/create_gift_card_response.py b/src/square/requests/create_gift_card_response.py index b8349fd4..1c6c94ea 100644 --- a/src/square/requests/create_gift_card_response.py +++ b/src/square/requests/create_gift_card_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/create_invoice_attachment_request_data.py b/src/square/requests/create_invoice_attachment_request_data.py index 11becef2..37e08336 100644 --- a/src/square/requests/create_invoice_attachment_request_data.py +++ b/src/square/requests/create_invoice_attachment_request_data.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class CreateInvoiceAttachmentRequestDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_invoice_attachment_response.py b/src/square/requests/create_invoice_attachment_response.py index b1f9f00a..dbc54026 100644 --- a/src/square/requests/create_invoice_attachment_response.py +++ b/src/square/requests/create_invoice_attachment_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .invoice_attachment import InvoiceAttachmentParams +import typing +from .error import ErrorParams class CreateInvoiceAttachmentResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_invoice_response.py b/src/square/requests/create_invoice_response.py index 0185cc7e..71eeda4c 100644 --- a/src/square/requests/create_invoice_response.py +++ b/src/square/requests/create_invoice_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .invoice import InvoiceParams +import typing +from .error import ErrorParams class CreateInvoiceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_job_response.py b/src/square/requests/create_job_response.py index 768c98d2..725ccf13 100644 --- a/src/square/requests/create_job_response.py +++ b/src/square/requests/create_job_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .job import JobParams +import typing +from .error import ErrorParams class CreateJobResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_location_custom_attribute_definition_response.py b/src/square/requests/create_location_custom_attribute_definition_response.py index 967500c1..2fdd7078 100644 --- a/src/square/requests/create_location_custom_attribute_definition_response.py +++ b/src/square/requests/create_location_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_location_response.py b/src/square/requests/create_location_response.py index 6d07b122..5ff1b7ad 100644 --- a/src/square/requests/create_location_response.py +++ b/src/square/requests/create_location_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .location import LocationParams diff --git a/src/square/requests/create_loyalty_account_response.py b/src/square/requests/create_loyalty_account_response.py index 1a17f224..2747b258 100644 --- a/src/square/requests/create_loyalty_account_response.py +++ b/src/square/requests/create_loyalty_account_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_account import LoyaltyAccountParams diff --git a/src/square/requests/create_loyalty_promotion_response.py b/src/square/requests/create_loyalty_promotion_response.py index 1d8ba6f4..e87e983b 100644 --- a/src/square/requests/create_loyalty_promotion_response.py +++ b/src/square/requests/create_loyalty_promotion_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_promotion import LoyaltyPromotionParams diff --git a/src/square/requests/create_loyalty_reward_response.py b/src/square/requests/create_loyalty_reward_response.py index cbbd33b0..8525f25e 100644 --- a/src/square/requests/create_loyalty_reward_response.py +++ b/src/square/requests/create_loyalty_reward_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_reward import LoyaltyRewardParams diff --git a/src/square/requests/create_merchant_custom_attribute_definition_response.py b/src/square/requests/create_merchant_custom_attribute_definition_response.py index 3067c1f9..45a0597e 100644 --- a/src/square/requests/create_merchant_custom_attribute_definition_response.py +++ b/src/square/requests/create_merchant_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_mobile_authorization_code_response.py b/src/square/requests/create_mobile_authorization_code_response.py index d75b37cd..e29247d3 100644 --- a/src/square/requests/create_mobile_authorization_code_response.py +++ b/src/square/requests/create_mobile_authorization_code_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/create_order_custom_attribute_definition_response.py b/src/square/requests/create_order_custom_attribute_definition_response.py index 9272534c..0d6d7e34 100644 --- a/src/square/requests/create_order_custom_attribute_definition_response.py +++ b/src/square/requests/create_order_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/create_order_request.py b/src/square/requests/create_order_request.py index cd43aef5..d9b7cbc6 100644 --- a/src/square/requests/create_order_request.py +++ b/src/square/requests/create_order_request.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .order import OrderParams diff --git a/src/square/requests/create_order_response.py b/src/square/requests/create_order_response.py index efb02685..5b29a766 100644 --- a/src/square/requests/create_order_response.py +++ b/src/square/requests/create_order_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .order import OrderParams +import typing +from .error import ErrorParams class CreateOrderResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_payment_link_response.py b/src/square/requests/create_payment_link_response.py index 6a7a0355..66a9a03c 100644 --- a/src/square/requests/create_payment_link_response.py +++ b/src/square/requests/create_payment_link_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_link import PaymentLinkParams from .payment_link_related_resources import PaymentLinkRelatedResourcesParams diff --git a/src/square/requests/create_payment_response.py b/src/square/requests/create_payment_response.py index d5b3dc15..d252c1d7 100644 --- a/src/square/requests/create_payment_response.py +++ b/src/square/requests/create_payment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment import PaymentParams diff --git a/src/square/requests/create_scheduled_shift_response.py b/src/square/requests/create_scheduled_shift_response.py index bb260c55..fc8f1f4f 100644 --- a/src/square/requests/create_scheduled_shift_response.py +++ b/src/square/requests/create_scheduled_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .scheduled_shift import ScheduledShiftParams +import typing +from .error import ErrorParams class CreateScheduledShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_shift_response.py b/src/square/requests/create_shift_response.py index 95ed60ef..1b3008d0 100644 --- a/src/square/requests/create_shift_response.py +++ b/src/square/requests/create_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .shift import ShiftParams +import typing +from .error import ErrorParams class CreateShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_subscription_response.py b/src/square/requests/create_subscription_response.py index 959192a3..06455c66 100644 --- a/src/square/requests/create_subscription_response.py +++ b/src/square/requests/create_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams diff --git a/src/square/requests/create_team_member_request.py b/src/square/requests/create_team_member_request.py index 464ecf13..73fac371 100644 --- a/src/square/requests/create_team_member_request.py +++ b/src/square/requests/create_team_member_request.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .team_member import TeamMemberParams diff --git a/src/square/requests/create_team_member_response.py b/src/square/requests/create_team_member_response.py index 4db2914f..7711a9c3 100644 --- a/src/square/requests/create_team_member_response.py +++ b/src/square/requests/create_team_member_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .team_member import TeamMemberParams +import typing +from .error import ErrorParams class CreateTeamMemberResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_terminal_action_response.py b/src/square/requests/create_terminal_action_response.py index 8e8ff6ae..bbd69990 100644 --- a/src/square/requests/create_terminal_action_response.py +++ b/src/square/requests/create_terminal_action_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_action import TerminalActionParams diff --git a/src/square/requests/create_terminal_checkout_response.py b/src/square/requests/create_terminal_checkout_response.py index 524cdca7..517a509f 100644 --- a/src/square/requests/create_terminal_checkout_response.py +++ b/src/square/requests/create_terminal_checkout_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/create_terminal_refund_response.py b/src/square/requests/create_terminal_refund_response.py index f4207f37..e96b39ac 100644 --- a/src/square/requests/create_terminal_refund_response.py +++ b/src/square/requests/create_terminal_refund_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/create_timecard_response.py b/src/square/requests/create_timecard_response.py index 7a1c6d17..d044a8dd 100644 --- a/src/square/requests/create_timecard_response.py +++ b/src/square/requests/create_timecard_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .timecard import TimecardParams +import typing +from .error import ErrorParams class CreateTimecardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/create_transfer_order_data.py b/src/square/requests/create_transfer_order_data.py deleted file mode 100644 index f85bfcd2..00000000 --- a/src/square/requests/create_transfer_order_data.py +++ /dev/null @@ -1,52 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .create_transfer_order_line_data import CreateTransferOrderLineDataParams - - -class CreateTransferOrderDataParams(typing_extensions.TypedDict): - """ - Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s - between [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder) - endpoint. - """ - - source_location_id: str - """ - The source [Location](entity:Location) that will send the items. Must be an active location - in your Square account with sufficient inventory of the requested items. - """ - - destination_location_id: str - """ - The destination [Location](entity:Location) that will receive the items. Must be an active location - in your Square account - """ - - expected_at: typing_extensions.NotRequired[typing.Optional[str]] - """ - Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). - """ - - notes: typing_extensions.NotRequired[typing.Optional[str]] - """ - Optional notes about the transfer - """ - - tracking_number: typing_extensions.NotRequired[typing.Optional[str]] - """ - Optional shipment tracking number - """ - - created_by_team_member_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - ID of the [TeamMember](entity:TeamMember) creating this transfer order. Used for tracking - and auditing purposes. - """ - - line_items: typing_extensions.NotRequired[typing.Optional[typing.Sequence[CreateTransferOrderLineDataParams]]] - """ - List of [CatalogItemVariation](entity:CatalogItemVariation)s to transfer, including quantities - """ diff --git a/src/square/requests/create_transfer_order_line_data.py b/src/square/requests/create_transfer_order_line_data.py deleted file mode 100644 index 1cf2d6af..00000000 --- a/src/square/requests/create_transfer_order_line_data.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - - -class CreateTransferOrderLineDataParams(typing_extensions.TypedDict): - """ - Data for creating a new transfer order line item. Each line item specifies a - [CatalogItemVariation](entity:CatalogItemVariation) and quantity to transfer. - """ - - item_variation_id: str - """ - ID of the [CatalogItemVariation](entity:CatalogItemVariation) to transfer. Must reference a valid - item variation in the [Catalog](api:Catalog). The item variation must be: - - Active and available for sale - - Enabled for inventory tracking - - Available at the source location - """ - - quantity_ordered: str - """ - Total quantity ordered - """ diff --git a/src/square/requests/create_transfer_order_response.py b/src/square/requests/create_transfer_order_response.py deleted file mode 100644 index cb6ceefa..00000000 --- a/src/square/requests/create_transfer_order_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class CreateTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response for creating a transfer order. - """ - - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The created transfer order - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/create_vendor_response.py b/src/square/requests/create_vendor_response.py index ee87970d..bc2778e2 100644 --- a/src/square/requests/create_vendor_response.py +++ b/src/square/requests/create_vendor_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .vendor import VendorParams diff --git a/src/square/requests/create_webhook_subscription_response.py b/src/square/requests/create_webhook_subscription_response.py index e33ee212..de341ccb 100644 --- a/src/square/requests/create_webhook_subscription_response.py +++ b/src/square/requests/create_webhook_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .webhook_subscription import WebhookSubscriptionParams diff --git a/src/square/requests/custom_attribute.py b/src/square/requests/custom_attribute.py index 60346299..f1acaf09 100644 --- a/src/square/requests/custom_attribute.py +++ b/src/square/requests/custom_attribute.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.custom_attribute_definition_visibility import CustomAttributeDefinitionVisibility from .custom_attribute_definition import CustomAttributeDefinitionParams @@ -28,7 +28,7 @@ class CustomAttributeParams(typing_extensions.TypedDict): underscores (_), and hyphens (-). """ - value: typing_extensions.NotRequired[typing.Optional[typing.Any]] + value: typing_extensions.NotRequired[typing.Optional[typing.Optional[typing.Any]]] """ The value assigned to the custom attribute. It is validated against the custom attribute definition's schema on write operations. For more information about custom diff --git a/src/square/requests/custom_attribute_definition.py b/src/square/requests/custom_attribute_definition.py index cab5bea0..1ccf0655 100644 --- a/src/square/requests/custom_attribute_definition.py +++ b/src/square/requests/custom_attribute_definition.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.custom_attribute_definition_visibility import CustomAttributeDefinitionVisibility @@ -31,7 +31,7 @@ class CustomAttributeDefinitionParams(typing_extensions.TypedDict): a definition and must be unique per application, seller, and resource type. """ - schema: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Any]]] + schema: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]] """ The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information, see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition. diff --git a/src/square/requests/custom_attribute_definition_event_data.py b/src/square/requests/custom_attribute_definition_event_data.py index f49a8471..973427e4 100644 --- a/src/square/requests/custom_attribute_definition_event_data.py +++ b/src/square/requests/custom_attribute_definition_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data_object import CustomAttributeDefinitionEventDataObjectParams diff --git a/src/square/requests/custom_attribute_definition_event_data_object.py b/src/square/requests/custom_attribute_definition_event_data_object.py index ea06b2e5..a4579ff0 100644 --- a/src/square/requests/custom_attribute_definition_event_data_object.py +++ b/src/square/requests/custom_attribute_definition_event_data_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams diff --git a/src/square/requests/custom_attribute_event_data.py b/src/square/requests/custom_attribute_event_data.py index a36d7e48..50fd3570 100644 --- a/src/square/requests/custom_attribute_event_data.py +++ b/src/square/requests/custom_attribute_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data_object import CustomAttributeEventDataObjectParams diff --git a/src/square/requests/custom_attribute_event_data_object.py b/src/square/requests/custom_attribute_event_data_object.py index d58226bb..27ab8c29 100644 --- a/src/square/requests/custom_attribute_event_data_object.py +++ b/src/square/requests/custom_attribute_event_data_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams diff --git a/src/square/requests/custom_attribute_filter.py b/src/square/requests/custom_attribute_filter.py index 9e8f5886..c832879e 100644 --- a/src/square/requests/custom_attribute_filter.py +++ b/src/square/requests/custom_attribute_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .range import RangeParams diff --git a/src/square/requests/customer.py b/src/square/requests/customer.py index f26bbb19..64544fb7 100644 --- a/src/square/requests/customer.py +++ b/src/square/requests/customer.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.customer_creation_source import CustomerCreationSource +import typing_extensions +import typing from .address import AddressParams from .customer_preferences import CustomerPreferencesParams +from ..types.customer_creation_source import CustomerCreationSource from .customer_tax_ids import CustomerTaxIdsParams diff --git a/src/square/requests/customer_address_filter.py b/src/square/requests/customer_address_filter.py index 3b94867b..36c16811 100644 --- a/src/square/requests/customer_address_filter.py +++ b/src/square/requests/customer_address_filter.py @@ -1,8 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.country import Country +import typing_extensions from .customer_text_filter import CustomerTextFilterParams +from ..types.country import Country class CustomerAddressFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_created_event.py b/src/square/requests/customer_created_event.py index 9ebf43cc..ef676f09 100644 --- a/src/square/requests/customer_created_event.py +++ b/src/square/requests/customer_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_created_event_data import CustomerCreatedEventDataParams diff --git a/src/square/requests/customer_created_event_data.py b/src/square/requests/customer_created_event_data.py index 4d18ec3a..55da3b45 100644 --- a/src/square/requests/customer_created_event_data.py +++ b/src/square/requests/customer_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_created_event_object import CustomerCreatedEventObjectParams diff --git a/src/square/requests/customer_created_event_event_context.py b/src/square/requests/customer_created_event_event_context.py index 1baf7927..9af3e922 100644 --- a/src/square/requests/customer_created_event_event_context.py +++ b/src/square/requests/customer_created_event_event_context.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer_created_event_event_context_merge import CustomerCreatedEventEventContextMergeParams diff --git a/src/square/requests/customer_created_event_event_context_merge.py b/src/square/requests/customer_created_event_event_context_merge.py index bb8477e7..268169e3 100644 --- a/src/square/requests/customer_created_event_event_context_merge.py +++ b/src/square/requests/customer_created_event_event_context_merge.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CustomerCreatedEventEventContextMergeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_created_event_object.py b/src/square/requests/customer_created_event_object.py index 7789e1b1..36123e27 100644 --- a/src/square/requests/customer_created_event_object.py +++ b/src/square/requests/customer_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer import CustomerParams from .customer_created_event_event_context import CustomerCreatedEventEventContextParams diff --git a/src/square/requests/customer_creation_source_filter.py b/src/square/requests/customer_creation_source_filter.py index 133a4b73..155c807e 100644 --- a/src/square/requests/customer_creation_source_filter.py +++ b/src/square/requests/customer_creation_source_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.customer_creation_source import CustomerCreationSource from ..types.customer_inclusion_exclusion import CustomerInclusionExclusion diff --git a/src/square/requests/customer_custom_attribute_definition_created_event.py b/src/square/requests/customer_custom_attribute_definition_created_event.py index 45c6dcb3..56382041 100644 --- a/src/square/requests/customer_custom_attribute_definition_created_event.py +++ b/src/square/requests/customer_custom_attribute_definition_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_created_public_event.py b/src/square/requests/customer_custom_attribute_definition_created_public_event.py index dfb21386..d5fdac86 100644 --- a/src/square/requests/customer_custom_attribute_definition_created_public_event.py +++ b/src/square/requests/customer_custom_attribute_definition_created_public_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_deleted_event.py b/src/square/requests/customer_custom_attribute_definition_deleted_event.py index c171c9ed..e8d80091 100644 --- a/src/square/requests/customer_custom_attribute_definition_deleted_event.py +++ b/src/square/requests/customer_custom_attribute_definition_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_deleted_public_event.py b/src/square/requests/customer_custom_attribute_definition_deleted_public_event.py index 0696a9b2..11dc6ca3 100644 --- a/src/square/requests/customer_custom_attribute_definition_deleted_public_event.py +++ b/src/square/requests/customer_custom_attribute_definition_deleted_public_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_owned_created_event.py b/src/square/requests/customer_custom_attribute_definition_owned_created_event.py index e16c7700..e4018059 100644 --- a/src/square/requests/customer_custom_attribute_definition_owned_created_event.py +++ b/src/square/requests/customer_custom_attribute_definition_owned_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_owned_deleted_event.py b/src/square/requests/customer_custom_attribute_definition_owned_deleted_event.py index 982353e7..4937e6c0 100644 --- a/src/square/requests/customer_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/requests/customer_custom_attribute_definition_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_owned_updated_event.py b/src/square/requests/customer_custom_attribute_definition_owned_updated_event.py index cf76c30b..82e3e309 100644 --- a/src/square/requests/customer_custom_attribute_definition_owned_updated_event.py +++ b/src/square/requests/customer_custom_attribute_definition_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_updated_event.py b/src/square/requests/customer_custom_attribute_definition_updated_event.py index 03334bc3..30b417b1 100644 --- a/src/square/requests/customer_custom_attribute_definition_updated_event.py +++ b/src/square/requests/customer_custom_attribute_definition_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_updated_public_event.py b/src/square/requests/customer_custom_attribute_definition_updated_public_event.py index e936c84c..f14f2950 100644 --- a/src/square/requests/customer_custom_attribute_definition_updated_public_event.py +++ b/src/square/requests/customer_custom_attribute_definition_updated_public_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_visible_created_event.py b/src/square/requests/customer_custom_attribute_definition_visible_created_event.py index 9e85c7da..2cd678e5 100644 --- a/src/square/requests/customer_custom_attribute_definition_visible_created_event.py +++ b/src/square/requests/customer_custom_attribute_definition_visible_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_visible_deleted_event.py b/src/square/requests/customer_custom_attribute_definition_visible_deleted_event.py index 5abb49e5..07ffc10f 100644 --- a/src/square/requests/customer_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/requests/customer_custom_attribute_definition_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_definition_visible_updated_event.py b/src/square/requests/customer_custom_attribute_definition_visible_updated_event.py index 50081ddc..c40ac4d6 100644 --- a/src/square/requests/customer_custom_attribute_definition_visible_updated_event.py +++ b/src/square/requests/customer_custom_attribute_definition_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/customer_custom_attribute_deleted_event.py b/src/square/requests/customer_custom_attribute_deleted_event.py index 3c91e98f..6ebf84ed 100644 --- a/src/square/requests/customer_custom_attribute_deleted_event.py +++ b/src/square/requests/customer_custom_attribute_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_deleted_public_event.py b/src/square/requests/customer_custom_attribute_deleted_public_event.py index 7ecffdaa..b6dfde2a 100644 --- a/src/square/requests/customer_custom_attribute_deleted_public_event.py +++ b/src/square/requests/customer_custom_attribute_deleted_public_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_filter.py b/src/square/requests/customer_custom_attribute_filter.py index cddaef85..4c612c10 100644 --- a/src/square/requests/customer_custom_attribute_filter.py +++ b/src/square/requests/customer_custom_attribute_filter.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer_custom_attribute_filter_value import CustomerCustomAttributeFilterValueParams from .time_range import TimeRangeParams diff --git a/src/square/requests/customer_custom_attribute_filter_value.py b/src/square/requests/customer_custom_attribute_filter_value.py index 7c48d1e2..1763316b 100644 --- a/src/square/requests/customer_custom_attribute_filter_value.py +++ b/src/square/requests/customer_custom_attribute_filter_value.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_address_filter import CustomerAddressFilterParams +import typing_extensions from .customer_text_filter import CustomerTextFilterParams from .filter_value import FilterValueParams -from .float_number_range import FloatNumberRangeParams from .time_range import TimeRangeParams +from .float_number_range import FloatNumberRangeParams +import typing +from .customer_address_filter import CustomerAddressFilterParams class CustomerCustomAttributeFilterValueParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_custom_attribute_filters.py b/src/square/requests/customer_custom_attribute_filters.py index 6a1c13d9..b414b422 100644 --- a/src/square/requests/customer_custom_attribute_filters.py +++ b/src/square/requests/customer_custom_attribute_filters.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_custom_attribute_filter import CustomerCustomAttributeFilterParams diff --git a/src/square/requests/customer_custom_attribute_owned_deleted_event.py b/src/square/requests/customer_custom_attribute_owned_deleted_event.py index f6aaaf81..142b6439 100644 --- a/src/square/requests/customer_custom_attribute_owned_deleted_event.py +++ b/src/square/requests/customer_custom_attribute_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_owned_updated_event.py b/src/square/requests/customer_custom_attribute_owned_updated_event.py index d35fa2c6..94c5c24c 100644 --- a/src/square/requests/customer_custom_attribute_owned_updated_event.py +++ b/src/square/requests/customer_custom_attribute_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_updated_event.py b/src/square/requests/customer_custom_attribute_updated_event.py index 972a3a89..0528657a 100644 --- a/src/square/requests/customer_custom_attribute_updated_event.py +++ b/src/square/requests/customer_custom_attribute_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_updated_public_event.py b/src/square/requests/customer_custom_attribute_updated_public_event.py index 3aa1cbb8..c43fe260 100644 --- a/src/square/requests/customer_custom_attribute_updated_public_event.py +++ b/src/square/requests/customer_custom_attribute_updated_public_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_visible_deleted_event.py b/src/square/requests/customer_custom_attribute_visible_deleted_event.py index da7b562c..13c702ef 100644 --- a/src/square/requests/customer_custom_attribute_visible_deleted_event.py +++ b/src/square/requests/customer_custom_attribute_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_custom_attribute_visible_updated_event.py b/src/square/requests/customer_custom_attribute_visible_updated_event.py index 3cfcf73f..7b15da9a 100644 --- a/src/square/requests/customer_custom_attribute_visible_updated_event.py +++ b/src/square/requests/customer_custom_attribute_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/customer_deleted_event.py b/src/square/requests/customer_deleted_event.py index 50b7027e..f70c0b54 100644 --- a/src/square/requests/customer_deleted_event.py +++ b/src/square/requests/customer_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_deleted_event_data import CustomerDeletedEventDataParams diff --git a/src/square/requests/customer_deleted_event_data.py b/src/square/requests/customer_deleted_event_data.py index 9612077a..d4b7fa40 100644 --- a/src/square/requests/customer_deleted_event_data.py +++ b/src/square/requests/customer_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_deleted_event_object import CustomerDeletedEventObjectParams diff --git a/src/square/requests/customer_deleted_event_event_context.py b/src/square/requests/customer_deleted_event_event_context.py index adb7ca57..5b3f1be6 100644 --- a/src/square/requests/customer_deleted_event_event_context.py +++ b/src/square/requests/customer_deleted_event_event_context.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer_deleted_event_event_context_merge import CustomerDeletedEventEventContextMergeParams diff --git a/src/square/requests/customer_deleted_event_event_context_merge.py b/src/square/requests/customer_deleted_event_event_context_merge.py index 42797bd6..54104f7c 100644 --- a/src/square/requests/customer_deleted_event_event_context_merge.py +++ b/src/square/requests/customer_deleted_event_event_context_merge.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CustomerDeletedEventEventContextMergeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_deleted_event_object.py b/src/square/requests/customer_deleted_event_object.py index 26fc18c3..01dc3b7d 100644 --- a/src/square/requests/customer_deleted_event_object.py +++ b/src/square/requests/customer_deleted_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer import CustomerParams from .customer_deleted_event_event_context import CustomerDeletedEventEventContextParams diff --git a/src/square/requests/customer_details.py b/src/square/requests/customer_details.py index d11b5a62..f89a2e76 100644 --- a/src/square/requests/customer_details.py +++ b/src/square/requests/customer_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CustomerDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_filter.py b/src/square/requests/customer_filter.py index 2a758fa0..46386c38 100644 --- a/src/square/requests/customer_filter.py +++ b/src/square/requests/customer_filter.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer_creation_source_filter import CustomerCreationSourceFilterParams -from .customer_custom_attribute_filters import CustomerCustomAttributeFiltersParams +from .time_range import TimeRangeParams from .customer_text_filter import CustomerTextFilterParams from .filter_value import FilterValueParams -from .time_range import TimeRangeParams +from .customer_custom_attribute_filters import CustomerCustomAttributeFiltersParams class CustomerFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_group.py b/src/square/requests/customer_group.py index 9d0b9f75..4c02a2cb 100644 --- a/src/square/requests/customer_group.py +++ b/src/square/requests/customer_group.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class CustomerGroupParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_preferences.py b/src/square/requests/customer_preferences.py index 81161028..a60a9ee7 100644 --- a/src/square/requests/customer_preferences.py +++ b/src/square/requests/customer_preferences.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CustomerPreferencesParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_query.py b/src/square/requests/customer_query.py index 1b38853f..60d8237f 100644 --- a/src/square/requests/customer_query.py +++ b/src/square/requests/customer_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer_filter import CustomerFilterParams from .customer_sort import CustomerSortParams diff --git a/src/square/requests/customer_segment.py b/src/square/requests/customer_segment.py index 1b5cafac..8ced3324 100644 --- a/src/square/requests/customer_segment.py +++ b/src/square/requests/customer_segment.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class CustomerSegmentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_sort.py b/src/square/requests/customer_sort.py index 6f2b4008..7757edae 100644 --- a/src/square/requests/customer_sort.py +++ b/src/square/requests/customer_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.customer_sort_field import CustomerSortField from ..types.sort_order import SortOrder diff --git a/src/square/requests/customer_tax_ids.py b/src/square/requests/customer_tax_ids.py index fe673b7f..4aa726ad 100644 --- a/src/square/requests/customer_tax_ids.py +++ b/src/square/requests/customer_tax_ids.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CustomerTaxIdsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_text_filter.py b/src/square/requests/customer_text_filter.py index 191f5595..cf84c05a 100644 --- a/src/square/requests/customer_text_filter.py +++ b/src/square/requests/customer_text_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class CustomerTextFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/customer_updated_event.py b/src/square/requests/customer_updated_event.py index c80bb627..5646a0f4 100644 --- a/src/square/requests/customer_updated_event.py +++ b/src/square/requests/customer_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_updated_event_data import CustomerUpdatedEventDataParams diff --git a/src/square/requests/customer_updated_event_data.py b/src/square/requests/customer_updated_event_data.py index e2f35f28..ea959142 100644 --- a/src/square/requests/customer_updated_event_data.py +++ b/src/square/requests/customer_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .customer_updated_event_object import CustomerUpdatedEventObjectParams diff --git a/src/square/requests/customer_updated_event_object.py b/src/square/requests/customer_updated_event_object.py index 7ec0543e..e36799ca 100644 --- a/src/square/requests/customer_updated_event_object.py +++ b/src/square/requests/customer_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .customer import CustomerParams diff --git a/src/square/requests/data_collection_options.py b/src/square/requests/data_collection_options.py index 28ea1ba8..a4d02718 100644 --- a/src/square/requests/data_collection_options.py +++ b/src/square/requests/data_collection_options.py @@ -2,6 +2,7 @@ import typing_extensions from ..types.data_collection_options_input_type import DataCollectionOptionsInputType +import typing_extensions from .collected_data import CollectedDataParams diff --git a/src/square/requests/date_range.py b/src/square/requests/date_range.py index 4ca91c85..43fc699e 100644 --- a/src/square/requests/date_range.py +++ b/src/square/requests/date_range.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DateRangeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/delete_booking_custom_attribute_definition_response.py b/src/square/requests/delete_booking_custom_attribute_definition_response.py index 0987947c..afe62fa2 100644 --- a/src/square/requests/delete_booking_custom_attribute_definition_response.py +++ b/src/square/requests/delete_booking_custom_attribute_definition_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_booking_custom_attribute_response.py b/src/square/requests/delete_booking_custom_attribute_response.py index 1c6ae976..452bd238 100644 --- a/src/square/requests/delete_booking_custom_attribute_response.py +++ b/src/square/requests/delete_booking_custom_attribute_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_break_type_response.py b/src/square/requests/delete_break_type_response.py index ffa46882..5d7638f4 100644 --- a/src/square/requests/delete_break_type_response.py +++ b/src/square/requests/delete_break_type_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_catalog_object_response.py b/src/square/requests/delete_catalog_object_response.py index 0cac152f..f1075b53 100644 --- a/src/square/requests/delete_catalog_object_response.py +++ b/src/square/requests/delete_catalog_object_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_customer_card_response.py b/src/square/requests/delete_customer_card_response.py index 26cb66da..070a10e6 100644 --- a/src/square/requests/delete_customer_card_response.py +++ b/src/square/requests/delete_customer_card_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_customer_custom_attribute_definition_response.py b/src/square/requests/delete_customer_custom_attribute_definition_response.py index 12f4a350..70d68852 100644 --- a/src/square/requests/delete_customer_custom_attribute_definition_response.py +++ b/src/square/requests/delete_customer_custom_attribute_definition_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_customer_custom_attribute_response.py b/src/square/requests/delete_customer_custom_attribute_response.py index d40cb609..e3825a78 100644 --- a/src/square/requests/delete_customer_custom_attribute_response.py +++ b/src/square/requests/delete_customer_custom_attribute_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_customer_group_response.py b/src/square/requests/delete_customer_group_response.py index bff544e0..55640355 100644 --- a/src/square/requests/delete_customer_group_response.py +++ b/src/square/requests/delete_customer_group_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_customer_response.py b/src/square/requests/delete_customer_response.py index f1a3dd54..fc9fc26b 100644 --- a/src/square/requests/delete_customer_response.py +++ b/src/square/requests/delete_customer_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_dispute_evidence_response.py b/src/square/requests/delete_dispute_evidence_response.py index dc20b608..c480f554 100644 --- a/src/square/requests/delete_dispute_evidence_response.py +++ b/src/square/requests/delete_dispute_evidence_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_invoice_attachment_response.py b/src/square/requests/delete_invoice_attachment_response.py index b42e0d8e..2131e9b8 100644 --- a/src/square/requests/delete_invoice_attachment_response.py +++ b/src/square/requests/delete_invoice_attachment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_invoice_response.py b/src/square/requests/delete_invoice_response.py index 36eab557..4e12ae19 100644 --- a/src/square/requests/delete_invoice_response.py +++ b/src/square/requests/delete_invoice_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_location_custom_attribute_definition_response.py b/src/square/requests/delete_location_custom_attribute_definition_response.py index 06e687e2..c3b9d441 100644 --- a/src/square/requests/delete_location_custom_attribute_definition_response.py +++ b/src/square/requests/delete_location_custom_attribute_definition_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_location_custom_attribute_response.py b/src/square/requests/delete_location_custom_attribute_response.py index 57e7b072..f4daa091 100644 --- a/src/square/requests/delete_location_custom_attribute_response.py +++ b/src/square/requests/delete_location_custom_attribute_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_loyalty_reward_response.py b/src/square/requests/delete_loyalty_reward_response.py index a2d666e4..541a9d54 100644 --- a/src/square/requests/delete_loyalty_reward_response.py +++ b/src/square/requests/delete_loyalty_reward_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_merchant_custom_attribute_definition_response.py b/src/square/requests/delete_merchant_custom_attribute_definition_response.py index 0a6ed9db..72283214 100644 --- a/src/square/requests/delete_merchant_custom_attribute_definition_response.py +++ b/src/square/requests/delete_merchant_custom_attribute_definition_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_merchant_custom_attribute_response.py b/src/square/requests/delete_merchant_custom_attribute_response.py index 306acfd3..5eb7ff8b 100644 --- a/src/square/requests/delete_merchant_custom_attribute_response.py +++ b/src/square/requests/delete_merchant_custom_attribute_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_order_custom_attribute_definition_response.py b/src/square/requests/delete_order_custom_attribute_definition_response.py index 44497bf1..df172019 100644 --- a/src/square/requests/delete_order_custom_attribute_definition_response.py +++ b/src/square/requests/delete_order_custom_attribute_definition_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_order_custom_attribute_response.py b/src/square/requests/delete_order_custom_attribute_response.py index 0365f527..4d5f6f86 100644 --- a/src/square/requests/delete_order_custom_attribute_response.py +++ b/src/square/requests/delete_order_custom_attribute_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_payment_link_response.py b/src/square/requests/delete_payment_link_response.py index 7699b5da..2d355787 100644 --- a/src/square/requests/delete_payment_link_response.py +++ b/src/square/requests/delete_payment_link_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_shift_response.py b/src/square/requests/delete_shift_response.py index 55959297..a3a250c2 100644 --- a/src/square/requests/delete_shift_response.py +++ b/src/square/requests/delete_shift_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_snippet_response.py b/src/square/requests/delete_snippet_response.py index 940b0bd7..da9a4d7b 100644 --- a/src/square/requests/delete_snippet_response.py +++ b/src/square/requests/delete_snippet_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_subscription_action_response.py b/src/square/requests/delete_subscription_action_response.py index ab00e5b0..39023a7d 100644 --- a/src/square/requests/delete_subscription_action_response.py +++ b/src/square/requests/delete_subscription_action_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams diff --git a/src/square/requests/delete_timecard_response.py b/src/square/requests/delete_timecard_response.py index 12cff5de..70f84b1f 100644 --- a/src/square/requests/delete_timecard_response.py +++ b/src/square/requests/delete_timecard_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/delete_transfer_order_response.py b/src/square/requests/delete_transfer_order_response.py deleted file mode 100644 index 32302ca8..00000000 --- a/src/square/requests/delete_transfer_order_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams - - -class DeleteTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response for deleting a transfer order - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/delete_webhook_subscription_response.py b/src/square/requests/delete_webhook_subscription_response.py index 5036123e..ed0ae662 100644 --- a/src/square/requests/delete_webhook_subscription_response.py +++ b/src/square/requests/delete_webhook_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/destination.py b/src/square/requests/destination.py index e50e418e..e00126ec 100644 --- a/src/square/requests/destination.py +++ b/src/square/requests/destination.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.destination_type import DestinationType diff --git a/src/square/requests/destination_details.py b/src/square/requests/destination_details.py index f7bd07e6..fa163c6d 100644 --- a/src/square/requests/destination_details.py +++ b/src/square/requests/destination_details.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .destination_details_card_refund_details import DestinationDetailsCardRefundDetailsParams from .destination_details_cash_refund_details import DestinationDetailsCashRefundDetailsParams diff --git a/src/square/requests/destination_details_card_refund_details.py b/src/square/requests/destination_details_card_refund_details.py index 14e400c8..165552f0 100644 --- a/src/square/requests/destination_details_card_refund_details.py +++ b/src/square/requests/destination_details_card_refund_details.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .card import CardParams +import typing class DestinationDetailsCardRefundDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/destination_details_cash_refund_details.py b/src/square/requests/destination_details_cash_refund_details.py index d3658d71..4387744c 100644 --- a/src/square/requests/destination_details_cash_refund_details.py +++ b/src/square/requests/destination_details_cash_refund_details.py @@ -2,6 +2,7 @@ import typing_extensions from .money import MoneyParams +import typing_extensions class DestinationDetailsCashRefundDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/destination_details_external_refund_details.py b/src/square/requests/destination_details_external_refund_details.py index 382e40f7..06055c6a 100644 --- a/src/square/requests/destination_details_external_refund_details.py +++ b/src/square/requests/destination_details_external_refund_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DestinationDetailsExternalRefundDetailsParams(typing_extensions.TypedDict): @@ -16,7 +16,7 @@ class DestinationDetailsExternalRefundDetailsParams(typing_extensions.TypedDict) following: - CHECK - Refunded using a physical check. - BANK_TRANSFER - Refunded using external bank transfer. - - OTHER\\_GIFT\\_CARD - Refunded using a non-Square gift card. + - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. - CRYPTO - Refunded using a crypto currency. - SQUARE_CASH - Refunded using Square Cash App. - SOCIAL - Refunded using peer-to-peer payment applications. diff --git a/src/square/requests/device.py b/src/square/requests/device.py index d1a1e8db..37fbdcba 100644 --- a/src/square/requests/device.py +++ b/src/square/requests/device.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .component import ComponentParams +import typing_extensions from .device_attributes import DeviceAttributesParams +import typing +from .component import ComponentParams from .device_status import DeviceStatusParams diff --git a/src/square/requests/device_attributes.py b/src/square/requests/device_attributes.py index 506cbbb6..7609eb45 100644 --- a/src/square/requests/device_attributes.py +++ b/src/square/requests/device_attributes.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..types.device_attributes_device_type import DeviceAttributesDeviceType +import typing_extensions +import typing class DeviceAttributesParams(typing_extensions.TypedDict): diff --git a/src/square/requests/device_checkout_options.py b/src/square/requests/device_checkout_options.py index 75b53644..38f7cc04 100644 --- a/src/square/requests/device_checkout_options.py +++ b/src/square/requests/device_checkout_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .tip_settings import TipSettingsParams diff --git a/src/square/requests/device_code.py b/src/square/requests/device_code.py index c2f12526..5a187010 100644 --- a/src/square/requests/device_code.py +++ b/src/square/requests/device_code.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.device_code_status import DeviceCodeStatus +import typing_extensions +import typing from ..types.product_type import ProductType +from ..types.device_code_status import DeviceCodeStatus class DeviceCodeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/device_code_paired_event.py b/src/square/requests/device_code_paired_event.py index 83f74513..c2cf19a5 100644 --- a/src/square/requests/device_code_paired_event.py +++ b/src/square/requests/device_code_paired_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .device_code_paired_event_data import DeviceCodePairedEventDataParams diff --git a/src/square/requests/device_code_paired_event_data.py b/src/square/requests/device_code_paired_event_data.py index aef51a52..fedff514 100644 --- a/src/square/requests/device_code_paired_event_data.py +++ b/src/square/requests/device_code_paired_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .device_code_paired_event_object import DeviceCodePairedEventObjectParams diff --git a/src/square/requests/device_code_paired_event_object.py b/src/square/requests/device_code_paired_event_object.py index 4e701845..09db1a88 100644 --- a/src/square/requests/device_code_paired_event_object.py +++ b/src/square/requests/device_code_paired_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .device_code import DeviceCodeParams diff --git a/src/square/requests/device_component_details_application_details.py b/src/square/requests/device_component_details_application_details.py index c192688c..3942e7ab 100644 --- a/src/square/requests/device_component_details_application_details.py +++ b/src/square/requests/device_component_details_application_details.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.application_type import ApplicationType +import typing class DeviceComponentDetailsApplicationDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/device_component_details_battery_details.py b/src/square/requests/device_component_details_battery_details.py index bb8d8da9..6764b47a 100644 --- a/src/square/requests/device_component_details_battery_details.py +++ b/src/square/requests/device_component_details_battery_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.device_component_details_external_power import DeviceComponentDetailsExternalPower diff --git a/src/square/requests/device_component_details_card_reader_details.py b/src/square/requests/device_component_details_card_reader_details.py index 854ec50c..c4ef09a1 100644 --- a/src/square/requests/device_component_details_card_reader_details.py +++ b/src/square/requests/device_component_details_card_reader_details.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class DeviceComponentDetailsCardReaderDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/device_component_details_ethernet_details.py b/src/square/requests/device_component_details_ethernet_details.py index a26bfdc1..0b595ede 100644 --- a/src/square/requests/device_component_details_ethernet_details.py +++ b/src/square/requests/device_component_details_ethernet_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DeviceComponentDetailsEthernetDetailsParams(typing_extensions.TypedDict): @@ -15,8 +15,3 @@ class DeviceComponentDetailsEthernetDetailsParams(typing_extensions.TypedDict): """ The string representation of the device’s IPv4 address. """ - - mac_address: typing_extensions.NotRequired[typing.Optional[str]] - """ - The mac address of the device in this network. - """ diff --git a/src/square/requests/device_component_details_measurement.py b/src/square/requests/device_component_details_measurement.py index bcd482fc..a6a2a6cb 100644 --- a/src/square/requests/device_component_details_measurement.py +++ b/src/square/requests/device_component_details_measurement.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DeviceComponentDetailsMeasurementParams(typing_extensions.TypedDict): @@ -11,6 +11,3 @@ class DeviceComponentDetailsMeasurementParams(typing_extensions.TypedDict): """ value: typing_extensions.NotRequired[typing.Optional[int]] - """ - Value of measure. - """ diff --git a/src/square/requests/device_component_details_wi_fi_details.py b/src/square/requests/device_component_details_wi_fi_details.py index b5ea9181..50dfe5be 100644 --- a/src/square/requests/device_component_details_wi_fi_details.py +++ b/src/square/requests/device_component_details_wi_fi_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .device_component_details_measurement import DeviceComponentDetailsMeasurementParams @@ -32,8 +32,3 @@ class DeviceComponentDetailsWiFiDetailsParams(typing_extensions.TypedDict): """ A representation of signal strength of the WIFI network connection. """ - - mac_address: typing_extensions.NotRequired[typing.Optional[str]] - """ - The mac address of the device in this network. - """ diff --git a/src/square/requests/device_created_event.py b/src/square/requests/device_created_event.py index 4299d740..4d7e2de9 100644 --- a/src/square/requests/device_created_event.py +++ b/src/square/requests/device_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .device_created_event_data import DeviceCreatedEventDataParams diff --git a/src/square/requests/device_created_event_data.py b/src/square/requests/device_created_event_data.py index 5c8697a8..49bdd2b6 100644 --- a/src/square/requests/device_created_event_data.py +++ b/src/square/requests/device_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .device_created_event_object import DeviceCreatedEventObjectParams diff --git a/src/square/requests/device_created_event_object.py b/src/square/requests/device_created_event_object.py index f331f032..298d19cb 100644 --- a/src/square/requests/device_created_event_object.py +++ b/src/square/requests/device_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .device import DeviceParams diff --git a/src/square/requests/device_details.py b/src/square/requests/device_details.py index caae2bb5..3182f48b 100644 --- a/src/square/requests/device_details.py +++ b/src/square/requests/device_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DeviceDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/device_metadata.py b/src/square/requests/device_metadata.py index a995db21..d223e797 100644 --- a/src/square/requests/device_metadata.py +++ b/src/square/requests/device_metadata.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DeviceMetadataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/device_status.py b/src/square/requests/device_status.py index a264a33f..d1cb7da0 100644 --- a/src/square/requests/device_status.py +++ b/src/square/requests/device_status.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.device_status_category import DeviceStatusCategory @@ -7,6 +8,6 @@ class DeviceStatusParams(typing_extensions.TypedDict): category: typing_extensions.NotRequired[DeviceStatusCategory] """ - Category of the device status. + See [Category](#type-category) for possible values """ diff --git a/src/square/requests/digital_wallet_details.py b/src/square/requests/digital_wallet_details.py index 3f1de07b..24437416 100644 --- a/src/square/requests/digital_wallet_details.py +++ b/src/square/requests/digital_wallet_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .cash_app_details import CashAppDetailsParams diff --git a/src/square/requests/disable_card_response.py b/src/square/requests/disable_card_response.py index af24fb41..82d89e7f 100644 --- a/src/square/requests/disable_card_response.py +++ b/src/square/requests/disable_card_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .card import CardParams +import typing_extensions +import typing from .error import ErrorParams +from .card import CardParams class DisableCardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/disable_events_response.py b/src/square/requests/disable_events_response.py index 87bfa929..72187950 100644 --- a/src/square/requests/disable_events_response.py +++ b/src/square/requests/disable_events_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/dismiss_terminal_action_response.py b/src/square/requests/dismiss_terminal_action_response.py index d3e5d8f6..f9b74711 100644 --- a/src/square/requests/dismiss_terminal_action_response.py +++ b/src/square/requests/dismiss_terminal_action_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_action import TerminalActionParams diff --git a/src/square/requests/dismiss_terminal_checkout_response.py b/src/square/requests/dismiss_terminal_checkout_response.py index b9517d8f..fefcb3c2 100644 --- a/src/square/requests/dismiss_terminal_checkout_response.py +++ b/src/square/requests/dismiss_terminal_checkout_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/dismiss_terminal_refund_response.py b/src/square/requests/dismiss_terminal_refund_response.py index c006b19b..b9c558c2 100644 --- a/src/square/requests/dismiss_terminal_refund_response.py +++ b/src/square/requests/dismiss_terminal_refund_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/dispute.py b/src/square/requests/dispute.py index 68a6b55c..33d31696 100644 --- a/src/square/requests/dispute.py +++ b/src/square/requests/dispute.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.card_brand import CardBrand +import typing_extensions +import typing +from .money import MoneyParams from ..types.dispute_reason import DisputeReason from ..types.dispute_state import DisputeState from .disputed_payment import DisputedPaymentParams -from .money import MoneyParams +from ..types.card_brand import CardBrand class DisputeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/dispute_created_event.py b/src/square/requests/dispute_created_event.py index 3f10eb86..51d2839a 100644 --- a/src/square/requests/dispute_created_event.py +++ b/src/square/requests/dispute_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_created_event_data import DisputeCreatedEventDataParams diff --git a/src/square/requests/dispute_created_event_data.py b/src/square/requests/dispute_created_event_data.py index 9b255396..c0b651e6 100644 --- a/src/square/requests/dispute_created_event_data.py +++ b/src/square/requests/dispute_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_created_event_object import DisputeCreatedEventObjectParams diff --git a/src/square/requests/dispute_created_event_object.py b/src/square/requests/dispute_created_event_object.py index 3495e782..3c969b50 100644 --- a/src/square/requests/dispute_created_event_object.py +++ b/src/square/requests/dispute_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/dispute_evidence.py b/src/square/requests/dispute_evidence.py index 7d046e99..c86e8c1c 100644 --- a/src/square/requests/dispute_evidence.py +++ b/src/square/requests/dispute_evidence.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.dispute_evidence_type import DisputeEvidenceType +import typing_extensions +import typing from .dispute_evidence_file import DisputeEvidenceFileParams +from ..types.dispute_evidence_type import DisputeEvidenceType class DisputeEvidenceParams(typing_extensions.TypedDict): diff --git a/src/square/requests/dispute_evidence_added_event.py b/src/square/requests/dispute_evidence_added_event.py index 36af4375..91c1328a 100644 --- a/src/square/requests/dispute_evidence_added_event.py +++ b/src/square/requests/dispute_evidence_added_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_added_event_data import DisputeEvidenceAddedEventDataParams diff --git a/src/square/requests/dispute_evidence_added_event_data.py b/src/square/requests/dispute_evidence_added_event_data.py index 687b0630..9c9d136a 100644 --- a/src/square/requests/dispute_evidence_added_event_data.py +++ b/src/square/requests/dispute_evidence_added_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_added_event_object import DisputeEvidenceAddedEventObjectParams diff --git a/src/square/requests/dispute_evidence_added_event_object.py b/src/square/requests/dispute_evidence_added_event_object.py index 66675a98..62c24eca 100644 --- a/src/square/requests/dispute_evidence_added_event_object.py +++ b/src/square/requests/dispute_evidence_added_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/dispute_evidence_created_event.py b/src/square/requests/dispute_evidence_created_event.py index d2cca7c9..f4f91442 100644 --- a/src/square/requests/dispute_evidence_created_event.py +++ b/src/square/requests/dispute_evidence_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_created_event_data import DisputeEvidenceCreatedEventDataParams diff --git a/src/square/requests/dispute_evidence_created_event_data.py b/src/square/requests/dispute_evidence_created_event_data.py index ae812dec..2df3f284 100644 --- a/src/square/requests/dispute_evidence_created_event_data.py +++ b/src/square/requests/dispute_evidence_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_created_event_object import DisputeEvidenceCreatedEventObjectParams diff --git a/src/square/requests/dispute_evidence_created_event_object.py b/src/square/requests/dispute_evidence_created_event_object.py index 5c19da6b..cf617c96 100644 --- a/src/square/requests/dispute_evidence_created_event_object.py +++ b/src/square/requests/dispute_evidence_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/dispute_evidence_deleted_event.py b/src/square/requests/dispute_evidence_deleted_event.py index b8b19ba8..344f4fb9 100644 --- a/src/square/requests/dispute_evidence_deleted_event.py +++ b/src/square/requests/dispute_evidence_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_deleted_event_data import DisputeEvidenceDeletedEventDataParams diff --git a/src/square/requests/dispute_evidence_deleted_event_data.py b/src/square/requests/dispute_evidence_deleted_event_data.py index 5374a3c0..dae9f536 100644 --- a/src/square/requests/dispute_evidence_deleted_event_data.py +++ b/src/square/requests/dispute_evidence_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_deleted_event_object import DisputeEvidenceDeletedEventObjectParams diff --git a/src/square/requests/dispute_evidence_deleted_event_object.py b/src/square/requests/dispute_evidence_deleted_event_object.py index 599d1c6f..9aac18bc 100644 --- a/src/square/requests/dispute_evidence_deleted_event_object.py +++ b/src/square/requests/dispute_evidence_deleted_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/dispute_evidence_file.py b/src/square/requests/dispute_evidence_file.py index 15c34c82..6a07b069 100644 --- a/src/square/requests/dispute_evidence_file.py +++ b/src/square/requests/dispute_evidence_file.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DisputeEvidenceFileParams(typing_extensions.TypedDict): diff --git a/src/square/requests/dispute_evidence_removed_event.py b/src/square/requests/dispute_evidence_removed_event.py index c0b3a0c5..61d1e534 100644 --- a/src/square/requests/dispute_evidence_removed_event.py +++ b/src/square/requests/dispute_evidence_removed_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_removed_event_data import DisputeEvidenceRemovedEventDataParams diff --git a/src/square/requests/dispute_evidence_removed_event_data.py b/src/square/requests/dispute_evidence_removed_event_data.py index 2761cba0..e4b95150 100644 --- a/src/square/requests/dispute_evidence_removed_event_data.py +++ b/src/square/requests/dispute_evidence_removed_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence_removed_event_object import DisputeEvidenceRemovedEventObjectParams diff --git a/src/square/requests/dispute_evidence_removed_event_object.py b/src/square/requests/dispute_evidence_removed_event_object.py index 4dff246c..d031b015 100644 --- a/src/square/requests/dispute_evidence_removed_event_object.py +++ b/src/square/requests/dispute_evidence_removed_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/dispute_state_changed_event.py b/src/square/requests/dispute_state_changed_event.py index c03f4300..dc8cc8df 100644 --- a/src/square/requests/dispute_state_changed_event.py +++ b/src/square/requests/dispute_state_changed_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_state_changed_event_data import DisputeStateChangedEventDataParams diff --git a/src/square/requests/dispute_state_changed_event_data.py b/src/square/requests/dispute_state_changed_event_data.py index ba3778b0..df3a0d53 100644 --- a/src/square/requests/dispute_state_changed_event_data.py +++ b/src/square/requests/dispute_state_changed_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_state_changed_event_object import DisputeStateChangedEventObjectParams diff --git a/src/square/requests/dispute_state_changed_event_object.py b/src/square/requests/dispute_state_changed_event_object.py index 4cc12695..63bd0a82 100644 --- a/src/square/requests/dispute_state_changed_event_object.py +++ b/src/square/requests/dispute_state_changed_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/dispute_state_updated_event.py b/src/square/requests/dispute_state_updated_event.py index dd45b1b0..9a03c62a 100644 --- a/src/square/requests/dispute_state_updated_event.py +++ b/src/square/requests/dispute_state_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_state_updated_event_data import DisputeStateUpdatedEventDataParams diff --git a/src/square/requests/dispute_state_updated_event_data.py b/src/square/requests/dispute_state_updated_event_data.py index 1b1966ba..c4e217dc 100644 --- a/src/square/requests/dispute_state_updated_event_data.py +++ b/src/square/requests/dispute_state_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_state_updated_event_object import DisputeStateUpdatedEventObjectParams diff --git a/src/square/requests/dispute_state_updated_event_object.py b/src/square/requests/dispute_state_updated_event_object.py index 3a6654cf..ec0282e7 100644 --- a/src/square/requests/dispute_state_updated_event_object.py +++ b/src/square/requests/dispute_state_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .dispute import DisputeParams diff --git a/src/square/requests/disputed_payment.py b/src/square/requests/disputed_payment.py index 68f455db..0a3debff 100644 --- a/src/square/requests/disputed_payment.py +++ b/src/square/requests/disputed_payment.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class DisputedPaymentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/employee.py b/src/square/requests/employee.py index a3d92c1f..3166bcaa 100644 --- a/src/square/requests/employee.py +++ b/src/square/requests/employee.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.employee_status import EmployeeStatus diff --git a/src/square/requests/employee_wage.py b/src/square/requests/employee_wage.py index 62ba2f92..f5bc26a8 100644 --- a/src/square/requests/employee_wage.py +++ b/src/square/requests/employee_wage.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/enable_events_response.py b/src/square/requests/enable_events_response.py index 586054c3..c78ba8d9 100644 --- a/src/square/requests/enable_events_response.py +++ b/src/square/requests/enable_events_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/error.py b/src/square/requests/error.py index f3cbac36..5bd17414 100644 --- a/src/square/requests/error.py +++ b/src/square/requests/error.py @@ -3,6 +3,7 @@ import typing_extensions from ..types.error_category import ErrorCategory from ..types.error_code import ErrorCode +import typing_extensions class ErrorParams(typing_extensions.TypedDict): diff --git a/src/square/requests/event.py b/src/square/requests/event.py index 5bf97c5a..8c22db82 100644 --- a/src/square/requests/event.py +++ b/src/square/requests/event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .event_data import EventDataParams diff --git a/src/square/requests/event_data.py b/src/square/requests/event_data.py index 70ab38aa..9c0b453c 100644 --- a/src/square/requests/event_data.py +++ b/src/square/requests/event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class EventDataParams(typing_extensions.TypedDict): @@ -21,7 +21,7 @@ class EventDataParams(typing_extensions.TypedDict): This is true if the affected object has been deleted; otherwise, it's absent. """ - object: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Any]]] + object: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]] """ An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. """ diff --git a/src/square/requests/event_metadata.py b/src/square/requests/event_metadata.py index 66c9e0eb..13555b4c 100644 --- a/src/square/requests/event_metadata.py +++ b/src/square/requests/event_metadata.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class EventMetadataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/event_type_metadata.py b/src/square/requests/event_type_metadata.py index 75201a66..a86369e5 100644 --- a/src/square/requests/event_type_metadata.py +++ b/src/square/requests/event_type_metadata.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class EventTypeMetadataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/external_payment_details.py b/src/square/requests/external_payment_details.py index abb715ec..3278cc0f 100644 --- a/src/square/requests/external_payment_details.py +++ b/src/square/requests/external_payment_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams @@ -18,7 +18,7 @@ class ExternalPaymentDetailsParams(typing_extensions.TypedDict): The type of external payment the seller received. It can be one of the following: - CHECK - Paid using a physical check. - BANK_TRANSFER - Paid using external bank transfer. - - OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card. + - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. - CRYPTO - Paid using a crypto currency. - SQUARE_CASH - Paid using Square Cash App. - SOCIAL - Paid using peer-to-peer payment applications. diff --git a/src/square/requests/filter_value.py b/src/square/requests/filter_value.py index 8ddba4b9..825d367b 100644 --- a/src/square/requests/filter_value.py +++ b/src/square/requests/filter_value.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..core.serialization import FieldMetadata diff --git a/src/square/requests/float_number_range.py b/src/square/requests/float_number_range.py index a453b8da..3c1787b7 100644 --- a/src/square/requests/float_number_range.py +++ b/src/square/requests/float_number_range.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class FloatNumberRangeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/fulfillment.py b/src/square/requests/fulfillment.py index 4873ffb6..3bbcf55b 100644 --- a/src/square/requests/fulfillment.py +++ b/src/square/requests/fulfillment.py @@ -1,15 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.fulfillment_fulfillment_line_item_application import FulfillmentFulfillmentLineItemApplication -from ..types.fulfillment_state import FulfillmentState +import typing_extensions +import typing from ..types.fulfillment_type import FulfillmentType -from .fulfillment_delivery_details import FulfillmentDeliveryDetailsParams +from ..types.fulfillment_state import FulfillmentState +from ..types.fulfillment_fulfillment_line_item_application import FulfillmentFulfillmentLineItemApplication from .fulfillment_fulfillment_entry import FulfillmentFulfillmentEntryParams from .fulfillment_pickup_details import FulfillmentPickupDetailsParams from .fulfillment_shipment_details import FulfillmentShipmentDetailsParams +from .fulfillment_delivery_details import FulfillmentDeliveryDetailsParams class FulfillmentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/fulfillment_delivery_details.py b/src/square/requests/fulfillment_delivery_details.py index e014e586..7543919a 100644 --- a/src/square/requests/fulfillment_delivery_details.py +++ b/src/square/requests/fulfillment_delivery_details.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +from .fulfillment_recipient import FulfillmentRecipientParams from ..types.fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type import ( FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType, ) -from .fulfillment_recipient import FulfillmentRecipientParams +import typing class FulfillmentDeliveryDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/fulfillment_fulfillment_entry.py b/src/square/requests/fulfillment_fulfillment_entry.py index 211b7d4a..995a98c6 100644 --- a/src/square/requests/fulfillment_fulfillment_entry.py +++ b/src/square/requests/fulfillment_fulfillment_entry.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class FulfillmentFulfillmentEntryParams(typing_extensions.TypedDict): diff --git a/src/square/requests/fulfillment_pickup_details.py b/src/square/requests/fulfillment_pickup_details.py index 5c248bef..49e32c40 100644 --- a/src/square/requests/fulfillment_pickup_details.py +++ b/src/square/requests/fulfillment_pickup_details.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +from .fulfillment_recipient import FulfillmentRecipientParams +import typing from ..types.fulfillment_pickup_details_schedule_type import FulfillmentPickupDetailsScheduleType from .fulfillment_pickup_details_curbside_pickup_details import FulfillmentPickupDetailsCurbsidePickupDetailsParams -from .fulfillment_recipient import FulfillmentRecipientParams class FulfillmentPickupDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/fulfillment_pickup_details_curbside_pickup_details.py b/src/square/requests/fulfillment_pickup_details_curbside_pickup_details.py index f9ffedf3..92cc67ef 100644 --- a/src/square/requests/fulfillment_pickup_details_curbside_pickup_details.py +++ b/src/square/requests/fulfillment_pickup_details_curbside_pickup_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class FulfillmentPickupDetailsCurbsidePickupDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/fulfillment_recipient.py b/src/square/requests/fulfillment_recipient.py index 36134644..974e30db 100644 --- a/src/square/requests/fulfillment_recipient.py +++ b/src/square/requests/fulfillment_recipient.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .address import AddressParams diff --git a/src/square/requests/fulfillment_shipment_details.py b/src/square/requests/fulfillment_shipment_details.py index 9404fc82..89353fdc 100644 --- a/src/square/requests/fulfillment_shipment_details.py +++ b/src/square/requests/fulfillment_shipment_details.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .fulfillment_recipient import FulfillmentRecipientParams +import typing class FulfillmentShipmentDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_bank_account_by_v1id_response.py b/src/square/requests/get_bank_account_by_v1id_response.py index 02d288f2..d53f18c6 100644 --- a/src/square/requests/get_bank_account_by_v1id_response.py +++ b/src/square/requests/get_bank_account_by_v1id_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .bank_account import BankAccountParams +import typing_extensions +import typing from .error import ErrorParams +from .bank_account import BankAccountParams class GetBankAccountByV1IdResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_bank_account_response.py b/src/square/requests/get_bank_account_response.py index 787673f8..984ce4e0 100644 --- a/src/square/requests/get_bank_account_response.py +++ b/src/square/requests/get_bank_account_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .bank_account import BankAccountParams +import typing_extensions +import typing from .error import ErrorParams +from .bank_account import BankAccountParams class GetBankAccountResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_booking_response.py b/src/square/requests/get_booking_response.py index 06df7c4c..2a806bf5 100644 --- a/src/square/requests/get_booking_response.py +++ b/src/square/requests/get_booking_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .booking import BookingParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_break_type_response.py b/src/square/requests/get_break_type_response.py index 056c5c7e..09ab8647 100644 --- a/src/square/requests/get_break_type_response.py +++ b/src/square/requests/get_break_type_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .break_type import BreakTypeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_business_booking_profile_response.py b/src/square/requests/get_business_booking_profile_response.py index cccb3721..e3a9f309 100644 --- a/src/square/requests/get_business_booking_profile_response.py +++ b/src/square/requests/get_business_booking_profile_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .business_booking_profile import BusinessBookingProfileParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_card_response.py b/src/square/requests/get_card_response.py index 800c47ed..b64d34b7 100644 --- a/src/square/requests/get_card_response.py +++ b/src/square/requests/get_card_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .card import CardParams +import typing_extensions +import typing from .error import ErrorParams +from .card import CardParams class GetCardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_cash_drawer_shift_response.py b/src/square/requests/get_cash_drawer_shift_response.py index ec78d11d..d7a71ce7 100644 --- a/src/square/requests/get_cash_drawer_shift_response.py +++ b/src/square/requests/get_cash_drawer_shift_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .cash_drawer_shift import CashDrawerShiftParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_catalog_object_response.py b/src/square/requests/get_catalog_object_response.py index 53800a11..bbaa75f2 100644 --- a/src/square/requests/get_catalog_object_response.py +++ b/src/square/requests/get_catalog_object_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class GetCatalogObjectResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_customer_custom_attribute_definition_response.py b/src/square/requests/get_customer_custom_attribute_definition_response.py index 8b51289a..44feb856 100644 --- a/src/square/requests/get_customer_custom_attribute_definition_response.py +++ b/src/square/requests/get_customer_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_customer_custom_attribute_response.py b/src/square/requests/get_customer_custom_attribute_response.py index 0ccdee36..0f1438e4 100644 --- a/src/square/requests/get_customer_custom_attribute_response.py +++ b/src/square/requests/get_customer_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_customer_group_response.py b/src/square/requests/get_customer_group_response.py index 40a9d1fa..615209dc 100644 --- a/src/square/requests/get_customer_group_response.py +++ b/src/square/requests/get_customer_group_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_group import CustomerGroupParams +import typing_extensions +import typing from .error import ErrorParams +from .customer_group import CustomerGroupParams class GetCustomerGroupResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_customer_response.py b/src/square/requests/get_customer_response.py index 38d89c01..56a8a33b 100644 --- a/src/square/requests/get_customer_response.py +++ b/src/square/requests/get_customer_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer import CustomerParams +import typing_extensions +import typing from .error import ErrorParams +from .customer import CustomerParams class GetCustomerResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_customer_segment_response.py b/src/square/requests/get_customer_segment_response.py index 9aa3e463..d01d8d4f 100644 --- a/src/square/requests/get_customer_segment_response.py +++ b/src/square/requests/get_customer_segment_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_segment import CustomerSegmentParams +import typing_extensions +import typing from .error import ErrorParams +from .customer_segment import CustomerSegmentParams class GetCustomerSegmentResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_device_code_response.py b/src/square/requests/get_device_code_response.py index 5160a441..353793b6 100644 --- a/src/square/requests/get_device_code_response.py +++ b/src/square/requests/get_device_code_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .device_code import DeviceCodeParams +import typing_extensions +import typing from .error import ErrorParams +from .device_code import DeviceCodeParams class GetDeviceCodeResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_device_response.py b/src/square/requests/get_device_response.py index a06a06e6..d8de606e 100644 --- a/src/square/requests/get_device_response.py +++ b/src/square/requests/get_device_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .device import DeviceParams +import typing_extensions +import typing from .error import ErrorParams +from .device import DeviceParams class GetDeviceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_dispute_evidence_response.py b/src/square/requests/get_dispute_evidence_response.py index 4326d987..48a6bc91 100644 --- a/src/square/requests/get_dispute_evidence_response.py +++ b/src/square/requests/get_dispute_evidence_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute_evidence import DisputeEvidenceParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute_evidence import DisputeEvidenceParams class GetDisputeEvidenceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_dispute_response.py b/src/square/requests/get_dispute_response.py index d23e4b21..3952f3ae 100644 --- a/src/square/requests/get_dispute_response.py +++ b/src/square/requests/get_dispute_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute import DisputeParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute import DisputeParams class GetDisputeResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_employee_response.py b/src/square/requests/get_employee_response.py index bdd61566..7bf6c3d3 100644 --- a/src/square/requests/get_employee_response.py +++ b/src/square/requests/get_employee_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .employee import EmployeeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_employee_wage_response.py b/src/square/requests/get_employee_wage_response.py index 133baffc..e4e99196 100644 --- a/src/square/requests/get_employee_wage_response.py +++ b/src/square/requests/get_employee_wage_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .employee_wage import EmployeeWageParams +import typing from .error import ErrorParams diff --git a/src/square/requests/get_gift_card_from_gan_response.py b/src/square/requests/get_gift_card_from_gan_response.py index 32a3cb23..7f598c9f 100644 --- a/src/square/requests/get_gift_card_from_gan_response.py +++ b/src/square/requests/get_gift_card_from_gan_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/get_gift_card_from_nonce_response.py b/src/square/requests/get_gift_card_from_nonce_response.py index 2fdcacdd..c4ea7103 100644 --- a/src/square/requests/get_gift_card_from_nonce_response.py +++ b/src/square/requests/get_gift_card_from_nonce_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/get_gift_card_response.py b/src/square/requests/get_gift_card_response.py index 59fe561c..93eff8ef 100644 --- a/src/square/requests/get_gift_card_response.py +++ b/src/square/requests/get_gift_card_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/get_inventory_adjustment_response.py b/src/square/requests/get_inventory_adjustment_response.py index f4eab511..749527d9 100644 --- a/src/square/requests/get_inventory_adjustment_response.py +++ b/src/square/requests/get_inventory_adjustment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_adjustment import InventoryAdjustmentParams diff --git a/src/square/requests/get_inventory_changes_response.py b/src/square/requests/get_inventory_changes_response.py index 06ce4306..d2fea3c0 100644 --- a/src/square/requests/get_inventory_changes_response.py +++ b/src/square/requests/get_inventory_changes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_change import InventoryChangeParams diff --git a/src/square/requests/get_inventory_count_response.py b/src/square/requests/get_inventory_count_response.py index dcba3346..80fdab5d 100644 --- a/src/square/requests/get_inventory_count_response.py +++ b/src/square/requests/get_inventory_count_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_count import InventoryCountParams diff --git a/src/square/requests/get_inventory_physical_count_response.py b/src/square/requests/get_inventory_physical_count_response.py index d2dc2ea9..9b828080 100644 --- a/src/square/requests/get_inventory_physical_count_response.py +++ b/src/square/requests/get_inventory_physical_count_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_physical_count import InventoryPhysicalCountParams diff --git a/src/square/requests/get_inventory_transfer_response.py b/src/square/requests/get_inventory_transfer_response.py index 83297433..a68cab1f 100644 --- a/src/square/requests/get_inventory_transfer_response.py +++ b/src/square/requests/get_inventory_transfer_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .inventory_transfer import InventoryTransferParams diff --git a/src/square/requests/get_invoice_response.py b/src/square/requests/get_invoice_response.py index dd6ffd32..ff8e43d5 100644 --- a/src/square/requests/get_invoice_response.py +++ b/src/square/requests/get_invoice_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .invoice import InvoiceParams +import typing +from .error import ErrorParams class GetInvoiceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_location_response.py b/src/square/requests/get_location_response.py index 6e6d0be2..35980cba 100644 --- a/src/square/requests/get_location_response.py +++ b/src/square/requests/get_location_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .location import LocationParams diff --git a/src/square/requests/get_loyalty_account_response.py b/src/square/requests/get_loyalty_account_response.py index d75ae32c..f726f45b 100644 --- a/src/square/requests/get_loyalty_account_response.py +++ b/src/square/requests/get_loyalty_account_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_account import LoyaltyAccountParams diff --git a/src/square/requests/get_loyalty_program_response.py b/src/square/requests/get_loyalty_program_response.py index cbc4b47d..49e7d8e0 100644 --- a/src/square/requests/get_loyalty_program_response.py +++ b/src/square/requests/get_loyalty_program_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_program import LoyaltyProgramParams diff --git a/src/square/requests/get_loyalty_promotion_response.py b/src/square/requests/get_loyalty_promotion_response.py index 24efb29a..2fb2eba1 100644 --- a/src/square/requests/get_loyalty_promotion_response.py +++ b/src/square/requests/get_loyalty_promotion_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_promotion import LoyaltyPromotionParams diff --git a/src/square/requests/get_loyalty_reward_response.py b/src/square/requests/get_loyalty_reward_response.py index 246b0cd7..7ea8680e 100644 --- a/src/square/requests/get_loyalty_reward_response.py +++ b/src/square/requests/get_loyalty_reward_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_reward import LoyaltyRewardParams diff --git a/src/square/requests/get_merchant_response.py b/src/square/requests/get_merchant_response.py index f99f1305..47feec63 100644 --- a/src/square/requests/get_merchant_response.py +++ b/src/square/requests/get_merchant_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .merchant import MerchantParams diff --git a/src/square/requests/get_order_response.py b/src/square/requests/get_order_response.py index abc6a9e7..ea07e619 100644 --- a/src/square/requests/get_order_response.py +++ b/src/square/requests/get_order_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .order import OrderParams +import typing +from .error import ErrorParams class GetOrderResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_payment_link_response.py b/src/square/requests/get_payment_link_response.py index 12721cc4..7e6fb922 100644 --- a/src/square/requests/get_payment_link_response.py +++ b/src/square/requests/get_payment_link_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_link import PaymentLinkParams diff --git a/src/square/requests/get_payment_refund_response.py b/src/square/requests/get_payment_refund_response.py index a6e55a83..27016ac1 100644 --- a/src/square/requests/get_payment_refund_response.py +++ b/src/square/requests/get_payment_refund_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_refund import PaymentRefundParams diff --git a/src/square/requests/get_payment_response.py b/src/square/requests/get_payment_response.py index ff33cdc3..a89a9001 100644 --- a/src/square/requests/get_payment_response.py +++ b/src/square/requests/get_payment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment import PaymentParams diff --git a/src/square/requests/get_payout_response.py b/src/square/requests/get_payout_response.py index 04ce2e34..a2f202fa 100644 --- a/src/square/requests/get_payout_response.py +++ b/src/square/requests/get_payout_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .payout import PayoutParams +import typing +from .error import ErrorParams class GetPayoutResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_shift_response.py b/src/square/requests/get_shift_response.py index 04166cd9..418b94c4 100644 --- a/src/square/requests/get_shift_response.py +++ b/src/square/requests/get_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .shift import ShiftParams +import typing +from .error import ErrorParams class GetShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_snippet_response.py b/src/square/requests/get_snippet_response.py index 987e49bc..efd72d2e 100644 --- a/src/square/requests/get_snippet_response.py +++ b/src/square/requests/get_snippet_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .snippet import SnippetParams diff --git a/src/square/requests/get_subscription_response.py b/src/square/requests/get_subscription_response.py index d7166742..34df0330 100644 --- a/src/square/requests/get_subscription_response.py +++ b/src/square/requests/get_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams diff --git a/src/square/requests/get_team_member_booking_profile_response.py b/src/square/requests/get_team_member_booking_profile_response.py index 1743b712..754d5999 100644 --- a/src/square/requests/get_team_member_booking_profile_response.py +++ b/src/square/requests/get_team_member_booking_profile_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .team_member_booking_profile import TeamMemberBookingProfileParams +import typing +from .error import ErrorParams class GetTeamMemberBookingProfileResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_team_member_response.py b/src/square/requests/get_team_member_response.py index 9d71106d..38f684d4 100644 --- a/src/square/requests/get_team_member_response.py +++ b/src/square/requests/get_team_member_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .team_member import TeamMemberParams +import typing +from .error import ErrorParams class GetTeamMemberResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_team_member_wage_response.py b/src/square/requests/get_team_member_wage_response.py index 9fc6b139..e9b44031 100644 --- a/src/square/requests/get_team_member_wage_response.py +++ b/src/square/requests/get_team_member_wage_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .team_member_wage import TeamMemberWageParams +import typing +from .error import ErrorParams class GetTeamMemberWageResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_terminal_action_response.py b/src/square/requests/get_terminal_action_response.py index af56ec6a..9ec90205 100644 --- a/src/square/requests/get_terminal_action_response.py +++ b/src/square/requests/get_terminal_action_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_action import TerminalActionParams diff --git a/src/square/requests/get_terminal_checkout_response.py b/src/square/requests/get_terminal_checkout_response.py index 1c71292d..d3644296 100644 --- a/src/square/requests/get_terminal_checkout_response.py +++ b/src/square/requests/get_terminal_checkout_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/get_terminal_refund_response.py b/src/square/requests/get_terminal_refund_response.py index 27828ea6..e79a9fa7 100644 --- a/src/square/requests/get_terminal_refund_response.py +++ b/src/square/requests/get_terminal_refund_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/get_transaction_response.py b/src/square/requests/get_transaction_response.py index 10210ad4..87522023 100644 --- a/src/square/requests/get_transaction_response.py +++ b/src/square/requests/get_transaction_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .transaction import TransactionParams diff --git a/src/square/requests/get_vendor_response.py b/src/square/requests/get_vendor_response.py index c54a2c51..8f461879 100644 --- a/src/square/requests/get_vendor_response.py +++ b/src/square/requests/get_vendor_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .vendor import VendorParams diff --git a/src/square/requests/get_wage_setting_response.py b/src/square/requests/get_wage_setting_response.py index ba900f20..4e0c6ae8 100644 --- a/src/square/requests/get_wage_setting_response.py +++ b/src/square/requests/get_wage_setting_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .wage_setting import WageSettingParams +import typing +from .error import ErrorParams class GetWageSettingResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/get_webhook_subscription_response.py b/src/square/requests/get_webhook_subscription_response.py index c71c6e7d..c0e41df1 100644 --- a/src/square/requests/get_webhook_subscription_response.py +++ b/src/square/requests/get_webhook_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .webhook_subscription import WebhookSubscriptionParams diff --git a/src/square/requests/gift_card.py b/src/square/requests/gift_card.py index c4926a92..84a063a1 100644 --- a/src/square/requests/gift_card.py +++ b/src/square/requests/gift_card.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +from ..types.gift_card_type import GiftCardType from ..types.gift_card_gan_source import GiftCardGanSource from ..types.gift_card_status import GiftCardStatus -from ..types.gift_card_type import GiftCardType from .money import MoneyParams +import typing class GiftCardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity.py b/src/square/requests/gift_card_activity.py index 25a353d7..e20ae638 100644 --- a/src/square/requests/gift_card_activity.py +++ b/src/square/requests/gift_card_activity.py @@ -1,25 +1,25 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.gift_card_activity_type import GiftCardActivityType +import typing +from .money import MoneyParams +from .gift_card_activity_load import GiftCardActivityLoadParams from .gift_card_activity_activate import GiftCardActivityActivateParams -from .gift_card_activity_adjust_decrement import GiftCardActivityAdjustDecrementParams -from .gift_card_activity_adjust_increment import GiftCardActivityAdjustIncrementParams -from .gift_card_activity_block import GiftCardActivityBlockParams +from .gift_card_activity_redeem import GiftCardActivityRedeemParams from .gift_card_activity_clear_balance import GiftCardActivityClearBalanceParams from .gift_card_activity_deactivate import GiftCardActivityDeactivateParams +from .gift_card_activity_adjust_increment import GiftCardActivityAdjustIncrementParams +from .gift_card_activity_adjust_decrement import GiftCardActivityAdjustDecrementParams +from .gift_card_activity_refund import GiftCardActivityRefundParams +from .gift_card_activity_unlinked_activity_refund import GiftCardActivityUnlinkedActivityRefundParams from .gift_card_activity_import import GiftCardActivityImportParams +from .gift_card_activity_block import GiftCardActivityBlockParams +from .gift_card_activity_unblock import GiftCardActivityUnblockParams from .gift_card_activity_import_reversal import GiftCardActivityImportReversalParams -from .gift_card_activity_load import GiftCardActivityLoadParams -from .gift_card_activity_redeem import GiftCardActivityRedeemParams -from .gift_card_activity_refund import GiftCardActivityRefundParams -from .gift_card_activity_transfer_balance_from import GiftCardActivityTransferBalanceFromParams from .gift_card_activity_transfer_balance_to import GiftCardActivityTransferBalanceToParams -from .gift_card_activity_unblock import GiftCardActivityUnblockParams -from .gift_card_activity_unlinked_activity_refund import GiftCardActivityUnlinkedActivityRefundParams -from .money import MoneyParams +from .gift_card_activity_transfer_balance_from import GiftCardActivityTransferBalanceFromParams class GiftCardActivityParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_activate.py b/src/square/requests/gift_card_activity_activate.py index 1b0990a6..ddfe1e91 100644 --- a/src/square/requests/gift_card_activity_activate.py +++ b/src/square/requests/gift_card_activity_activate.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .money import MoneyParams +import typing class GiftCardActivityActivateParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_adjust_decrement.py b/src/square/requests/gift_card_activity_adjust_decrement.py index 20d74d63..69c06609 100644 --- a/src/square/requests/gift_card_activity_adjust_decrement.py +++ b/src/square/requests/gift_card_activity_adjust_decrement.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.gift_card_activity_adjust_decrement_reason import GiftCardActivityAdjustDecrementReason from .money import MoneyParams +from ..types.gift_card_activity_adjust_decrement_reason import GiftCardActivityAdjustDecrementReason class GiftCardActivityAdjustDecrementParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_adjust_increment.py b/src/square/requests/gift_card_activity_adjust_increment.py index 2b288d8a..47ec6b66 100644 --- a/src/square/requests/gift_card_activity_adjust_increment.py +++ b/src/square/requests/gift_card_activity_adjust_increment.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.gift_card_activity_adjust_increment_reason import GiftCardActivityAdjustIncrementReason from .money import MoneyParams +from ..types.gift_card_activity_adjust_increment_reason import GiftCardActivityAdjustIncrementReason class GiftCardActivityAdjustIncrementParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_created_event.py b/src/square/requests/gift_card_activity_created_event.py index bd0be1d8..42a407cb 100644 --- a/src/square/requests/gift_card_activity_created_event.py +++ b/src/square/requests/gift_card_activity_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_activity_created_event_data import GiftCardActivityCreatedEventDataParams diff --git a/src/square/requests/gift_card_activity_created_event_data.py b/src/square/requests/gift_card_activity_created_event_data.py index 79f23cea..6032325a 100644 --- a/src/square/requests/gift_card_activity_created_event_data.py +++ b/src/square/requests/gift_card_activity_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_activity_created_event_object import GiftCardActivityCreatedEventObjectParams diff --git a/src/square/requests/gift_card_activity_created_event_object.py b/src/square/requests/gift_card_activity_created_event_object.py index 2f8e6b2f..3f9eb4ef 100644 --- a/src/square/requests/gift_card_activity_created_event_object.py +++ b/src/square/requests/gift_card_activity_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .gift_card_activity import GiftCardActivityParams diff --git a/src/square/requests/gift_card_activity_load.py b/src/square/requests/gift_card_activity_load.py index b7c85427..32dcb1df 100644 --- a/src/square/requests/gift_card_activity_load.py +++ b/src/square/requests/gift_card_activity_load.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .money import MoneyParams +import typing class GiftCardActivityLoadParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_redeem.py b/src/square/requests/gift_card_activity_redeem.py index 4fd45a5e..eb1d2fc4 100644 --- a/src/square/requests/gift_card_activity_redeem.py +++ b/src/square/requests/gift_card_activity_redeem.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.gift_card_activity_redeem_status import GiftCardActivityRedeemStatus from .money import MoneyParams +import typing_extensions +import typing +from ..types.gift_card_activity_redeem_status import GiftCardActivityRedeemStatus class GiftCardActivityRedeemParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_refund.py b/src/square/requests/gift_card_activity_refund.py index 30dc52c5..47bb24fc 100644 --- a/src/square/requests/gift_card_activity_refund.py +++ b/src/square/requests/gift_card_activity_refund.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/gift_card_activity_unlinked_activity_refund.py b/src/square/requests/gift_card_activity_unlinked_activity_refund.py index 43158899..8e28e967 100644 --- a/src/square/requests/gift_card_activity_unlinked_activity_refund.py +++ b/src/square/requests/gift_card_activity_unlinked_activity_refund.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from .money import MoneyParams +import typing_extensions +import typing class GiftCardActivityUnlinkedActivityRefundParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_activity_updated_event.py b/src/square/requests/gift_card_activity_updated_event.py index 42bdd134..79285d36 100644 --- a/src/square/requests/gift_card_activity_updated_event.py +++ b/src/square/requests/gift_card_activity_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_activity_updated_event_data import GiftCardActivityUpdatedEventDataParams diff --git a/src/square/requests/gift_card_activity_updated_event_data.py b/src/square/requests/gift_card_activity_updated_event_data.py index 7481491d..05f2f092 100644 --- a/src/square/requests/gift_card_activity_updated_event_data.py +++ b/src/square/requests/gift_card_activity_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_activity_updated_event_object import GiftCardActivityUpdatedEventObjectParams diff --git a/src/square/requests/gift_card_activity_updated_event_object.py b/src/square/requests/gift_card_activity_updated_event_object.py index 8f35e099..aadeee3f 100644 --- a/src/square/requests/gift_card_activity_updated_event_object.py +++ b/src/square/requests/gift_card_activity_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .gift_card_activity import GiftCardActivityParams diff --git a/src/square/requests/gift_card_created_event.py b/src/square/requests/gift_card_created_event.py index 5e27d0fe..82eec7d8 100644 --- a/src/square/requests/gift_card_created_event.py +++ b/src/square/requests/gift_card_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_created_event_data import GiftCardCreatedEventDataParams diff --git a/src/square/requests/gift_card_created_event_data.py b/src/square/requests/gift_card_created_event_data.py index b4a08e70..634fb8cc 100644 --- a/src/square/requests/gift_card_created_event_data.py +++ b/src/square/requests/gift_card_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_created_event_object import GiftCardCreatedEventObjectParams diff --git a/src/square/requests/gift_card_created_event_object.py b/src/square/requests/gift_card_created_event_object.py index b9df8bf4..32925651 100644 --- a/src/square/requests/gift_card_created_event_object.py +++ b/src/square/requests/gift_card_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .gift_card import GiftCardParams diff --git a/src/square/requests/gift_card_customer_linked_event.py b/src/square/requests/gift_card_customer_linked_event.py index b59831ad..72bf0993 100644 --- a/src/square/requests/gift_card_customer_linked_event.py +++ b/src/square/requests/gift_card_customer_linked_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_customer_linked_event_data import GiftCardCustomerLinkedEventDataParams diff --git a/src/square/requests/gift_card_customer_linked_event_data.py b/src/square/requests/gift_card_customer_linked_event_data.py index 2920674e..681afa4d 100644 --- a/src/square/requests/gift_card_customer_linked_event_data.py +++ b/src/square/requests/gift_card_customer_linked_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_customer_linked_event_object import GiftCardCustomerLinkedEventObjectParams diff --git a/src/square/requests/gift_card_customer_linked_event_object.py b/src/square/requests/gift_card_customer_linked_event_object.py index 9c45a44a..9a82458f 100644 --- a/src/square/requests/gift_card_customer_linked_event_object.py +++ b/src/square/requests/gift_card_customer_linked_event_object.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .gift_card import GiftCardParams +import typing class GiftCardCustomerLinkedEventObjectParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_customer_unlinked_event.py b/src/square/requests/gift_card_customer_unlinked_event.py index 8013151c..52c08ed4 100644 --- a/src/square/requests/gift_card_customer_unlinked_event.py +++ b/src/square/requests/gift_card_customer_unlinked_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_customer_unlinked_event_data import GiftCardCustomerUnlinkedEventDataParams diff --git a/src/square/requests/gift_card_customer_unlinked_event_data.py b/src/square/requests/gift_card_customer_unlinked_event_data.py index c378db15..b61f04d8 100644 --- a/src/square/requests/gift_card_customer_unlinked_event_data.py +++ b/src/square/requests/gift_card_customer_unlinked_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_customer_unlinked_event_object import GiftCardCustomerUnlinkedEventObjectParams diff --git a/src/square/requests/gift_card_customer_unlinked_event_object.py b/src/square/requests/gift_card_customer_unlinked_event_object.py index fa109b5f..8bf59292 100644 --- a/src/square/requests/gift_card_customer_unlinked_event_object.py +++ b/src/square/requests/gift_card_customer_unlinked_event_object.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .gift_card import GiftCardParams +import typing class GiftCardCustomerUnlinkedEventObjectParams(typing_extensions.TypedDict): diff --git a/src/square/requests/gift_card_updated_event.py b/src/square/requests/gift_card_updated_event.py index 21a10755..e1da7301 100644 --- a/src/square/requests/gift_card_updated_event.py +++ b/src/square/requests/gift_card_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_updated_event_data import GiftCardUpdatedEventDataParams diff --git a/src/square/requests/gift_card_updated_event_data.py b/src/square/requests/gift_card_updated_event_data.py index 75893528..fb1a9a3a 100644 --- a/src/square/requests/gift_card_updated_event_data.py +++ b/src/square/requests/gift_card_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .gift_card_updated_event_object import GiftCardUpdatedEventObjectParams diff --git a/src/square/requests/gift_card_updated_event_object.py b/src/square/requests/gift_card_updated_event_object.py index 715b18fb..8ad0a8c1 100644 --- a/src/square/requests/gift_card_updated_event_object.py +++ b/src/square/requests/gift_card_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .gift_card import GiftCardParams diff --git a/src/square/requests/inventory_adjustment.py b/src/square/requests/inventory_adjustment.py index 90a635b1..97e8a5ff 100644 --- a/src/square/requests/inventory_adjustment.py +++ b/src/square/requests/inventory_adjustment.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.inventory_state import InventoryState -from .inventory_adjustment_group import InventoryAdjustmentGroupParams from .money import MoneyParams from .source_application import SourceApplicationParams +from .inventory_adjustment_group import InventoryAdjustmentGroupParams class InventoryAdjustmentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/inventory_adjustment_group.py b/src/square/requests/inventory_adjustment_group.py index ca76146d..89a5dd2d 100644 --- a/src/square/requests/inventory_adjustment_group.py +++ b/src/square/requests/inventory_adjustment_group.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.inventory_state import InventoryState diff --git a/src/square/requests/inventory_change.py b/src/square/requests/inventory_change.py index bd4baa2a..ba506b17 100644 --- a/src/square/requests/inventory_change.py +++ b/src/square/requests/inventory_change.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.inventory_change_type import InventoryChangeType -from .catalog_measurement_unit import CatalogMeasurementUnitParams -from .inventory_adjustment import InventoryAdjustmentParams from .inventory_physical_count import InventoryPhysicalCountParams +from .inventory_adjustment import InventoryAdjustmentParams from .inventory_transfer import InventoryTransferParams +from .catalog_measurement_unit import CatalogMeasurementUnitParams class InventoryChangeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/inventory_count.py b/src/square/requests/inventory_count.py index 19a10b27..4b24d864 100644 --- a/src/square/requests/inventory_count.py +++ b/src/square/requests/inventory_count.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.inventory_state import InventoryState diff --git a/src/square/requests/inventory_count_updated_event.py b/src/square/requests/inventory_count_updated_event.py index 122b5146..b15b4096 100644 --- a/src/square/requests/inventory_count_updated_event.py +++ b/src/square/requests/inventory_count_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .inventory_count_updated_event_data import InventoryCountUpdatedEventDataParams diff --git a/src/square/requests/inventory_count_updated_event_data.py b/src/square/requests/inventory_count_updated_event_data.py index 3ba390dc..9a1d44b6 100644 --- a/src/square/requests/inventory_count_updated_event_data.py +++ b/src/square/requests/inventory_count_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .inventory_count_updated_event_object import InventoryCountUpdatedEventObjectParams diff --git a/src/square/requests/inventory_count_updated_event_object.py b/src/square/requests/inventory_count_updated_event_object.py index c70c6bac..bd58002b 100644 --- a/src/square/requests/inventory_count_updated_event_object.py +++ b/src/square/requests/inventory_count_updated_event_object.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .inventory_count import InventoryCountParams diff --git a/src/square/requests/inventory_physical_count.py b/src/square/requests/inventory_physical_count.py index d0b1be10..2c0e28bd 100644 --- a/src/square/requests/inventory_physical_count.py +++ b/src/square/requests/inventory_physical_count.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.inventory_state import InventoryState from .source_application import SourceApplicationParams diff --git a/src/square/requests/inventory_transfer.py b/src/square/requests/inventory_transfer.py index b9ffcd88..722bbd42 100644 --- a/src/square/requests/inventory_transfer.py +++ b/src/square/requests/inventory_transfer.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.inventory_state import InventoryState from .source_application import SourceApplicationParams diff --git a/src/square/requests/invoice.py b/src/square/requests/invoice.py index 7fe72a16..e8bf725a 100644 --- a/src/square/requests/invoice.py +++ b/src/square/requests/invoice.py @@ -1,16 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .invoice_recipient import InvoiceRecipientParams +from .invoice_payment_request import InvoicePaymentRequestParams from ..types.invoice_delivery_method import InvoiceDeliveryMethod +from .money import MoneyParams from ..types.invoice_status import InvoiceStatus from .invoice_accepted_payment_methods import InvoiceAcceptedPaymentMethodsParams -from .invoice_attachment import InvoiceAttachmentParams from .invoice_custom_field import InvoiceCustomFieldParams -from .invoice_payment_request import InvoicePaymentRequestParams -from .invoice_recipient import InvoiceRecipientParams -from .money import MoneyParams +from .invoice_attachment import InvoiceAttachmentParams class InvoiceParams(typing_extensions.TypedDict): @@ -140,8 +140,8 @@ class InvoiceParams(typing_extensions.TypedDict): When an invoice is created, this field is set to the `timezone` specified for the seller location. The value cannot be changed. - For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\\_Angeles - becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp + For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles + becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/requests/invoice_accepted_payment_methods.py b/src/square/requests/invoice_accepted_payment_methods.py index 20ccfdf2..9c0e2b3d 100644 --- a/src/square/requests/invoice_accepted_payment_methods.py +++ b/src/square/requests/invoice_accepted_payment_methods.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class InvoiceAcceptedPaymentMethodsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/invoice_attachment.py b/src/square/requests/invoice_attachment.py index 7f4509da..16cc3e4b 100644 --- a/src/square/requests/invoice_attachment.py +++ b/src/square/requests/invoice_attachment.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class InvoiceAttachmentParams(typing_extensions.TypedDict): diff --git a/src/square/requests/invoice_canceled_event.py b/src/square/requests/invoice_canceled_event.py index ac9ef375..2fc33c2d 100644 --- a/src/square/requests/invoice_canceled_event.py +++ b/src/square/requests/invoice_canceled_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_canceled_event_data import InvoiceCanceledEventDataParams diff --git a/src/square/requests/invoice_canceled_event_data.py b/src/square/requests/invoice_canceled_event_data.py index 5855e856..e8f8b1a3 100644 --- a/src/square/requests/invoice_canceled_event_data.py +++ b/src/square/requests/invoice_canceled_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_canceled_event_object import InvoiceCanceledEventObjectParams diff --git a/src/square/requests/invoice_canceled_event_object.py b/src/square/requests/invoice_canceled_event_object.py index 249e05e4..c9a3d1e4 100644 --- a/src/square/requests/invoice_canceled_event_object.py +++ b/src/square/requests/invoice_canceled_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/invoice_created_event.py b/src/square/requests/invoice_created_event.py index b340020b..05ce1e03 100644 --- a/src/square/requests/invoice_created_event.py +++ b/src/square/requests/invoice_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_created_event_data import InvoiceCreatedEventDataParams diff --git a/src/square/requests/invoice_created_event_data.py b/src/square/requests/invoice_created_event_data.py index 7e91cdcb..2da8d0ff 100644 --- a/src/square/requests/invoice_created_event_data.py +++ b/src/square/requests/invoice_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_created_event_object import InvoiceCreatedEventObjectParams diff --git a/src/square/requests/invoice_created_event_object.py b/src/square/requests/invoice_created_event_object.py index 69a52a30..3905f5a4 100644 --- a/src/square/requests/invoice_created_event_object.py +++ b/src/square/requests/invoice_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/invoice_custom_field.py b/src/square/requests/invoice_custom_field.py index 40a610fe..a8143b09 100644 --- a/src/square/requests/invoice_custom_field.py +++ b/src/square/requests/invoice_custom_field.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.invoice_custom_field_placement import InvoiceCustomFieldPlacement diff --git a/src/square/requests/invoice_deleted_event.py b/src/square/requests/invoice_deleted_event.py index a4c318a3..2312626d 100644 --- a/src/square/requests/invoice_deleted_event.py +++ b/src/square/requests/invoice_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_deleted_event_data import InvoiceDeletedEventDataParams diff --git a/src/square/requests/invoice_deleted_event_data.py b/src/square/requests/invoice_deleted_event_data.py index 33036f8e..754666c7 100644 --- a/src/square/requests/invoice_deleted_event_data.py +++ b/src/square/requests/invoice_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class InvoiceDeletedEventDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/invoice_filter.py b/src/square/requests/invoice_filter.py index 45287c98..5146e5d7 100644 --- a/src/square/requests/invoice_filter.py +++ b/src/square/requests/invoice_filter.py @@ -1,7 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing - import typing_extensions diff --git a/src/square/requests/invoice_payment_made_event.py b/src/square/requests/invoice_payment_made_event.py index 2c83f54d..b3cae597 100644 --- a/src/square/requests/invoice_payment_made_event.py +++ b/src/square/requests/invoice_payment_made_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_payment_made_event_data import InvoicePaymentMadeEventDataParams diff --git a/src/square/requests/invoice_payment_made_event_data.py b/src/square/requests/invoice_payment_made_event_data.py index 61251dcb..46f21697 100644 --- a/src/square/requests/invoice_payment_made_event_data.py +++ b/src/square/requests/invoice_payment_made_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_payment_made_event_object import InvoicePaymentMadeEventObjectParams diff --git a/src/square/requests/invoice_payment_made_event_object.py b/src/square/requests/invoice_payment_made_event_object.py index 0bbb284f..7e66728f 100644 --- a/src/square/requests/invoice_payment_made_event_object.py +++ b/src/square/requests/invoice_payment_made_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/invoice_payment_reminder.py b/src/square/requests/invoice_payment_reminder.py index 15dc73c1..fa65a564 100644 --- a/src/square/requests/invoice_payment_reminder.py +++ b/src/square/requests/invoice_payment_reminder.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.invoice_payment_reminder_status import InvoicePaymentReminderStatus diff --git a/src/square/requests/invoice_payment_request.py b/src/square/requests/invoice_payment_request.py index b1bdcac6..c8b45c1c 100644 --- a/src/square/requests/invoice_payment_request.py +++ b/src/square/requests/invoice_payment_request.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.invoice_automatic_payment_source import InvoiceAutomaticPaymentSource +import typing_extensions +import typing from ..types.invoice_request_method import InvoiceRequestMethod from ..types.invoice_request_type import InvoiceRequestType -from .invoice_payment_reminder import InvoicePaymentReminderParams from .money import MoneyParams +from ..types.invoice_automatic_payment_source import InvoiceAutomaticPaymentSource +from .invoice_payment_reminder import InvoicePaymentReminderParams class InvoicePaymentRequestParams(typing_extensions.TypedDict): @@ -51,7 +51,7 @@ class InvoicePaymentRequestParams(typing_extensions.TypedDict): charges the payment source on this date. After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone` - of America/Los\\_Angeles becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC + of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/requests/invoice_published_event.py b/src/square/requests/invoice_published_event.py index 7cc4a3b7..77c5313a 100644 --- a/src/square/requests/invoice_published_event.py +++ b/src/square/requests/invoice_published_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_published_event_data import InvoicePublishedEventDataParams diff --git a/src/square/requests/invoice_published_event_data.py b/src/square/requests/invoice_published_event_data.py index 4c8b1903..b7c6092b 100644 --- a/src/square/requests/invoice_published_event_data.py +++ b/src/square/requests/invoice_published_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_published_event_object import InvoicePublishedEventObjectParams diff --git a/src/square/requests/invoice_published_event_object.py b/src/square/requests/invoice_published_event_object.py index e0b0986f..2f8305b0 100644 --- a/src/square/requests/invoice_published_event_object.py +++ b/src/square/requests/invoice_published_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/invoice_query.py b/src/square/requests/invoice_query.py index c40f1caf..25106a3a 100644 --- a/src/square/requests/invoice_query.py +++ b/src/square/requests/invoice_query.py @@ -2,6 +2,7 @@ import typing_extensions from .invoice_filter import InvoiceFilterParams +import typing_extensions from .invoice_sort import InvoiceSortParams diff --git a/src/square/requests/invoice_recipient.py b/src/square/requests/invoice_recipient.py index 8af24f08..42ae51c7 100644 --- a/src/square/requests/invoice_recipient.py +++ b/src/square/requests/invoice_recipient.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .address import AddressParams from .invoice_recipient_tax_ids import InvoiceRecipientTaxIdsParams diff --git a/src/square/requests/invoice_recipient_tax_ids.py b/src/square/requests/invoice_recipient_tax_ids.py index f2f9707e..6c7af866 100644 --- a/src/square/requests/invoice_recipient_tax_ids.py +++ b/src/square/requests/invoice_recipient_tax_ids.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class InvoiceRecipientTaxIdsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/invoice_refunded_event.py b/src/square/requests/invoice_refunded_event.py index a48d101a..3b09a708 100644 --- a/src/square/requests/invoice_refunded_event.py +++ b/src/square/requests/invoice_refunded_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_refunded_event_data import InvoiceRefundedEventDataParams diff --git a/src/square/requests/invoice_refunded_event_data.py b/src/square/requests/invoice_refunded_event_data.py index aca61fda..a70d7330 100644 --- a/src/square/requests/invoice_refunded_event_data.py +++ b/src/square/requests/invoice_refunded_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_refunded_event_object import InvoiceRefundedEventObjectParams diff --git a/src/square/requests/invoice_refunded_event_object.py b/src/square/requests/invoice_refunded_event_object.py index cd611055..35b5d352 100644 --- a/src/square/requests/invoice_refunded_event_object.py +++ b/src/square/requests/invoice_refunded_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/invoice_scheduled_charge_failed_event.py b/src/square/requests/invoice_scheduled_charge_failed_event.py index 9854b765..903b41d3 100644 --- a/src/square/requests/invoice_scheduled_charge_failed_event.py +++ b/src/square/requests/invoice_scheduled_charge_failed_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_scheduled_charge_failed_event_data import InvoiceScheduledChargeFailedEventDataParams diff --git a/src/square/requests/invoice_scheduled_charge_failed_event_data.py b/src/square/requests/invoice_scheduled_charge_failed_event_data.py index 0fc93c0c..27a45a0b 100644 --- a/src/square/requests/invoice_scheduled_charge_failed_event_data.py +++ b/src/square/requests/invoice_scheduled_charge_failed_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_scheduled_charge_failed_event_object import InvoiceScheduledChargeFailedEventObjectParams diff --git a/src/square/requests/invoice_scheduled_charge_failed_event_object.py b/src/square/requests/invoice_scheduled_charge_failed_event_object.py index 76e906d1..4fe5dfed 100644 --- a/src/square/requests/invoice_scheduled_charge_failed_event_object.py +++ b/src/square/requests/invoice_scheduled_charge_failed_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/invoice_sort.py b/src/square/requests/invoice_sort.py index 7976a74c..d55e6ecb 100644 --- a/src/square/requests/invoice_sort.py +++ b/src/square/requests/invoice_sort.py @@ -2,6 +2,7 @@ import typing_extensions from ..types.invoice_sort_field import InvoiceSortField +import typing_extensions from ..types.sort_order import SortOrder diff --git a/src/square/requests/invoice_updated_event.py b/src/square/requests/invoice_updated_event.py index b2b7d130..4807f2f4 100644 --- a/src/square/requests/invoice_updated_event.py +++ b/src/square/requests/invoice_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_updated_event_data import InvoiceUpdatedEventDataParams diff --git a/src/square/requests/invoice_updated_event_data.py b/src/square/requests/invoice_updated_event_data.py index ff7166a5..a30c42a1 100644 --- a/src/square/requests/invoice_updated_event_data.py +++ b/src/square/requests/invoice_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .invoice_updated_event_object import InvoiceUpdatedEventObjectParams diff --git a/src/square/requests/invoice_updated_event_object.py b/src/square/requests/invoice_updated_event_object.py index 522ad797..3d6dc934 100644 --- a/src/square/requests/invoice_updated_event_object.py +++ b/src/square/requests/invoice_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .invoice import InvoiceParams diff --git a/src/square/requests/item_variation_location_overrides.py b/src/square/requests/item_variation_location_overrides.py index 3f57850d..8cd26d28 100644 --- a/src/square/requests/item_variation_location_overrides.py +++ b/src/square/requests/item_variation_location_overrides.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .money import MoneyParams from ..types.catalog_pricing_type import CatalogPricingType from ..types.inventory_alert_type import InventoryAlertType -from .money import MoneyParams class ItemVariationLocationOverridesParams(typing_extensions.TypedDict): diff --git a/src/square/requests/job.py b/src/square/requests/job.py index 6abd5b58..8a91559b 100644 --- a/src/square/requests/job.py +++ b/src/square/requests/job.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class JobParams(typing_extensions.TypedDict): diff --git a/src/square/requests/job_assignment.py b/src/square/requests/job_assignment.py index be7bae27..751ab86d 100644 --- a/src/square/requests/job_assignment.py +++ b/src/square/requests/job_assignment.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.job_assignment_pay_type import JobAssignmentPayType from .money import MoneyParams diff --git a/src/square/requests/job_created_event.py b/src/square/requests/job_created_event.py index de43fc6d..8af2c7f3 100644 --- a/src/square/requests/job_created_event.py +++ b/src/square/requests/job_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .job_created_event_data import JobCreatedEventDataParams diff --git a/src/square/requests/job_created_event_data.py b/src/square/requests/job_created_event_data.py index 29a3d2f1..a21297ee 100644 --- a/src/square/requests/job_created_event_data.py +++ b/src/square/requests/job_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .job_created_event_object import JobCreatedEventObjectParams diff --git a/src/square/requests/job_created_event_object.py b/src/square/requests/job_created_event_object.py index 1f9802ae..700fe956 100644 --- a/src/square/requests/job_created_event_object.py +++ b/src/square/requests/job_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .job import JobParams diff --git a/src/square/requests/job_updated_event.py b/src/square/requests/job_updated_event.py index e5e32f5f..6b071b51 100644 --- a/src/square/requests/job_updated_event.py +++ b/src/square/requests/job_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .job_updated_event_data import JobUpdatedEventDataParams diff --git a/src/square/requests/job_updated_event_data.py b/src/square/requests/job_updated_event_data.py index 1650ae7a..07c0ca89 100644 --- a/src/square/requests/job_updated_event_data.py +++ b/src/square/requests/job_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .job_updated_event_object import JobUpdatedEventObjectParams diff --git a/src/square/requests/job_updated_event_object.py b/src/square/requests/job_updated_event_object.py index 095ded6f..a8b7a9e8 100644 --- a/src/square/requests/job_updated_event_object.py +++ b/src/square/requests/job_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .job import JobParams diff --git a/src/square/requests/labor_scheduled_shift_created_event.py b/src/square/requests/labor_scheduled_shift_created_event.py index 8088f179..21aec06e 100644 --- a/src/square/requests/labor_scheduled_shift_created_event.py +++ b/src/square/requests/labor_scheduled_shift_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_created_event_data import LaborScheduledShiftCreatedEventDataParams diff --git a/src/square/requests/labor_scheduled_shift_created_event_data.py b/src/square/requests/labor_scheduled_shift_created_event_data.py index 7c7a0412..e0b1526b 100644 --- a/src/square/requests/labor_scheduled_shift_created_event_data.py +++ b/src/square/requests/labor_scheduled_shift_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_created_event_object import LaborScheduledShiftCreatedEventObjectParams diff --git a/src/square/requests/labor_scheduled_shift_created_event_object.py b/src/square/requests/labor_scheduled_shift_created_event_object.py index 46a4e33f..b6fd5d0d 100644 --- a/src/square/requests/labor_scheduled_shift_created_event_object.py +++ b/src/square/requests/labor_scheduled_shift_created_event_object.py @@ -1,8 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..core.serialization import FieldMetadata +import typing_extensions from .scheduled_shift import ScheduledShiftParams +from ..core.serialization import FieldMetadata class LaborScheduledShiftCreatedEventObjectParams(typing_extensions.TypedDict): diff --git a/src/square/requests/labor_scheduled_shift_deleted_event.py b/src/square/requests/labor_scheduled_shift_deleted_event.py index ed134802..252cef2e 100644 --- a/src/square/requests/labor_scheduled_shift_deleted_event.py +++ b/src/square/requests/labor_scheduled_shift_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_deleted_event_data import LaborScheduledShiftDeletedEventDataParams diff --git a/src/square/requests/labor_scheduled_shift_deleted_event_data.py b/src/square/requests/labor_scheduled_shift_deleted_event_data.py index 5d051f41..71caed88 100644 --- a/src/square/requests/labor_scheduled_shift_deleted_event_data.py +++ b/src/square/requests/labor_scheduled_shift_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LaborScheduledShiftDeletedEventDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/labor_scheduled_shift_published_event.py b/src/square/requests/labor_scheduled_shift_published_event.py index e11b8520..a359e657 100644 --- a/src/square/requests/labor_scheduled_shift_published_event.py +++ b/src/square/requests/labor_scheduled_shift_published_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_published_event_data import LaborScheduledShiftPublishedEventDataParams diff --git a/src/square/requests/labor_scheduled_shift_published_event_data.py b/src/square/requests/labor_scheduled_shift_published_event_data.py index 14fab0aa..ca0f238a 100644 --- a/src/square/requests/labor_scheduled_shift_published_event_data.py +++ b/src/square/requests/labor_scheduled_shift_published_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_published_event_object import LaborScheduledShiftPublishedEventObjectParams diff --git a/src/square/requests/labor_scheduled_shift_published_event_object.py b/src/square/requests/labor_scheduled_shift_published_event_object.py index c671db84..fcc1aba7 100644 --- a/src/square/requests/labor_scheduled_shift_published_event_object.py +++ b/src/square/requests/labor_scheduled_shift_published_event_object.py @@ -1,8 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..core.serialization import FieldMetadata +import typing_extensions from .scheduled_shift import ScheduledShiftParams +from ..core.serialization import FieldMetadata class LaborScheduledShiftPublishedEventObjectParams(typing_extensions.TypedDict): diff --git a/src/square/requests/labor_scheduled_shift_updated_event.py b/src/square/requests/labor_scheduled_shift_updated_event.py index 0c39fd1e..a32b353d 100644 --- a/src/square/requests/labor_scheduled_shift_updated_event.py +++ b/src/square/requests/labor_scheduled_shift_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_updated_event_data import LaborScheduledShiftUpdatedEventDataParams diff --git a/src/square/requests/labor_scheduled_shift_updated_event_data.py b/src/square/requests/labor_scheduled_shift_updated_event_data.py index dffa1c01..246afe9d 100644 --- a/src/square/requests/labor_scheduled_shift_updated_event_data.py +++ b/src/square/requests/labor_scheduled_shift_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_scheduled_shift_updated_event_object import LaborScheduledShiftUpdatedEventObjectParams diff --git a/src/square/requests/labor_scheduled_shift_updated_event_object.py b/src/square/requests/labor_scheduled_shift_updated_event_object.py index c14c8938..d165cad9 100644 --- a/src/square/requests/labor_scheduled_shift_updated_event_object.py +++ b/src/square/requests/labor_scheduled_shift_updated_event_object.py @@ -1,8 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..core.serialization import FieldMetadata +import typing_extensions from .scheduled_shift import ScheduledShiftParams +from ..core.serialization import FieldMetadata class LaborScheduledShiftUpdatedEventObjectParams(typing_extensions.TypedDict): diff --git a/src/square/requests/labor_shift_created_event.py b/src/square/requests/labor_shift_created_event.py index 909e8edd..9ca01d74 100644 --- a/src/square/requests/labor_shift_created_event.py +++ b/src/square/requests/labor_shift_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_shift_created_event_data import LaborShiftCreatedEventDataParams diff --git a/src/square/requests/labor_shift_created_event_data.py b/src/square/requests/labor_shift_created_event_data.py index a0a4b9a3..fc49eec4 100644 --- a/src/square/requests/labor_shift_created_event_data.py +++ b/src/square/requests/labor_shift_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_shift_created_event_object import LaborShiftCreatedEventObjectParams diff --git a/src/square/requests/labor_shift_created_event_object.py b/src/square/requests/labor_shift_created_event_object.py index 29817007..07450468 100644 --- a/src/square/requests/labor_shift_created_event_object.py +++ b/src/square/requests/labor_shift_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .shift import ShiftParams diff --git a/src/square/requests/labor_shift_deleted_event.py b/src/square/requests/labor_shift_deleted_event.py index abc6610a..c4747fd5 100644 --- a/src/square/requests/labor_shift_deleted_event.py +++ b/src/square/requests/labor_shift_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_shift_deleted_event_data import LaborShiftDeletedEventDataParams diff --git a/src/square/requests/labor_shift_deleted_event_data.py b/src/square/requests/labor_shift_deleted_event_data.py index 0cd20fa6..ad497962 100644 --- a/src/square/requests/labor_shift_deleted_event_data.py +++ b/src/square/requests/labor_shift_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LaborShiftDeletedEventDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/labor_shift_updated_event.py b/src/square/requests/labor_shift_updated_event.py index 99647094..f56c98bb 100644 --- a/src/square/requests/labor_shift_updated_event.py +++ b/src/square/requests/labor_shift_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_shift_updated_event_data import LaborShiftUpdatedEventDataParams diff --git a/src/square/requests/labor_shift_updated_event_data.py b/src/square/requests/labor_shift_updated_event_data.py index 9ca7b17d..9205f7ec 100644 --- a/src/square/requests/labor_shift_updated_event_data.py +++ b/src/square/requests/labor_shift_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_shift_updated_event_object import LaborShiftUpdatedEventObjectParams diff --git a/src/square/requests/labor_shift_updated_event_object.py b/src/square/requests/labor_shift_updated_event_object.py index e324d2c1..6ace74e5 100644 --- a/src/square/requests/labor_shift_updated_event_object.py +++ b/src/square/requests/labor_shift_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .shift import ShiftParams diff --git a/src/square/requests/labor_timecard_created_event.py b/src/square/requests/labor_timecard_created_event.py index 9aaf8310..c1ac6c2c 100644 --- a/src/square/requests/labor_timecard_created_event.py +++ b/src/square/requests/labor_timecard_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_timecard_created_event_data import LaborTimecardCreatedEventDataParams diff --git a/src/square/requests/labor_timecard_created_event_data.py b/src/square/requests/labor_timecard_created_event_data.py index 2704d00e..bc6563d5 100644 --- a/src/square/requests/labor_timecard_created_event_data.py +++ b/src/square/requests/labor_timecard_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_timecard_created_event_object import LaborTimecardCreatedEventObjectParams diff --git a/src/square/requests/labor_timecard_created_event_object.py b/src/square/requests/labor_timecard_created_event_object.py index b245c355..da3a46c4 100644 --- a/src/square/requests/labor_timecard_created_event_object.py +++ b/src/square/requests/labor_timecard_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .timecard import TimecardParams diff --git a/src/square/requests/labor_timecard_deleted_event.py b/src/square/requests/labor_timecard_deleted_event.py index ba5c243a..651d9e20 100644 --- a/src/square/requests/labor_timecard_deleted_event.py +++ b/src/square/requests/labor_timecard_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_timecard_deleted_event_data import LaborTimecardDeletedEventDataParams diff --git a/src/square/requests/labor_timecard_deleted_event_data.py b/src/square/requests/labor_timecard_deleted_event_data.py index c821688d..35942f8b 100644 --- a/src/square/requests/labor_timecard_deleted_event_data.py +++ b/src/square/requests/labor_timecard_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LaborTimecardDeletedEventDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/labor_timecard_updated_event.py b/src/square/requests/labor_timecard_updated_event.py index 93a65fa1..31103492 100644 --- a/src/square/requests/labor_timecard_updated_event.py +++ b/src/square/requests/labor_timecard_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_timecard_updated_event_data import LaborTimecardUpdatedEventDataParams diff --git a/src/square/requests/labor_timecard_updated_event_data.py b/src/square/requests/labor_timecard_updated_event_data.py index e342bf23..52bb86dd 100644 --- a/src/square/requests/labor_timecard_updated_event_data.py +++ b/src/square/requests/labor_timecard_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .labor_timecard_updated_event_object import LaborTimecardUpdatedEventObjectParams diff --git a/src/square/requests/labor_timecard_updated_event_object.py b/src/square/requests/labor_timecard_updated_event_object.py index 44d332be..51563549 100644 --- a/src/square/requests/labor_timecard_updated_event_object.py +++ b/src/square/requests/labor_timecard_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .timecard import TimecardParams diff --git a/src/square/requests/link_customer_to_gift_card_response.py b/src/square/requests/link_customer_to_gift_card_response.py index 46fc1519..32575733 100644 --- a/src/square/requests/link_customer_to_gift_card_response.py +++ b/src/square/requests/link_customer_to_gift_card_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/list_bank_accounts_response.py b/src/square/requests/list_bank_accounts_response.py index 4ecadd3b..e0fb8e04 100644 --- a/src/square/requests/list_bank_accounts_response.py +++ b/src/square/requests/list_bank_accounts_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .bank_account import BankAccountParams +import typing_extensions +import typing from .error import ErrorParams +from .bank_account import BankAccountParams class ListBankAccountsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_booking_custom_attribute_definitions_response.py b/src/square/requests/list_booking_custom_attribute_definitions_response.py index fb8b1c1c..5883022e 100644 --- a/src/square/requests/list_booking_custom_attribute_definitions_response.py +++ b/src/square/requests/list_booking_custom_attribute_definitions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition import CustomAttributeDefinitionParams from .error import ErrorParams diff --git a/src/square/requests/list_booking_custom_attributes_response.py b/src/square/requests/list_booking_custom_attributes_response.py index 1f9fc3b3..85558b7d 100644 --- a/src/square/requests/list_booking_custom_attributes_response.py +++ b/src/square/requests/list_booking_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute import CustomAttributeParams from .error import ErrorParams diff --git a/src/square/requests/list_bookings_response.py b/src/square/requests/list_bookings_response.py index 89fd0030..87c639fe 100644 --- a/src/square/requests/list_bookings_response.py +++ b/src/square/requests/list_bookings_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .booking import BookingParams from .error import ErrorParams diff --git a/src/square/requests/list_break_types_response.py b/src/square/requests/list_break_types_response.py index db67af36..fbbd8db1 100644 --- a/src/square/requests/list_break_types_response.py +++ b/src/square/requests/list_break_types_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .break_type import BreakTypeParams from .error import ErrorParams diff --git a/src/square/requests/list_cards_response.py b/src/square/requests/list_cards_response.py index 98eab1cc..36e7a8a3 100644 --- a/src/square/requests/list_cards_response.py +++ b/src/square/requests/list_cards_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .card import CardParams +import typing_extensions +import typing from .error import ErrorParams +from .card import CardParams class ListCardsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_cash_drawer_shift_events_response.py b/src/square/requests/list_cash_drawer_shift_events_response.py index df551d41..6cb01a67 100644 --- a/src/square/requests/list_cash_drawer_shift_events_response.py +++ b/src/square/requests/list_cash_drawer_shift_events_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .cash_drawer_shift_event import CashDrawerShiftEventParams +import typing_extensions +import typing from .error import ErrorParams +from .cash_drawer_shift_event import CashDrawerShiftEventParams class ListCashDrawerShiftEventsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_cash_drawer_shifts_response.py b/src/square/requests/list_cash_drawer_shifts_response.py index b461bf74..c2ce477f 100644 --- a/src/square/requests/list_cash_drawer_shifts_response.py +++ b/src/square/requests/list_cash_drawer_shifts_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .cash_drawer_shift_summary import CashDrawerShiftSummaryParams +import typing_extensions +import typing from .error import ErrorParams +from .cash_drawer_shift_summary import CashDrawerShiftSummaryParams class ListCashDrawerShiftsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_catalog_response.py b/src/square/requests/list_catalog_response.py index 41cffb7f..baf4328d 100644 --- a/src/square/requests/list_catalog_response.py +++ b/src/square/requests/list_catalog_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class ListCatalogResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_channels_response.py b/src/square/requests/list_channels_response.py deleted file mode 100644 index 1e3433ae..00000000 --- a/src/square/requests/list_channels_response.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .channel import ChannelParams -from .error import ErrorParams - - -class ListChannelsResponseParams(typing_extensions.TypedDict): - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Information about errors encountered during the request. - """ - - channels: typing_extensions.NotRequired[typing.Sequence[ChannelParams]] - """ - List of requested Channel. - """ - - cursor: typing_extensions.NotRequired[str] - """ - The token required to retrieve the next page of results. - """ diff --git a/src/square/requests/list_customer_custom_attribute_definitions_response.py b/src/square/requests/list_customer_custom_attribute_definitions_response.py index 05ad69b2..14569e7e 100644 --- a/src/square/requests/list_customer_custom_attribute_definitions_response.py +++ b/src/square/requests/list_customer_custom_attribute_definitions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition import CustomAttributeDefinitionParams from .error import ErrorParams diff --git a/src/square/requests/list_customer_custom_attributes_response.py b/src/square/requests/list_customer_custom_attributes_response.py index 9edf2342..87329e55 100644 --- a/src/square/requests/list_customer_custom_attributes_response.py +++ b/src/square/requests/list_customer_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute import CustomAttributeParams from .error import ErrorParams diff --git a/src/square/requests/list_customer_groups_response.py b/src/square/requests/list_customer_groups_response.py index 4c368970..b0d6493f 100644 --- a/src/square/requests/list_customer_groups_response.py +++ b/src/square/requests/list_customer_groups_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_group import CustomerGroupParams +import typing_extensions +import typing from .error import ErrorParams +from .customer_group import CustomerGroupParams class ListCustomerGroupsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_customer_segments_response.py b/src/square/requests/list_customer_segments_response.py index 0eaf92d1..d45450ac 100644 --- a/src/square/requests/list_customer_segments_response.py +++ b/src/square/requests/list_customer_segments_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_segment import CustomerSegmentParams +import typing_extensions +import typing from .error import ErrorParams +from .customer_segment import CustomerSegmentParams class ListCustomerSegmentsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_customers_response.py b/src/square/requests/list_customers_response.py index ac3f6201..abec80e3 100644 --- a/src/square/requests/list_customers_response.py +++ b/src/square/requests/list_customers_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer import CustomerParams +import typing_extensions +import typing from .error import ErrorParams +from .customer import CustomerParams class ListCustomersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_device_codes_response.py b/src/square/requests/list_device_codes_response.py index 3c921140..b32cb9fb 100644 --- a/src/square/requests/list_device_codes_response.py +++ b/src/square/requests/list_device_codes_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .device_code import DeviceCodeParams +import typing_extensions +import typing from .error import ErrorParams +from .device_code import DeviceCodeParams class ListDeviceCodesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_devices_response.py b/src/square/requests/list_devices_response.py index 25b84dc3..26a5b8a2 100644 --- a/src/square/requests/list_devices_response.py +++ b/src/square/requests/list_devices_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .device import DeviceParams +import typing_extensions +import typing from .error import ErrorParams +from .device import DeviceParams class ListDevicesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_dispute_evidence_response.py b/src/square/requests/list_dispute_evidence_response.py index c640cf0b..1a324d96 100644 --- a/src/square/requests/list_dispute_evidence_response.py +++ b/src/square/requests/list_dispute_evidence_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .dispute_evidence import DisputeEvidenceParams from .error import ErrorParams diff --git a/src/square/requests/list_disputes_response.py b/src/square/requests/list_disputes_response.py index aa1d681e..a4b14505 100644 --- a/src/square/requests/list_disputes_response.py +++ b/src/square/requests/list_disputes_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute import DisputeParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute import DisputeParams class ListDisputesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_employee_wages_response.py b/src/square/requests/list_employee_wages_response.py index 0ba29709..cf69d75a 100644 --- a/src/square/requests/list_employee_wages_response.py +++ b/src/square/requests/list_employee_wages_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .employee_wage import EmployeeWageParams from .error import ErrorParams diff --git a/src/square/requests/list_employees_response.py b/src/square/requests/list_employees_response.py index 0832d468..fa99d4fb 100644 --- a/src/square/requests/list_employees_response.py +++ b/src/square/requests/list_employees_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .employee import EmployeeParams from .error import ErrorParams diff --git a/src/square/requests/list_event_types_response.py b/src/square/requests/list_event_types_response.py index 3202b6b7..a35185ad 100644 --- a/src/square/requests/list_event_types_response.py +++ b/src/square/requests/list_event_types_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .event_type_metadata import EventTypeMetadataParams diff --git a/src/square/requests/list_gift_card_activities_response.py b/src/square/requests/list_gift_card_activities_response.py index 89fa3c21..0f03a1f7 100644 --- a/src/square/requests/list_gift_card_activities_response.py +++ b/src/square/requests/list_gift_card_activities_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card_activity import GiftCardActivityParams diff --git a/src/square/requests/list_gift_cards_response.py b/src/square/requests/list_gift_cards_response.py index 07a790cc..6ea4e97d 100644 --- a/src/square/requests/list_gift_cards_response.py +++ b/src/square/requests/list_gift_cards_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/list_invoices_response.py b/src/square/requests/list_invoices_response.py index 08a356cb..186ef518 100644 --- a/src/square/requests/list_invoices_response.py +++ b/src/square/requests/list_invoices_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .invoice import InvoiceParams +from .error import ErrorParams class ListInvoicesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_jobs_response.py b/src/square/requests/list_jobs_response.py index dc908be0..f85815aa 100644 --- a/src/square/requests/list_jobs_response.py +++ b/src/square/requests/list_jobs_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .job import JobParams +from .error import ErrorParams class ListJobsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_location_booking_profiles_response.py b/src/square/requests/list_location_booking_profiles_response.py index b83619a8..0f4eee92 100644 --- a/src/square/requests/list_location_booking_profiles_response.py +++ b/src/square/requests/list_location_booking_profiles_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .location_booking_profile import LocationBookingProfileParams +from .error import ErrorParams class ListLocationBookingProfilesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_location_custom_attribute_definitions_response.py b/src/square/requests/list_location_custom_attribute_definitions_response.py index 0d2defc1..b977a671 100644 --- a/src/square/requests/list_location_custom_attribute_definitions_response.py +++ b/src/square/requests/list_location_custom_attribute_definitions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition import CustomAttributeDefinitionParams from .error import ErrorParams diff --git a/src/square/requests/list_location_custom_attributes_response.py b/src/square/requests/list_location_custom_attributes_response.py index 2a59a940..b0813958 100644 --- a/src/square/requests/list_location_custom_attributes_response.py +++ b/src/square/requests/list_location_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute import CustomAttributeParams from .error import ErrorParams diff --git a/src/square/requests/list_locations_response.py b/src/square/requests/list_locations_response.py index e8aa9981..d6f6b9e0 100644 --- a/src/square/requests/list_locations_response.py +++ b/src/square/requests/list_locations_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .location import LocationParams diff --git a/src/square/requests/list_loyalty_programs_response.py b/src/square/requests/list_loyalty_programs_response.py index e9fcdc94..c0c786ba 100644 --- a/src/square/requests/list_loyalty_programs_response.py +++ b/src/square/requests/list_loyalty_programs_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_program import LoyaltyProgramParams diff --git a/src/square/requests/list_loyalty_promotions_response.py b/src/square/requests/list_loyalty_promotions_response.py index 404a45e0..f2ca878d 100644 --- a/src/square/requests/list_loyalty_promotions_response.py +++ b/src/square/requests/list_loyalty_promotions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_promotion import LoyaltyPromotionParams diff --git a/src/square/requests/list_merchant_custom_attribute_definitions_response.py b/src/square/requests/list_merchant_custom_attribute_definitions_response.py index fdbc943d..a1fa6fd3 100644 --- a/src/square/requests/list_merchant_custom_attribute_definitions_response.py +++ b/src/square/requests/list_merchant_custom_attribute_definitions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition import CustomAttributeDefinitionParams from .error import ErrorParams diff --git a/src/square/requests/list_merchant_custom_attributes_response.py b/src/square/requests/list_merchant_custom_attributes_response.py index 5615c36c..376d8b9d 100644 --- a/src/square/requests/list_merchant_custom_attributes_response.py +++ b/src/square/requests/list_merchant_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute import CustomAttributeParams from .error import ErrorParams diff --git a/src/square/requests/list_merchants_response.py b/src/square/requests/list_merchants_response.py index 3816a1d2..d715ab2c 100644 --- a/src/square/requests/list_merchants_response.py +++ b/src/square/requests/list_merchants_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .merchant import MerchantParams diff --git a/src/square/requests/list_order_custom_attribute_definitions_response.py b/src/square/requests/list_order_custom_attribute_definitions_response.py index 075d2cbb..a5ebea0f 100644 --- a/src/square/requests/list_order_custom_attribute_definitions_response.py +++ b/src/square/requests/list_order_custom_attribute_definitions_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing_extensions from .error import ErrorParams diff --git a/src/square/requests/list_order_custom_attributes_response.py b/src/square/requests/list_order_custom_attributes_response.py index 60988485..5d6c601a 100644 --- a/src/square/requests/list_order_custom_attributes_response.py +++ b/src/square/requests/list_order_custom_attributes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute import CustomAttributeParams from .error import ErrorParams diff --git a/src/square/requests/list_payment_links_response.py b/src/square/requests/list_payment_links_response.py index 64b67f18..475c4fc5 100644 --- a/src/square/requests/list_payment_links_response.py +++ b/src/square/requests/list_payment_links_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_link import PaymentLinkParams diff --git a/src/square/requests/list_payment_refunds_response.py b/src/square/requests/list_payment_refunds_response.py index 22faf9e3..168b07f8 100644 --- a/src/square/requests/list_payment_refunds_response.py +++ b/src/square/requests/list_payment_refunds_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_refund import PaymentRefundParams diff --git a/src/square/requests/list_payments_response.py b/src/square/requests/list_payments_response.py index 683e0352..7dde3c8e 100644 --- a/src/square/requests/list_payments_response.py +++ b/src/square/requests/list_payments_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment import PaymentParams diff --git a/src/square/requests/list_payout_entries_response.py b/src/square/requests/list_payout_entries_response.py index 0ad97068..51c9c053 100644 --- a/src/square/requests/list_payout_entries_response.py +++ b/src/square/requests/list_payout_entries_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .payout_entry import PayoutEntryParams +from .error import ErrorParams class ListPayoutEntriesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_payouts_response.py b/src/square/requests/list_payouts_response.py index 35a2f43a..05b80b25 100644 --- a/src/square/requests/list_payouts_response.py +++ b/src/square/requests/list_payouts_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .payout import PayoutParams +from .error import ErrorParams class ListPayoutsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_sites_response.py b/src/square/requests/list_sites_response.py index 12900b54..7e08ebdb 100644 --- a/src/square/requests/list_sites_response.py +++ b/src/square/requests/list_sites_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .site import SiteParams diff --git a/src/square/requests/list_subscription_events_response.py b/src/square/requests/list_subscription_events_response.py index df9b344c..464496ca 100644 --- a/src/square/requests/list_subscription_events_response.py +++ b/src/square/requests/list_subscription_events_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription_event import SubscriptionEventParams diff --git a/src/square/requests/list_team_member_booking_profiles_response.py b/src/square/requests/list_team_member_booking_profiles_response.py index 38db3b98..b0d5227d 100644 --- a/src/square/requests/list_team_member_booking_profiles_response.py +++ b/src/square/requests/list_team_member_booking_profiles_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .team_member_booking_profile import TeamMemberBookingProfileParams +from .error import ErrorParams class ListTeamMemberBookingProfilesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_team_member_wages_response.py b/src/square/requests/list_team_member_wages_response.py index 7c20cc4b..1b8738e8 100644 --- a/src/square/requests/list_team_member_wages_response.py +++ b/src/square/requests/list_team_member_wages_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .team_member_wage import TeamMemberWageParams +from .error import ErrorParams class ListTeamMemberWagesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/list_transactions_response.py b/src/square/requests/list_transactions_response.py index 5d4dc825..ef54b484 100644 --- a/src/square/requests/list_transactions_response.py +++ b/src/square/requests/list_transactions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .transaction import TransactionParams diff --git a/src/square/requests/list_webhook_event_types_response.py b/src/square/requests/list_webhook_event_types_response.py index 8f8788ff..6daf0201 100644 --- a/src/square/requests/list_webhook_event_types_response.py +++ b/src/square/requests/list_webhook_event_types_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .event_type_metadata import EventTypeMetadataParams diff --git a/src/square/requests/list_webhook_subscriptions_response.py b/src/square/requests/list_webhook_subscriptions_response.py index dd3c296e..6a9e33f1 100644 --- a/src/square/requests/list_webhook_subscriptions_response.py +++ b/src/square/requests/list_webhook_subscriptions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .webhook_subscription import WebhookSubscriptionParams diff --git a/src/square/requests/list_workweek_configs_response.py b/src/square/requests/list_workweek_configs_response.py index b9f8e432..c7f1de6e 100644 --- a/src/square/requests/list_workweek_configs_response.py +++ b/src/square/requests/list_workweek_configs_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .workweek_config import WorkweekConfigParams +from .error import ErrorParams class ListWorkweekConfigsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/location.py b/src/square/requests/location.py index 87d42239..554b90b9 100644 --- a/src/square/requests/location.py +++ b/src/square/requests/location.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.country import Country -from ..types.currency import Currency +import typing_extensions +import typing +from .address import AddressParams from ..types.location_capability import LocationCapability from ..types.location_status import LocationStatus +from ..types.country import Country +from ..types.currency import Currency from ..types.location_type import LocationType -from .address import AddressParams from .business_hours import BusinessHoursParams from .coordinates import CoordinatesParams from .tax_ids import TaxIdsParams diff --git a/src/square/requests/location_booking_profile.py b/src/square/requests/location_booking_profile.py index 3827f59d..27881d17 100644 --- a/src/square/requests/location_booking_profile.py +++ b/src/square/requests/location_booking_profile.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LocationBookingProfileParams(typing_extensions.TypedDict): diff --git a/src/square/requests/location_created_event.py b/src/square/requests/location_created_event.py index 9b00b0f0..e9359a07 100644 --- a/src/square/requests/location_created_event.py +++ b/src/square/requests/location_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .location_created_event_data import LocationCreatedEventDataParams diff --git a/src/square/requests/location_created_event_data.py b/src/square/requests/location_created_event_data.py index d0d63857..2776e8d7 100644 --- a/src/square/requests/location_created_event_data.py +++ b/src/square/requests/location_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LocationCreatedEventDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/location_custom_attribute_definition_owned_created_event.py b/src/square/requests/location_custom_attribute_definition_owned_created_event.py index 14b43fff..e6c39b1f 100644 --- a/src/square/requests/location_custom_attribute_definition_owned_created_event.py +++ b/src/square/requests/location_custom_attribute_definition_owned_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/location_custom_attribute_definition_owned_deleted_event.py b/src/square/requests/location_custom_attribute_definition_owned_deleted_event.py index d074c49c..f22827ca 100644 --- a/src/square/requests/location_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/requests/location_custom_attribute_definition_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/location_custom_attribute_definition_owned_updated_event.py b/src/square/requests/location_custom_attribute_definition_owned_updated_event.py index 62d0f72e..c77761a7 100644 --- a/src/square/requests/location_custom_attribute_definition_owned_updated_event.py +++ b/src/square/requests/location_custom_attribute_definition_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/location_custom_attribute_definition_visible_created_event.py b/src/square/requests/location_custom_attribute_definition_visible_created_event.py index 7329bb6b..ffbd5817 100644 --- a/src/square/requests/location_custom_attribute_definition_visible_created_event.py +++ b/src/square/requests/location_custom_attribute_definition_visible_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/location_custom_attribute_definition_visible_deleted_event.py b/src/square/requests/location_custom_attribute_definition_visible_deleted_event.py index 9cbc3db9..7dfcc586 100644 --- a/src/square/requests/location_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/requests/location_custom_attribute_definition_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/location_custom_attribute_definition_visible_updated_event.py b/src/square/requests/location_custom_attribute_definition_visible_updated_event.py index 3b8daac8..bfffc604 100644 --- a/src/square/requests/location_custom_attribute_definition_visible_updated_event.py +++ b/src/square/requests/location_custom_attribute_definition_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/location_custom_attribute_owned_deleted_event.py b/src/square/requests/location_custom_attribute_owned_deleted_event.py index 1cbc90d9..7864fc06 100644 --- a/src/square/requests/location_custom_attribute_owned_deleted_event.py +++ b/src/square/requests/location_custom_attribute_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/location_custom_attribute_owned_updated_event.py b/src/square/requests/location_custom_attribute_owned_updated_event.py index 4e24bc1a..01f885d9 100644 --- a/src/square/requests/location_custom_attribute_owned_updated_event.py +++ b/src/square/requests/location_custom_attribute_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/location_custom_attribute_visible_deleted_event.py b/src/square/requests/location_custom_attribute_visible_deleted_event.py index 3319789c..b979c886 100644 --- a/src/square/requests/location_custom_attribute_visible_deleted_event.py +++ b/src/square/requests/location_custom_attribute_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/location_custom_attribute_visible_updated_event.py b/src/square/requests/location_custom_attribute_visible_updated_event.py index ce256338..ac2eb644 100644 --- a/src/square/requests/location_custom_attribute_visible_updated_event.py +++ b/src/square/requests/location_custom_attribute_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/location_settings_updated_event.py b/src/square/requests/location_settings_updated_event.py index 693a39f4..a7202114 100644 --- a/src/square/requests/location_settings_updated_event.py +++ b/src/square/requests/location_settings_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .location_settings_updated_event_data import LocationSettingsUpdatedEventDataParams diff --git a/src/square/requests/location_settings_updated_event_data.py b/src/square/requests/location_settings_updated_event_data.py index e282373c..9c9c1a9d 100644 --- a/src/square/requests/location_settings_updated_event_data.py +++ b/src/square/requests/location_settings_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .location_settings_updated_event_object import LocationSettingsUpdatedEventObjectParams diff --git a/src/square/requests/location_settings_updated_event_object.py b/src/square/requests/location_settings_updated_event_object.py index 4a18c595..caf1fa86 100644 --- a/src/square/requests/location_settings_updated_event_object.py +++ b/src/square/requests/location_settings_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .checkout_location_settings import CheckoutLocationSettingsParams diff --git a/src/square/requests/location_updated_event.py b/src/square/requests/location_updated_event.py index 58dd7142..9dc0a376 100644 --- a/src/square/requests/location_updated_event.py +++ b/src/square/requests/location_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .location_updated_event_data import LocationUpdatedEventDataParams diff --git a/src/square/requests/location_updated_event_data.py b/src/square/requests/location_updated_event_data.py index 1f02f996..f7bf0129 100644 --- a/src/square/requests/location_updated_event_data.py +++ b/src/square/requests/location_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LocationUpdatedEventDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_account.py b/src/square/requests/loyalty_account.py index 5cc7fd79..2f8db9d7 100644 --- a/src/square/requests/loyalty_account.py +++ b/src/square/requests/loyalty_account.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .loyalty_account_expiring_point_deadline import LoyaltyAccountExpiringPointDeadlineParams +import typing_extensions +import typing from .loyalty_account_mapping import LoyaltyAccountMappingParams +from .loyalty_account_expiring_point_deadline import LoyaltyAccountExpiringPointDeadlineParams class LoyaltyAccountParams(typing_extensions.TypedDict): @@ -45,11 +45,10 @@ class LoyaltyAccountParams(typing_extensions.TypedDict): The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the **Enrolled On** or **Member Since** date in first-party Square products. If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's first action on their account - (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale. + (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale. - If this field is set in a `CreateLoyaltyAccount` request, it is meant to be used when there is a loyalty migration from another system and into Square. - In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. - Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale. + This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty account for a buyer who already interacted with their account. + For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future. """ created_at: typing_extensions.NotRequired[str] diff --git a/src/square/requests/loyalty_account_created_event.py b/src/square/requests/loyalty_account_created_event.py index f255e571..97d3cd7e 100644 --- a/src/square/requests/loyalty_account_created_event.py +++ b/src/square/requests/loyalty_account_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_created_event_data import LoyaltyAccountCreatedEventDataParams diff --git a/src/square/requests/loyalty_account_created_event_data.py b/src/square/requests/loyalty_account_created_event_data.py index 95cf5a48..755d77ce 100644 --- a/src/square/requests/loyalty_account_created_event_data.py +++ b/src/square/requests/loyalty_account_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_created_event_object import LoyaltyAccountCreatedEventObjectParams diff --git a/src/square/requests/loyalty_account_created_event_object.py b/src/square/requests/loyalty_account_created_event_object.py index 609308cc..f550abb8 100644 --- a/src/square/requests/loyalty_account_created_event_object.py +++ b/src/square/requests/loyalty_account_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_account import LoyaltyAccountParams diff --git a/src/square/requests/loyalty_account_deleted_event.py b/src/square/requests/loyalty_account_deleted_event.py index f5bc7bca..8718811c 100644 --- a/src/square/requests/loyalty_account_deleted_event.py +++ b/src/square/requests/loyalty_account_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_deleted_event_data import LoyaltyAccountDeletedEventDataParams diff --git a/src/square/requests/loyalty_account_deleted_event_data.py b/src/square/requests/loyalty_account_deleted_event_data.py index 0cf95c8c..d3032fe5 100644 --- a/src/square/requests/loyalty_account_deleted_event_data.py +++ b/src/square/requests/loyalty_account_deleted_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_deleted_event_object import LoyaltyAccountDeletedEventObjectParams diff --git a/src/square/requests/loyalty_account_deleted_event_object.py b/src/square/requests/loyalty_account_deleted_event_object.py index 131439fa..5b08d734 100644 --- a/src/square/requests/loyalty_account_deleted_event_object.py +++ b/src/square/requests/loyalty_account_deleted_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_account import LoyaltyAccountParams diff --git a/src/square/requests/loyalty_account_mapping.py b/src/square/requests/loyalty_account_mapping.py index 7278ca76..d0ff32a6 100644 --- a/src/square/requests/loyalty_account_mapping.py +++ b/src/square/requests/loyalty_account_mapping.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LoyaltyAccountMappingParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_account_updated_event.py b/src/square/requests/loyalty_account_updated_event.py index 8a20658c..0b3e3f46 100644 --- a/src/square/requests/loyalty_account_updated_event.py +++ b/src/square/requests/loyalty_account_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_updated_event_data import LoyaltyAccountUpdatedEventDataParams diff --git a/src/square/requests/loyalty_account_updated_event_data.py b/src/square/requests/loyalty_account_updated_event_data.py index e1060350..17be0dc9 100644 --- a/src/square/requests/loyalty_account_updated_event_data.py +++ b/src/square/requests/loyalty_account_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_updated_event_object import LoyaltyAccountUpdatedEventObjectParams diff --git a/src/square/requests/loyalty_account_updated_event_object.py b/src/square/requests/loyalty_account_updated_event_object.py index 806a5fff..3df6cfcb 100644 --- a/src/square/requests/loyalty_account_updated_event_object.py +++ b/src/square/requests/loyalty_account_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_account import LoyaltyAccountParams diff --git a/src/square/requests/loyalty_event.py b/src/square/requests/loyalty_event.py index 54f29d02..c3409264 100644 --- a/src/square/requests/loyalty_event.py +++ b/src/square/requests/loyalty_event.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.loyalty_event_source import LoyaltyEventSource +import typing_extensions from ..types.loyalty_event_type import LoyaltyEventType from .loyalty_event_accumulate_points import LoyaltyEventAccumulatePointsParams -from .loyalty_event_accumulate_promotion_points import LoyaltyEventAccumulatePromotionPointsParams -from .loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams from .loyalty_event_create_reward import LoyaltyEventCreateRewardParams +from .loyalty_event_redeem_reward import LoyaltyEventRedeemRewardParams from .loyalty_event_delete_reward import LoyaltyEventDeleteRewardParams +from .loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams +from ..types.loyalty_event_source import LoyaltyEventSource from .loyalty_event_expire_points import LoyaltyEventExpirePointsParams from .loyalty_event_other import LoyaltyEventOtherParams -from .loyalty_event_redeem_reward import LoyaltyEventRedeemRewardParams +from .loyalty_event_accumulate_promotion_points import LoyaltyEventAccumulatePromotionPointsParams class LoyaltyEventParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_accumulate_points.py b/src/square/requests/loyalty_event_accumulate_points.py index c16bb23d..4426c7ca 100644 --- a/src/square/requests/loyalty_event_accumulate_points.py +++ b/src/square/requests/loyalty_event_accumulate_points.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LoyaltyEventAccumulatePointsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_accumulate_promotion_points.py b/src/square/requests/loyalty_event_accumulate_promotion_points.py index 7fb6c42e..a291bda8 100644 --- a/src/square/requests/loyalty_event_accumulate_promotion_points.py +++ b/src/square/requests/loyalty_event_accumulate_promotion_points.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class LoyaltyEventAccumulatePromotionPointsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_adjust_points.py b/src/square/requests/loyalty_event_adjust_points.py index ab68bb57..37fb9af5 100644 --- a/src/square/requests/loyalty_event_adjust_points.py +++ b/src/square/requests/loyalty_event_adjust_points.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LoyaltyEventAdjustPointsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_create_reward.py b/src/square/requests/loyalty_event_create_reward.py index a70cce3a..566c952c 100644 --- a/src/square/requests/loyalty_event_create_reward.py +++ b/src/square/requests/loyalty_event_create_reward.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class LoyaltyEventCreateRewardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_created_event.py b/src/square/requests/loyalty_event_created_event.py index 48456abd..e4bb1618 100644 --- a/src/square/requests/loyalty_event_created_event.py +++ b/src/square/requests/loyalty_event_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_event_created_event_data import LoyaltyEventCreatedEventDataParams diff --git a/src/square/requests/loyalty_event_created_event_data.py b/src/square/requests/loyalty_event_created_event_data.py index a8ad0200..f3b65c41 100644 --- a/src/square/requests/loyalty_event_created_event_data.py +++ b/src/square/requests/loyalty_event_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_event_created_event_object import LoyaltyEventCreatedEventObjectParams diff --git a/src/square/requests/loyalty_event_created_event_object.py b/src/square/requests/loyalty_event_created_event_object.py index 071cca1c..9ebce773 100644 --- a/src/square/requests/loyalty_event_created_event_object.py +++ b/src/square/requests/loyalty_event_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_event import LoyaltyEventParams diff --git a/src/square/requests/loyalty_event_delete_reward.py b/src/square/requests/loyalty_event_delete_reward.py index 04f5161b..f46b48d1 100644 --- a/src/square/requests/loyalty_event_delete_reward.py +++ b/src/square/requests/loyalty_event_delete_reward.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class LoyaltyEventDeleteRewardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_expire_points.py b/src/square/requests/loyalty_event_expire_points.py index 5b555c59..9ca4becd 100644 --- a/src/square/requests/loyalty_event_expire_points.py +++ b/src/square/requests/loyalty_event_expire_points.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class LoyaltyEventExpirePointsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_filter.py b/src/square/requests/loyalty_event_filter.py index 777c0046..8f65a2c9 100644 --- a/src/square/requests/loyalty_event_filter.py +++ b/src/square/requests/loyalty_event_filter.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions +from .loyalty_event_loyalty_account_filter import LoyaltyEventLoyaltyAccountFilterParams +from .loyalty_event_type_filter import LoyaltyEventTypeFilterParams from .loyalty_event_date_time_filter import LoyaltyEventDateTimeFilterParams from .loyalty_event_location_filter import LoyaltyEventLocationFilterParams -from .loyalty_event_loyalty_account_filter import LoyaltyEventLoyaltyAccountFilterParams from .loyalty_event_order_filter import LoyaltyEventOrderFilterParams -from .loyalty_event_type_filter import LoyaltyEventTypeFilterParams class LoyaltyEventFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_location_filter.py b/src/square/requests/loyalty_event_location_filter.py index fd63baa4..76fddec9 100644 --- a/src/square/requests/loyalty_event_location_filter.py +++ b/src/square/requests/loyalty_event_location_filter.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing class LoyaltyEventLocationFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_other.py b/src/square/requests/loyalty_event_other.py index e4d7d7a4..0bc9148c 100644 --- a/src/square/requests/loyalty_event_other.py +++ b/src/square/requests/loyalty_event_other.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class LoyaltyEventOtherParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_query.py b/src/square/requests/loyalty_event_query.py index 77e16021..1d370c18 100644 --- a/src/square/requests/loyalty_event_query.py +++ b/src/square/requests/loyalty_event_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_event_filter import LoyaltyEventFilterParams diff --git a/src/square/requests/loyalty_event_redeem_reward.py b/src/square/requests/loyalty_event_redeem_reward.py index af5c657c..f7111f1e 100644 --- a/src/square/requests/loyalty_event_redeem_reward.py +++ b/src/square/requests/loyalty_event_redeem_reward.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class LoyaltyEventRedeemRewardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_event_type_filter.py b/src/square/requests/loyalty_event_type_filter.py index 918b5a8a..5de613b5 100644 --- a/src/square/requests/loyalty_event_type_filter.py +++ b/src/square/requests/loyalty_event_type_filter.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from ..types.loyalty_event_type import LoyaltyEventType diff --git a/src/square/requests/loyalty_program.py b/src/square/requests/loyalty_program.py index 2f1bd7cd..aedbce71 100644 --- a/src/square/requests/loyalty_program.py +++ b/src/square/requests/loyalty_program.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.loyalty_program_status import LoyaltyProgramStatus -from .loyalty_program_accrual_rule import LoyaltyProgramAccrualRuleParams -from .loyalty_program_expiration_policy import LoyaltyProgramExpirationPolicyParams +import typing from .loyalty_program_reward_tier import LoyaltyProgramRewardTierParams +from .loyalty_program_expiration_policy import LoyaltyProgramExpirationPolicyParams from .loyalty_program_terminology import LoyaltyProgramTerminologyParams +from .loyalty_program_accrual_rule import LoyaltyProgramAccrualRuleParams class LoyaltyProgramParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_program_accrual_rule.py b/src/square/requests/loyalty_program_accrual_rule.py index dbbc5f89..1d987987 100644 --- a/src/square/requests/loyalty_program_accrual_rule.py +++ b/src/square/requests/loyalty_program_accrual_rule.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..types.loyalty_program_accrual_rule_type import LoyaltyProgramAccrualRuleType -from .loyalty_program_accrual_rule_category_data import LoyaltyProgramAccrualRuleCategoryDataParams -from .loyalty_program_accrual_rule_item_variation_data import LoyaltyProgramAccrualRuleItemVariationDataParams -from .loyalty_program_accrual_rule_spend_data import LoyaltyProgramAccrualRuleSpendDataParams +import typing_extensions +import typing from .loyalty_program_accrual_rule_visit_data import LoyaltyProgramAccrualRuleVisitDataParams +from .loyalty_program_accrual_rule_spend_data import LoyaltyProgramAccrualRuleSpendDataParams +from .loyalty_program_accrual_rule_item_variation_data import LoyaltyProgramAccrualRuleItemVariationDataParams +from .loyalty_program_accrual_rule_category_data import LoyaltyProgramAccrualRuleCategoryDataParams class LoyaltyProgramAccrualRuleParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_program_accrual_rule_spend_data.py b/src/square/requests/loyalty_program_accrual_rule_spend_data.py index 146d1d91..53dfd43a 100644 --- a/src/square/requests/loyalty_program_accrual_rule_spend_data.py +++ b/src/square/requests/loyalty_program_accrual_rule_spend_data.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode from .money import MoneyParams +import typing_extensions +import typing +from ..types.loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode class LoyaltyProgramAccrualRuleSpendDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_program_accrual_rule_visit_data.py b/src/square/requests/loyalty_program_accrual_rule_visit_data.py index 2d685af3..3565947b 100644 --- a/src/square/requests/loyalty_program_accrual_rule_visit_data.py +++ b/src/square/requests/loyalty_program_accrual_rule_visit_data.py @@ -1,8 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode +import typing_extensions from .money import MoneyParams +from ..types.loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode class LoyaltyProgramAccrualRuleVisitDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_program_created_event.py b/src/square/requests/loyalty_program_created_event.py index f783a77f..62a598e2 100644 --- a/src/square/requests/loyalty_program_created_event.py +++ b/src/square/requests/loyalty_program_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_program_created_event_data import LoyaltyProgramCreatedEventDataParams diff --git a/src/square/requests/loyalty_program_created_event_data.py b/src/square/requests/loyalty_program_created_event_data.py index 132d6a59..eee3c909 100644 --- a/src/square/requests/loyalty_program_created_event_data.py +++ b/src/square/requests/loyalty_program_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_program_created_event_object import LoyaltyProgramCreatedEventObjectParams diff --git a/src/square/requests/loyalty_program_created_event_object.py b/src/square/requests/loyalty_program_created_event_object.py index 608ae5be..b3dc533e 100644 --- a/src/square/requests/loyalty_program_created_event_object.py +++ b/src/square/requests/loyalty_program_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_program import LoyaltyProgramParams diff --git a/src/square/requests/loyalty_program_reward_tier.py b/src/square/requests/loyalty_program_reward_tier.py index 92304d14..168d6cff 100644 --- a/src/square/requests/loyalty_program_reward_tier.py +++ b/src/square/requests/loyalty_program_reward_tier.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .catalog_object_reference import CatalogObjectReferenceParams diff --git a/src/square/requests/loyalty_program_updated_event.py b/src/square/requests/loyalty_program_updated_event.py index 9376645c..c194e3aa 100644 --- a/src/square/requests/loyalty_program_updated_event.py +++ b/src/square/requests/loyalty_program_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_program_updated_event_data import LoyaltyProgramUpdatedEventDataParams diff --git a/src/square/requests/loyalty_program_updated_event_data.py b/src/square/requests/loyalty_program_updated_event_data.py index d437979f..191c17cf 100644 --- a/src/square/requests/loyalty_program_updated_event_data.py +++ b/src/square/requests/loyalty_program_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_program_updated_event_object import LoyaltyProgramUpdatedEventObjectParams diff --git a/src/square/requests/loyalty_program_updated_event_object.py b/src/square/requests/loyalty_program_updated_event_object.py index 41d5c1cf..eed266c0 100644 --- a/src/square/requests/loyalty_program_updated_event_object.py +++ b/src/square/requests/loyalty_program_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_program import LoyaltyProgramParams diff --git a/src/square/requests/loyalty_promotion.py b/src/square/requests/loyalty_promotion.py index 870b49ca..0640bc67 100644 --- a/src/square/requests/loyalty_promotion.py +++ b/src/square/requests/loyalty_promotion.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.loyalty_promotion_status import LoyaltyPromotionStatus -from .loyalty_promotion_available_time_data import LoyaltyPromotionAvailableTimeDataParams +import typing_extensions from .loyalty_promotion_incentive import LoyaltyPromotionIncentiveParams +from .loyalty_promotion_available_time_data import LoyaltyPromotionAvailableTimeDataParams from .loyalty_promotion_trigger_limit import LoyaltyPromotionTriggerLimitParams +from ..types.loyalty_promotion_status import LoyaltyPromotionStatus from .money import MoneyParams +import typing class LoyaltyPromotionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_promotion_available_time_data.py b/src/square/requests/loyalty_promotion_available_time_data.py index 38cb0194..0baaa907 100644 --- a/src/square/requests/loyalty_promotion_available_time_data.py +++ b/src/square/requests/loyalty_promotion_available_time_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LoyaltyPromotionAvailableTimeDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_promotion_created_event.py b/src/square/requests/loyalty_promotion_created_event.py index c9b2a639..bad8c06b 100644 --- a/src/square/requests/loyalty_promotion_created_event.py +++ b/src/square/requests/loyalty_promotion_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_promotion_created_event_data import LoyaltyPromotionCreatedEventDataParams diff --git a/src/square/requests/loyalty_promotion_created_event_data.py b/src/square/requests/loyalty_promotion_created_event_data.py index 6efd8546..408bf740 100644 --- a/src/square/requests/loyalty_promotion_created_event_data.py +++ b/src/square/requests/loyalty_promotion_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_promotion_created_event_object import LoyaltyPromotionCreatedEventObjectParams diff --git a/src/square/requests/loyalty_promotion_created_event_object.py b/src/square/requests/loyalty_promotion_created_event_object.py index dab483ba..e9d373d8 100644 --- a/src/square/requests/loyalty_promotion_created_event_object.py +++ b/src/square/requests/loyalty_promotion_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_promotion import LoyaltyPromotionParams diff --git a/src/square/requests/loyalty_promotion_incentive.py b/src/square/requests/loyalty_promotion_incentive.py index 8fb74946..a47c59ac 100644 --- a/src/square/requests/loyalty_promotion_incentive.py +++ b/src/square/requests/loyalty_promotion_incentive.py @@ -2,8 +2,9 @@ import typing_extensions from ..types.loyalty_promotion_incentive_type import LoyaltyPromotionIncentiveType -from .loyalty_promotion_incentive_points_addition_data import LoyaltyPromotionIncentivePointsAdditionDataParams +import typing_extensions from .loyalty_promotion_incentive_points_multiplier_data import LoyaltyPromotionIncentivePointsMultiplierDataParams +from .loyalty_promotion_incentive_points_addition_data import LoyaltyPromotionIncentivePointsAdditionDataParams class LoyaltyPromotionIncentiveParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_promotion_incentive_points_multiplier_data.py b/src/square/requests/loyalty_promotion_incentive_points_multiplier_data.py index 48323fd7..2f727e28 100644 --- a/src/square/requests/loyalty_promotion_incentive_points_multiplier_data.py +++ b/src/square/requests/loyalty_promotion_incentive_points_multiplier_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class LoyaltyPromotionIncentivePointsMultiplierDataParams(typing_extensions.TypedDict): diff --git a/src/square/requests/loyalty_promotion_trigger_limit.py b/src/square/requests/loyalty_promotion_trigger_limit.py index 62cff443..8742d882 100644 --- a/src/square/requests/loyalty_promotion_trigger_limit.py +++ b/src/square/requests/loyalty_promotion_trigger_limit.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.loyalty_promotion_trigger_limit_interval import LoyaltyPromotionTriggerLimitInterval diff --git a/src/square/requests/loyalty_promotion_updated_event.py b/src/square/requests/loyalty_promotion_updated_event.py index 01103680..000fffed 100644 --- a/src/square/requests/loyalty_promotion_updated_event.py +++ b/src/square/requests/loyalty_promotion_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_promotion_updated_event_data import LoyaltyPromotionUpdatedEventDataParams diff --git a/src/square/requests/loyalty_promotion_updated_event_data.py b/src/square/requests/loyalty_promotion_updated_event_data.py index 0611d57a..057e0227 100644 --- a/src/square/requests/loyalty_promotion_updated_event_data.py +++ b/src/square/requests/loyalty_promotion_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_promotion_updated_event_object import LoyaltyPromotionUpdatedEventObjectParams diff --git a/src/square/requests/loyalty_promotion_updated_event_object.py b/src/square/requests/loyalty_promotion_updated_event_object.py index d64cecd2..1d0d36b0 100644 --- a/src/square/requests/loyalty_promotion_updated_event_object.py +++ b/src/square/requests/loyalty_promotion_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .loyalty_promotion import LoyaltyPromotionParams diff --git a/src/square/requests/loyalty_reward.py b/src/square/requests/loyalty_reward.py index 6a2f8db8..b838475e 100644 --- a/src/square/requests/loyalty_reward.py +++ b/src/square/requests/loyalty_reward.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.loyalty_reward_status import LoyaltyRewardStatus +import typing class LoyaltyRewardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/measurement_unit.py b/src/square/requests/measurement_unit.py index 3909e47a..161506af 100644 --- a/src/square/requests/measurement_unit.py +++ b/src/square/requests/measurement_unit.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions +from .measurement_unit_custom import MeasurementUnitCustomParams from ..types.measurement_unit_area import MeasurementUnitArea -from ..types.measurement_unit_generic import MeasurementUnitGeneric from ..types.measurement_unit_length import MeasurementUnitLength -from ..types.measurement_unit_time import MeasurementUnitTime -from ..types.measurement_unit_unit_type import MeasurementUnitUnitType from ..types.measurement_unit_volume import MeasurementUnitVolume from ..types.measurement_unit_weight import MeasurementUnitWeight -from .measurement_unit_custom import MeasurementUnitCustomParams +from ..types.measurement_unit_generic import MeasurementUnitGeneric +from ..types.measurement_unit_time import MeasurementUnitTime +from ..types.measurement_unit_unit_type import MeasurementUnitUnitType class MeasurementUnitParams(typing_extensions.TypedDict): diff --git a/src/square/requests/merchant.py b/src/square/requests/merchant.py index a48a58e6..ac2e498d 100644 --- a/src/square/requests/merchant.py +++ b/src/square/requests/merchant.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.country import Country from ..types.currency import Currency from ..types.merchant_status import MerchantStatus diff --git a/src/square/requests/merchant_custom_attribute_definition_owned_created_event.py b/src/square/requests/merchant_custom_attribute_definition_owned_created_event.py index 4259ff49..b47524a1 100644 --- a/src/square/requests/merchant_custom_attribute_definition_owned_created_event.py +++ b/src/square/requests/merchant_custom_attribute_definition_owned_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_definition_owned_deleted_event.py b/src/square/requests/merchant_custom_attribute_definition_owned_deleted_event.py index b8461c9d..21183cf3 100644 --- a/src/square/requests/merchant_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/requests/merchant_custom_attribute_definition_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_definition_owned_updated_event.py b/src/square/requests/merchant_custom_attribute_definition_owned_updated_event.py index 26b2ae60..65a0d785 100644 --- a/src/square/requests/merchant_custom_attribute_definition_owned_updated_event.py +++ b/src/square/requests/merchant_custom_attribute_definition_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_definition_visible_created_event.py b/src/square/requests/merchant_custom_attribute_definition_visible_created_event.py index 08f397fa..e21d7708 100644 --- a/src/square/requests/merchant_custom_attribute_definition_visible_created_event.py +++ b/src/square/requests/merchant_custom_attribute_definition_visible_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_definition_visible_deleted_event.py b/src/square/requests/merchant_custom_attribute_definition_visible_deleted_event.py index 7f66e7ab..34849933 100644 --- a/src/square/requests/merchant_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/requests/merchant_custom_attribute_definition_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_definition_visible_updated_event.py b/src/square/requests/merchant_custom_attribute_definition_visible_updated_event.py index 8b37e1fc..7f868651 100644 --- a/src/square/requests/merchant_custom_attribute_definition_visible_updated_event.py +++ b/src/square/requests/merchant_custom_attribute_definition_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_owned_deleted_event.py b/src/square/requests/merchant_custom_attribute_owned_deleted_event.py index 9ac3d9ff..735683c6 100644 --- a/src/square/requests/merchant_custom_attribute_owned_deleted_event.py +++ b/src/square/requests/merchant_custom_attribute_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_owned_updated_event.py b/src/square/requests/merchant_custom_attribute_owned_updated_event.py index 5d9d8e09..a3165f2d 100644 --- a/src/square/requests/merchant_custom_attribute_owned_updated_event.py +++ b/src/square/requests/merchant_custom_attribute_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_visible_deleted_event.py b/src/square/requests/merchant_custom_attribute_visible_deleted_event.py index 02b815af..6130d50d 100644 --- a/src/square/requests/merchant_custom_attribute_visible_deleted_event.py +++ b/src/square/requests/merchant_custom_attribute_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/merchant_custom_attribute_visible_updated_event.py b/src/square/requests/merchant_custom_attribute_visible_updated_event.py index 844ddf40..45f8eb3d 100644 --- a/src/square/requests/merchant_custom_attribute_visible_updated_event.py +++ b/src/square/requests/merchant_custom_attribute_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/merchant_settings_updated_event.py b/src/square/requests/merchant_settings_updated_event.py index 819a3721..26b3d75b 100644 --- a/src/square/requests/merchant_settings_updated_event.py +++ b/src/square/requests/merchant_settings_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .merchant_settings_updated_event_data import MerchantSettingsUpdatedEventDataParams diff --git a/src/square/requests/merchant_settings_updated_event_data.py b/src/square/requests/merchant_settings_updated_event_data.py index 06843c90..17eadbaa 100644 --- a/src/square/requests/merchant_settings_updated_event_data.py +++ b/src/square/requests/merchant_settings_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .merchant_settings_updated_event_object import MerchantSettingsUpdatedEventObjectParams diff --git a/src/square/requests/merchant_settings_updated_event_object.py b/src/square/requests/merchant_settings_updated_event_object.py index 65cb18ff..4605a6cb 100644 --- a/src/square/requests/merchant_settings_updated_event_object.py +++ b/src/square/requests/merchant_settings_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .checkout_merchant_settings import CheckoutMerchantSettingsParams diff --git a/src/square/requests/modifier_location_overrides.py b/src/square/requests/modifier_location_overrides.py index e9cb0d51..6b9a397b 100644 --- a/src/square/requests/modifier_location_overrides.py +++ b/src/square/requests/modifier_location_overrides.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/money.py b/src/square/requests/money.py index 612ce8a4..4d034a09 100644 --- a/src/square/requests/money.py +++ b/src/square/requests/money.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.currency import Currency diff --git a/src/square/requests/oauth_authorization_revoked_event.py b/src/square/requests/oauth_authorization_revoked_event.py index 34431685..8fe44c3b 100644 --- a/src/square/requests/oauth_authorization_revoked_event.py +++ b/src/square/requests/oauth_authorization_revoked_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .oauth_authorization_revoked_event_data import OauthAuthorizationRevokedEventDataParams diff --git a/src/square/requests/oauth_authorization_revoked_event_data.py b/src/square/requests/oauth_authorization_revoked_event_data.py index 52cfdf0a..68e85eea 100644 --- a/src/square/requests/oauth_authorization_revoked_event_data.py +++ b/src/square/requests/oauth_authorization_revoked_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .oauth_authorization_revoked_event_object import OauthAuthorizationRevokedEventObjectParams diff --git a/src/square/requests/oauth_authorization_revoked_event_object.py b/src/square/requests/oauth_authorization_revoked_event_object.py index 57597233..7540fd89 100644 --- a/src/square/requests/oauth_authorization_revoked_event_object.py +++ b/src/square/requests/oauth_authorization_revoked_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .oauth_authorization_revoked_event_revocation_object import OauthAuthorizationRevokedEventRevocationObjectParams diff --git a/src/square/requests/oauth_authorization_revoked_event_revocation_object.py b/src/square/requests/oauth_authorization_revoked_event_revocation_object.py index 0d89e289..bf4d4952 100644 --- a/src/square/requests/oauth_authorization_revoked_event_revocation_object.py +++ b/src/square/requests/oauth_authorization_revoked_event_revocation_object.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.oauth_authorization_revoked_event_revoker_type import OauthAuthorizationRevokedEventRevokerType diff --git a/src/square/requests/obtain_token_response.py b/src/square/requests/obtain_token_response.py index f53b6bf9..debf7560 100644 --- a/src/square/requests/obtain_token_response.py +++ b/src/square/requests/obtain_token_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/offline_payment_details.py b/src/square/requests/offline_payment_details.py index 994c3552..9e76b90a 100644 --- a/src/square/requests/offline_payment_details.py +++ b/src/square/requests/offline_payment_details.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class OfflinePaymentDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order.py b/src/square/requests/order.py index a6480d03..52658a8f 100644 --- a/src/square/requests/order.py +++ b/src/square/requests/order.py @@ -1,23 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_state import OrderState -from .fulfillment import FulfillmentParams -from .money import MoneyParams +import typing_extensions +import typing +from .order_source import OrderSourceParams from .order_line_item import OrderLineItemParams -from .order_line_item_discount import OrderLineItemDiscountParams from .order_line_item_tax import OrderLineItemTaxParams -from .order_money_amounts import OrderMoneyAmountsParams -from .order_pricing_options import OrderPricingOptionsParams +from .order_line_item_discount import OrderLineItemDiscountParams +from .order_service_charge import OrderServiceChargeParams +from .fulfillment import FulfillmentParams from .order_return import OrderReturnParams -from .order_reward import OrderRewardParams +from .order_money_amounts import OrderMoneyAmountsParams from .order_rounding_adjustment import OrderRoundingAdjustmentParams -from .order_service_charge import OrderServiceChargeParams -from .order_source import OrderSourceParams -from .refund import RefundParams from .tender import TenderParams +from .refund import RefundParams +from ..types.order_state import OrderState +from .money import MoneyParams +from .order_pricing_options import OrderPricingOptionsParams +from .order_reward import OrderRewardParams class OrderParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_created.py b/src/square/requests/order_created.py index 9cb491f2..d9c4caa5 100644 --- a/src/square/requests/order_created.py +++ b/src/square/requests/order_created.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.order_state import OrderState diff --git a/src/square/requests/order_created_event.py b/src/square/requests/order_created_event.py index ebdfcdcb..44119aa7 100644 --- a/src/square/requests/order_created_event.py +++ b/src/square/requests/order_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_created_event_data import OrderCreatedEventDataParams diff --git a/src/square/requests/order_created_event_data.py b/src/square/requests/order_created_event_data.py index 5e356c8c..2317c673 100644 --- a/src/square/requests/order_created_event_data.py +++ b/src/square/requests/order_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_created_object import OrderCreatedObjectParams diff --git a/src/square/requests/order_created_object.py b/src/square/requests/order_created_object.py index 17dc381e..cdd1fba3 100644 --- a/src/square/requests/order_created_object.py +++ b/src/square/requests/order_created_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .order_created import OrderCreatedParams diff --git a/src/square/requests/order_custom_attribute_definition_owned_created_event.py b/src/square/requests/order_custom_attribute_definition_owned_created_event.py index f2aac260..95dc5710 100644 --- a/src/square/requests/order_custom_attribute_definition_owned_created_event.py +++ b/src/square/requests/order_custom_attribute_definition_owned_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/order_custom_attribute_definition_owned_deleted_event.py b/src/square/requests/order_custom_attribute_definition_owned_deleted_event.py index 864b86f5..4023d974 100644 --- a/src/square/requests/order_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/requests/order_custom_attribute_definition_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/order_custom_attribute_definition_owned_updated_event.py b/src/square/requests/order_custom_attribute_definition_owned_updated_event.py index 3ce002b2..33dbe23c 100644 --- a/src/square/requests/order_custom_attribute_definition_owned_updated_event.py +++ b/src/square/requests/order_custom_attribute_definition_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/order_custom_attribute_definition_visible_created_event.py b/src/square/requests/order_custom_attribute_definition_visible_created_event.py index 0b9812db..c36b8018 100644 --- a/src/square/requests/order_custom_attribute_definition_visible_created_event.py +++ b/src/square/requests/order_custom_attribute_definition_visible_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/order_custom_attribute_definition_visible_deleted_event.py b/src/square/requests/order_custom_attribute_definition_visible_deleted_event.py index 213c34bb..3b5edfb9 100644 --- a/src/square/requests/order_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/requests/order_custom_attribute_definition_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/order_custom_attribute_definition_visible_updated_event.py b/src/square/requests/order_custom_attribute_definition_visible_updated_event.py index 9ba42791..d7f4bc23 100644 --- a/src/square/requests/order_custom_attribute_definition_visible_updated_event.py +++ b/src/square/requests/order_custom_attribute_definition_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventDataParams diff --git a/src/square/requests/order_custom_attribute_owned_deleted_event.py b/src/square/requests/order_custom_attribute_owned_deleted_event.py index 7b1388a9..c8ccf980 100644 --- a/src/square/requests/order_custom_attribute_owned_deleted_event.py +++ b/src/square/requests/order_custom_attribute_owned_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/order_custom_attribute_owned_updated_event.py b/src/square/requests/order_custom_attribute_owned_updated_event.py index 8827f3b1..a25313c7 100644 --- a/src/square/requests/order_custom_attribute_owned_updated_event.py +++ b/src/square/requests/order_custom_attribute_owned_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/order_custom_attribute_visible_deleted_event.py b/src/square/requests/order_custom_attribute_visible_deleted_event.py index ed93a0bf..d7c52b8b 100644 --- a/src/square/requests/order_custom_attribute_visible_deleted_event.py +++ b/src/square/requests/order_custom_attribute_visible_deleted_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/order_custom_attribute_visible_updated_event.py b/src/square/requests/order_custom_attribute_visible_updated_event.py index 42919b5a..06916fa6 100644 --- a/src/square/requests/order_custom_attribute_visible_updated_event.py +++ b/src/square/requests/order_custom_attribute_visible_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .custom_attribute_event_data import CustomAttributeEventDataParams diff --git a/src/square/requests/order_entry.py b/src/square/requests/order_entry.py index f98d2f51..5982eff4 100644 --- a/src/square/requests/order_entry.py +++ b/src/square/requests/order_entry.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class OrderEntryParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_fulfillment_updated.py b/src/square/requests/order_fulfillment_updated.py index 002b2315..47272d19 100644 --- a/src/square/requests/order_fulfillment_updated.py +++ b/src/square/requests/order_fulfillment_updated.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.order_state import OrderState from .order_fulfillment_updated_update import OrderFulfillmentUpdatedUpdateParams diff --git a/src/square/requests/order_fulfillment_updated_event.py b/src/square/requests/order_fulfillment_updated_event.py index 5acbb141..ea67f17a 100644 --- a/src/square/requests/order_fulfillment_updated_event.py +++ b/src/square/requests/order_fulfillment_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_fulfillment_updated_event_data import OrderFulfillmentUpdatedEventDataParams diff --git a/src/square/requests/order_fulfillment_updated_event_data.py b/src/square/requests/order_fulfillment_updated_event_data.py index 887e886c..8b741cb7 100644 --- a/src/square/requests/order_fulfillment_updated_event_data.py +++ b/src/square/requests/order_fulfillment_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_fulfillment_updated_object import OrderFulfillmentUpdatedObjectParams diff --git a/src/square/requests/order_fulfillment_updated_object.py b/src/square/requests/order_fulfillment_updated_object.py index 94b5a27a..16d2f554 100644 --- a/src/square/requests/order_fulfillment_updated_object.py +++ b/src/square/requests/order_fulfillment_updated_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .order_fulfillment_updated import OrderFulfillmentUpdatedParams diff --git a/src/square/requests/order_fulfillment_updated_update.py b/src/square/requests/order_fulfillment_updated_update.py index 808104f3..f0698b1a 100644 --- a/src/square/requests/order_fulfillment_updated_update.py +++ b/src/square/requests/order_fulfillment_updated_update.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.fulfillment_state import FulfillmentState diff --git a/src/square/requests/order_line_item.py b/src/square/requests/order_line_item.py index 8a19c25c..b73d0b0e 100644 --- a/src/square/requests/order_line_item.py +++ b/src/square/requests/order_line_item.py @@ -1,16 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .order_quantity_unit import OrderQuantityUnitParams from ..types.order_line_item_item_type import OrderLineItemItemType -from .money import MoneyParams +from .order_line_item_modifier import OrderLineItemModifierParams +from .order_line_item_applied_tax import OrderLineItemAppliedTaxParams from .order_line_item_applied_discount import OrderLineItemAppliedDiscountParams from .order_line_item_applied_service_charge import OrderLineItemAppliedServiceChargeParams -from .order_line_item_applied_tax import OrderLineItemAppliedTaxParams -from .order_line_item_modifier import OrderLineItemModifierParams +from .money import MoneyParams from .order_line_item_pricing_blocklists import OrderLineItemPricingBlocklistsParams -from .order_quantity_unit import OrderQuantityUnitParams class OrderLineItemParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_line_item_applied_discount.py b/src/square/requests/order_line_item_applied_discount.py index 01f68225..65846c1c 100644 --- a/src/square/requests/order_line_item_applied_discount.py +++ b/src/square/requests/order_line_item_applied_discount.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_line_item_applied_service_charge.py b/src/square/requests/order_line_item_applied_service_charge.py index 110c2e15..831fd65f 100644 --- a/src/square/requests/order_line_item_applied_service_charge.py +++ b/src/square/requests/order_line_item_applied_service_charge.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_line_item_applied_tax.py b/src/square/requests/order_line_item_applied_tax.py index ede2bf53..9ad533be 100644 --- a/src/square/requests/order_line_item_applied_tax.py +++ b/src/square/requests/order_line_item_applied_tax.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_line_item_discount.py b/src/square/requests/order_line_item_discount.py index efdd4291..2e16566d 100644 --- a/src/square/requests/order_line_item_discount.py +++ b/src/square/requests/order_line_item_discount.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_line_item_discount_scope import OrderLineItemDiscountScope +import typing_extensions +import typing from ..types.order_line_item_discount_type import OrderLineItemDiscountType from .money import MoneyParams +from ..types.order_line_item_discount_scope import OrderLineItemDiscountScope class OrderLineItemDiscountParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_line_item_modifier.py b/src/square/requests/order_line_item_modifier.py index 6b7f922c..01e024b2 100644 --- a/src/square/requests/order_line_item_modifier.py +++ b/src/square/requests/order_line_item_modifier.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_line_item_pricing_blocklists.py b/src/square/requests/order_line_item_pricing_blocklists.py index 4dcd7cbf..fb3b6373 100644 --- a/src/square/requests/order_line_item_pricing_blocklists.py +++ b/src/square/requests/order_line_item_pricing_blocklists.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_line_item_pricing_blocklists_blocked_discount import OrderLineItemPricingBlocklistsBlockedDiscountParams from .order_line_item_pricing_blocklists_blocked_tax import OrderLineItemPricingBlocklistsBlockedTaxParams diff --git a/src/square/requests/order_line_item_pricing_blocklists_blocked_discount.py b/src/square/requests/order_line_item_pricing_blocklists_blocked_discount.py index b3cac7d6..b957c317 100644 --- a/src/square/requests/order_line_item_pricing_blocklists_blocked_discount.py +++ b/src/square/requests/order_line_item_pricing_blocklists_blocked_discount.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class OrderLineItemPricingBlocklistsBlockedDiscountParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_line_item_pricing_blocklists_blocked_tax.py b/src/square/requests/order_line_item_pricing_blocklists_blocked_tax.py index c5124e67..8b18190a 100644 --- a/src/square/requests/order_line_item_pricing_blocklists_blocked_tax.py +++ b/src/square/requests/order_line_item_pricing_blocklists_blocked_tax.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class OrderLineItemPricingBlocklistsBlockedTaxParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_line_item_tax.py b/src/square/requests/order_line_item_tax.py index 0fe1fba8..025eefc1 100644 --- a/src/square/requests/order_line_item_tax.py +++ b/src/square/requests/order_line_item_tax.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_line_item_tax_scope import OrderLineItemTaxScope +import typing_extensions +import typing from ..types.order_line_item_tax_type import OrderLineItemTaxType from .money import MoneyParams +from ..types.order_line_item_tax_scope import OrderLineItemTaxScope class OrderLineItemTaxParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_money_amounts.py b/src/square/requests/order_money_amounts.py index 1861406f..33c1ac38 100644 --- a/src/square/requests/order_money_amounts.py +++ b/src/square/requests/order_money_amounts.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .money import MoneyParams diff --git a/src/square/requests/order_pricing_options.py b/src/square/requests/order_pricing_options.py index 9b0a67d1..e8e539fd 100644 --- a/src/square/requests/order_pricing_options.py +++ b/src/square/requests/order_pricing_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class OrderPricingOptionsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_quantity_unit.py b/src/square/requests/order_quantity_unit.py index e64f2c30..cbc71bc6 100644 --- a/src/square/requests/order_quantity_unit.py +++ b/src/square/requests/order_quantity_unit.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .measurement_unit import MeasurementUnitParams +import typing class OrderQuantityUnitParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_return.py b/src/square/requests/order_return.py index add4328c..7b08d29d 100644 --- a/src/square/requests/order_return.py +++ b/src/square/requests/order_return.py @@ -1,15 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .order_money_amounts import OrderMoneyAmountsParams -from .order_return_discount import OrderReturnDiscountParams +import typing_extensions +import typing from .order_return_line_item import OrderReturnLineItemParams from .order_return_service_charge import OrderReturnServiceChargeParams from .order_return_tax import OrderReturnTaxParams +from .order_return_discount import OrderReturnDiscountParams from .order_return_tip import OrderReturnTipParams from .order_rounding_adjustment import OrderRoundingAdjustmentParams +from .order_money_amounts import OrderMoneyAmountsParams class OrderReturnParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_return_discount.py b/src/square/requests/order_return_discount.py index f9687933..341223fc 100644 --- a/src/square/requests/order_return_discount.py +++ b/src/square/requests/order_return_discount.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_line_item_discount_scope import OrderLineItemDiscountScope +import typing_extensions +import typing from ..types.order_line_item_discount_type import OrderLineItemDiscountType from .money import MoneyParams +from ..types.order_line_item_discount_scope import OrderLineItemDiscountScope class OrderReturnDiscountParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_return_line_item.py b/src/square/requests/order_return_line_item.py index 3159ae67..18505b2e 100644 --- a/src/square/requests/order_return_line_item.py +++ b/src/square/requests/order_return_line_item.py @@ -1,15 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .order_quantity_unit import OrderQuantityUnitParams from ..types.order_line_item_item_type import OrderLineItemItemType -from .money import MoneyParams +from .order_return_line_item_modifier import OrderReturnLineItemModifierParams +from .order_line_item_applied_tax import OrderLineItemAppliedTaxParams from .order_line_item_applied_discount import OrderLineItemAppliedDiscountParams +from .money import MoneyParams from .order_line_item_applied_service_charge import OrderLineItemAppliedServiceChargeParams -from .order_line_item_applied_tax import OrderLineItemAppliedTaxParams -from .order_quantity_unit import OrderQuantityUnitParams -from .order_return_line_item_modifier import OrderReturnLineItemModifierParams class OrderReturnLineItemParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_return_line_item_modifier.py b/src/square/requests/order_return_line_item_modifier.py index 663a207e..2efce772 100644 --- a/src/square/requests/order_return_line_item_modifier.py +++ b/src/square/requests/order_return_line_item_modifier.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_return_service_charge.py b/src/square/requests/order_return_service_charge.py index c3b72a5e..2e8e538c 100644 --- a/src/square/requests/order_return_service_charge.py +++ b/src/square/requests/order_return_service_charge.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_service_charge_calculation_phase import OrderServiceChargeCalculationPhase -from ..types.order_service_charge_scope import OrderServiceChargeScope -from ..types.order_service_charge_treatment_type import OrderServiceChargeTreatmentType +import typing_extensions +import typing from .money import MoneyParams +from ..types.order_service_charge_calculation_phase import OrderServiceChargeCalculationPhase from .order_line_item_applied_tax import OrderLineItemAppliedTaxParams +from ..types.order_service_charge_treatment_type import OrderServiceChargeTreatmentType +from ..types.order_service_charge_scope import OrderServiceChargeScope class OrderReturnServiceChargeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_return_tax.py b/src/square/requests/order_return_tax.py index 563f4567..1b5e059a 100644 --- a/src/square/requests/order_return_tax.py +++ b/src/square/requests/order_return_tax.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_line_item_tax_scope import OrderLineItemTaxScope +import typing_extensions +import typing from ..types.order_line_item_tax_type import OrderLineItemTaxType from .money import MoneyParams +from ..types.order_line_item_tax_scope import OrderLineItemTaxScope class OrderReturnTaxParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_return_tip.py b/src/square/requests/order_return_tip.py index 66332d23..d567b10c 100644 --- a/src/square/requests/order_return_tip.py +++ b/src/square/requests/order_return_tip.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_rounding_adjustment.py b/src/square/requests/order_rounding_adjustment.py index e1ef6558..8cff0218 100644 --- a/src/square/requests/order_rounding_adjustment.py +++ b/src/square/requests/order_rounding_adjustment.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/order_service_charge.py b/src/square/requests/order_service_charge.py index 9355890f..28042c33 100644 --- a/src/square/requests/order_service_charge.py +++ b/src/square/requests/order_service_charge.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.order_service_charge_calculation_phase import OrderServiceChargeCalculationPhase -from ..types.order_service_charge_scope import OrderServiceChargeScope -from ..types.order_service_charge_treatment_type import OrderServiceChargeTreatmentType -from ..types.order_service_charge_type import OrderServiceChargeType +import typing_extensions +import typing from .money import MoneyParams +from ..types.order_service_charge_calculation_phase import OrderServiceChargeCalculationPhase from .order_line_item_applied_tax import OrderLineItemAppliedTaxParams +from ..types.order_service_charge_type import OrderServiceChargeType +from ..types.order_service_charge_treatment_type import OrderServiceChargeTreatmentType +from ..types.order_service_charge_scope import OrderServiceChargeScope class OrderServiceChargeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_source.py b/src/square/requests/order_source.py index 85509e53..74f6e7e3 100644 --- a/src/square/requests/order_source.py +++ b/src/square/requests/order_source.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class OrderSourceParams(typing_extensions.TypedDict): diff --git a/src/square/requests/order_updated.py b/src/square/requests/order_updated.py index d999a84c..b165a746 100644 --- a/src/square/requests/order_updated.py +++ b/src/square/requests/order_updated.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.order_state import OrderState diff --git a/src/square/requests/order_updated_event.py b/src/square/requests/order_updated_event.py index 50e3f125..745780d7 100644 --- a/src/square/requests/order_updated_event.py +++ b/src/square/requests/order_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_updated_event_data import OrderUpdatedEventDataParams diff --git a/src/square/requests/order_updated_event_data.py b/src/square/requests/order_updated_event_data.py index 0a55ffc9..ec24da9d 100644 --- a/src/square/requests/order_updated_event_data.py +++ b/src/square/requests/order_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .order_updated_object import OrderUpdatedObjectParams diff --git a/src/square/requests/order_updated_object.py b/src/square/requests/order_updated_object.py index 91d3be8c..d4461d24 100644 --- a/src/square/requests/order_updated_object.py +++ b/src/square/requests/order_updated_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .order_updated import OrderUpdatedParams diff --git a/src/square/requests/pause_subscription_response.py b/src/square/requests/pause_subscription_response.py index 5a0ed6ad..acc74d82 100644 --- a/src/square/requests/pause_subscription_response.py +++ b/src/square/requests/pause_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams from .subscription_action import SubscriptionActionParams diff --git a/src/square/requests/pay_order_response.py b/src/square/requests/pay_order_response.py index a02cbe52..aed21b54 100644 --- a/src/square/requests/pay_order_response.py +++ b/src/square/requests/pay_order_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .order import OrderParams diff --git a/src/square/requests/payment.py b/src/square/requests/payment.py index c0c5979e..a274d9f4 100644 --- a/src/square/requests/payment.py +++ b/src/square/requests/payment.py @@ -1,22 +1,22 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .address import AddressParams -from .application_details import ApplicationDetailsParams -from .bank_account_payment_details import BankAccountPaymentDetailsParams -from .buy_now_pay_later_details import BuyNowPayLaterDetailsParams +import typing_extensions +from .money import MoneyParams +import typing +from .processing_fee import ProcessingFeeParams from .card_payment_details import CardPaymentDetailsParams from .cash_payment_details import CashPaymentDetailsParams -from .device_details import DeviceDetailsParams -from .digital_wallet_details import DigitalWalletDetailsParams +from .bank_account_payment_details import BankAccountPaymentDetailsParams from .external_payment_details import ExternalPaymentDetailsParams -from .money import MoneyParams -from .offline_payment_details import OfflinePaymentDetailsParams -from .processing_fee import ProcessingFeeParams -from .risk_evaluation import RiskEvaluationParams +from .digital_wallet_details import DigitalWalletDetailsParams +from .buy_now_pay_later_details import BuyNowPayLaterDetailsParams from .square_account_details import SquareAccountDetailsParams +from .risk_evaluation import RiskEvaluationParams +from .address import AddressParams +from .device_details import DeviceDetailsParams +from .application_details import ApplicationDetailsParams +from .offline_payment_details import OfflinePaymentDetailsParams class PaymentParams(typing_extensions.TypedDict): @@ -50,9 +50,7 @@ class PaymentParams(typing_extensions.TypedDict): tip_money: typing_extensions.NotRequired[MoneyParams] """ - The amount designated as a tip for the seller's staff. - - Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges. + The amount designated as a tip. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see diff --git a/src/square/requests/payment_balance_activity_app_fee_refund_detail.py b/src/square/requests/payment_balance_activity_app_fee_refund_detail.py index c67b8f9c..22905824 100644 --- a/src/square/requests/payment_balance_activity_app_fee_refund_detail.py +++ b/src/square/requests/payment_balance_activity_app_fee_refund_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityAppFeeRefundDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_app_fee_revenue_detail.py b/src/square/requests/payment_balance_activity_app_fee_revenue_detail.py index 8e38d6d4..45c421b3 100644 --- a/src/square/requests/payment_balance_activity_app_fee_revenue_detail.py +++ b/src/square/requests/payment_balance_activity_app_fee_revenue_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityAppFeeRevenueDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_automatic_savings_detail.py b/src/square/requests/payment_balance_activity_automatic_savings_detail.py index 270d71de..77a35b4b 100644 --- a/src/square/requests/payment_balance_activity_automatic_savings_detail.py +++ b/src/square/requests/payment_balance_activity_automatic_savings_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityAutomaticSavingsDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_automatic_savings_reversed_detail.py b/src/square/requests/payment_balance_activity_automatic_savings_reversed_detail.py index e4b6e479..43f422a3 100644 --- a/src/square/requests/payment_balance_activity_automatic_savings_reversed_detail.py +++ b/src/square/requests/payment_balance_activity_automatic_savings_reversed_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityAutomaticSavingsReversedDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_charge_detail.py b/src/square/requests/payment_balance_activity_charge_detail.py index b25f3a33..1104fe0f 100644 --- a/src/square/requests/payment_balance_activity_charge_detail.py +++ b/src/square/requests/payment_balance_activity_charge_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityChargeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_deposit_fee_detail.py b/src/square/requests/payment_balance_activity_deposit_fee_detail.py index e432bedc..5b06cdc1 100644 --- a/src/square/requests/payment_balance_activity_deposit_fee_detail.py +++ b/src/square/requests/payment_balance_activity_deposit_fee_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityDepositFeeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_deposit_fee_reversed_detail.py b/src/square/requests/payment_balance_activity_deposit_fee_reversed_detail.py index 9d7aec6d..e33eca45 100644 --- a/src/square/requests/payment_balance_activity_deposit_fee_reversed_detail.py +++ b/src/square/requests/payment_balance_activity_deposit_fee_reversed_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityDepositFeeReversedDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_dispute_detail.py b/src/square/requests/payment_balance_activity_dispute_detail.py index 2c3cee7a..4cb66a20 100644 --- a/src/square/requests/payment_balance_activity_dispute_detail.py +++ b/src/square/requests/payment_balance_activity_dispute_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityDisputeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_fee_detail.py b/src/square/requests/payment_balance_activity_fee_detail.py index bc480d9f..51b97e58 100644 --- a/src/square/requests/payment_balance_activity_fee_detail.py +++ b/src/square/requests/payment_balance_activity_fee_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityFeeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_free_processing_detail.py b/src/square/requests/payment_balance_activity_free_processing_detail.py index f2e0fef4..59908278 100644 --- a/src/square/requests/payment_balance_activity_free_processing_detail.py +++ b/src/square/requests/payment_balance_activity_free_processing_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityFreeProcessingDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_hold_adjustment_detail.py b/src/square/requests/payment_balance_activity_hold_adjustment_detail.py index 876e69a0..8b4d729c 100644 --- a/src/square/requests/payment_balance_activity_hold_adjustment_detail.py +++ b/src/square/requests/payment_balance_activity_hold_adjustment_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityHoldAdjustmentDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_open_dispute_detail.py b/src/square/requests/payment_balance_activity_open_dispute_detail.py index b33929f3..2be98265 100644 --- a/src/square/requests/payment_balance_activity_open_dispute_detail.py +++ b/src/square/requests/payment_balance_activity_open_dispute_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityOpenDisputeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_other_adjustment_detail.py b/src/square/requests/payment_balance_activity_other_adjustment_detail.py index 9ab0e5cb..ce35d891 100644 --- a/src/square/requests/payment_balance_activity_other_adjustment_detail.py +++ b/src/square/requests/payment_balance_activity_other_adjustment_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityOtherAdjustmentDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_other_detail.py b/src/square/requests/payment_balance_activity_other_detail.py index acefe170..630e23da 100644 --- a/src/square/requests/payment_balance_activity_other_detail.py +++ b/src/square/requests/payment_balance_activity_other_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityOtherDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_refund_detail.py b/src/square/requests/payment_balance_activity_refund_detail.py index e19ad8c0..0f8b1f90 100644 --- a/src/square/requests/payment_balance_activity_refund_detail.py +++ b/src/square/requests/payment_balance_activity_refund_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityRefundDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_release_adjustment_detail.py b/src/square/requests/payment_balance_activity_release_adjustment_detail.py index ed4539d7..6b92f80f 100644 --- a/src/square/requests/payment_balance_activity_release_adjustment_detail.py +++ b/src/square/requests/payment_balance_activity_release_adjustment_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityReleaseAdjustmentDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_reserve_hold_detail.py b/src/square/requests/payment_balance_activity_reserve_hold_detail.py index 06090799..9a95d2f2 100644 --- a/src/square/requests/payment_balance_activity_reserve_hold_detail.py +++ b/src/square/requests/payment_balance_activity_reserve_hold_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityReserveHoldDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_reserve_release_detail.py b/src/square/requests/payment_balance_activity_reserve_release_detail.py index b856a48e..da039f70 100644 --- a/src/square/requests/payment_balance_activity_reserve_release_detail.py +++ b/src/square/requests/payment_balance_activity_reserve_release_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityReserveReleaseDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_square_capital_payment_detail.py b/src/square/requests/payment_balance_activity_square_capital_payment_detail.py index 56e0c8b4..0d96f731 100644 --- a/src/square/requests/payment_balance_activity_square_capital_payment_detail.py +++ b/src/square/requests/payment_balance_activity_square_capital_payment_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivitySquareCapitalPaymentDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_square_capital_reversed_payment_detail.py b/src/square/requests/payment_balance_activity_square_capital_reversed_payment_detail.py index c5a39613..37953dfe 100644 --- a/src/square/requests/payment_balance_activity_square_capital_reversed_payment_detail.py +++ b/src/square/requests/payment_balance_activity_square_capital_reversed_payment_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivitySquareCapitalReversedPaymentDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_square_payroll_transfer_detail.py b/src/square/requests/payment_balance_activity_square_payroll_transfer_detail.py index 3c23689d..968ecf17 100644 --- a/src/square/requests/payment_balance_activity_square_payroll_transfer_detail.py +++ b/src/square/requests/payment_balance_activity_square_payroll_transfer_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivitySquarePayrollTransferDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_square_payroll_transfer_reversed_detail.py b/src/square/requests/payment_balance_activity_square_payroll_transfer_reversed_detail.py index 3c06a6d7..43a75176 100644 --- a/src/square/requests/payment_balance_activity_square_payroll_transfer_reversed_detail.py +++ b/src/square/requests/payment_balance_activity_square_payroll_transfer_reversed_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivitySquarePayrollTransferReversedDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_tax_on_fee_detail.py b/src/square/requests/payment_balance_activity_tax_on_fee_detail.py index 2736da5b..3556955d 100644 --- a/src/square/requests/payment_balance_activity_tax_on_fee_detail.py +++ b/src/square/requests/payment_balance_activity_tax_on_fee_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityTaxOnFeeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_third_party_fee_detail.py b/src/square/requests/payment_balance_activity_third_party_fee_detail.py index 521fe12b..b0fd275b 100644 --- a/src/square/requests/payment_balance_activity_third_party_fee_detail.py +++ b/src/square/requests/payment_balance_activity_third_party_fee_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityThirdPartyFeeDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_balance_activity_third_party_fee_refund_detail.py b/src/square/requests/payment_balance_activity_third_party_fee_refund_detail.py index a2ff74f1..2a725fb3 100644 --- a/src/square/requests/payment_balance_activity_third_party_fee_refund_detail.py +++ b/src/square/requests/payment_balance_activity_third_party_fee_refund_detail.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PaymentBalanceActivityThirdPartyFeeRefundDetailParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_created_event.py b/src/square/requests/payment_created_event.py index 86af90ba..5945cfb6 100644 --- a/src/square/requests/payment_created_event.py +++ b/src/square/requests/payment_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payment_created_event_data import PaymentCreatedEventDataParams diff --git a/src/square/requests/payment_created_event_data.py b/src/square/requests/payment_created_event_data.py index d3ca19ad..0d2ed4a2 100644 --- a/src/square/requests/payment_created_event_data.py +++ b/src/square/requests/payment_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payment_created_event_object import PaymentCreatedEventObjectParams diff --git a/src/square/requests/payment_created_event_object.py b/src/square/requests/payment_created_event_object.py index 9bfa8c55..19fa5ca3 100644 --- a/src/square/requests/payment_created_event_object.py +++ b/src/square/requests/payment_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payment import PaymentParams diff --git a/src/square/requests/payment_link.py b/src/square/requests/payment_link.py index c01de1f1..6397f6b7 100644 --- a/src/square/requests/payment_link.py +++ b/src/square/requests/payment_link.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .checkout_options import CheckoutOptionsParams from .pre_populated_data import PrePopulatedDataParams diff --git a/src/square/requests/payment_link_related_resources.py b/src/square/requests/payment_link_related_resources.py index c56ef728..f30988b9 100644 --- a/src/square/requests/payment_link_related_resources.py +++ b/src/square/requests/payment_link_related_resources.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .order import OrderParams +from .catalog_object import CatalogObjectParams class PaymentLinkRelatedResourcesParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payment_options.py b/src/square/requests/payment_options.py index cb119bd7..67a5eec5 100644 --- a/src/square/requests/payment_options.py +++ b/src/square/requests/payment_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.payment_options_delay_action import PaymentOptionsDelayAction diff --git a/src/square/requests/payment_refund.py b/src/square/requests/payment_refund.py index 6eb94635..bb865ffe 100644 --- a/src/square/requests/payment_refund.py +++ b/src/square/requests/payment_refund.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .destination_details import DestinationDetailsParams from .money import MoneyParams from .processing_fee import ProcessingFeeParams diff --git a/src/square/requests/payment_updated_event.py b/src/square/requests/payment_updated_event.py index 4ab820fb..b2f90225 100644 --- a/src/square/requests/payment_updated_event.py +++ b/src/square/requests/payment_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payment_updated_event_data import PaymentUpdatedEventDataParams diff --git a/src/square/requests/payment_updated_event_data.py b/src/square/requests/payment_updated_event_data.py index c43d5136..1ebeb8c7 100644 --- a/src/square/requests/payment_updated_event_data.py +++ b/src/square/requests/payment_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payment_updated_event_object import PaymentUpdatedEventObjectParams diff --git a/src/square/requests/payment_updated_event_object.py b/src/square/requests/payment_updated_event_object.py index 8351e9bd..451ef729 100644 --- a/src/square/requests/payment_updated_event_object.py +++ b/src/square/requests/payment_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payment import PaymentParams diff --git a/src/square/requests/payout.py b/src/square/requests/payout.py index 901d1504..36bff55c 100644 --- a/src/square/requests/payout.py +++ b/src/square/requests/payout.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.payout_status import PayoutStatus -from ..types.payout_type import PayoutType -from .destination import DestinationParams from .money import MoneyParams +from .destination import DestinationParams +from ..types.payout_type import PayoutType +import typing from .payout_fee import PayoutFeeParams diff --git a/src/square/requests/payout_entry.py b/src/square/requests/payout_entry.py index 1acb9fa9..58d33b09 100644 --- a/src/square/requests/payout_entry.py +++ b/src/square/requests/payout_entry.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.activity_type import ActivityType from .money import MoneyParams -from .payment_balance_activity_app_fee_refund_detail import PaymentBalanceActivityAppFeeRefundDetailParams from .payment_balance_activity_app_fee_revenue_detail import PaymentBalanceActivityAppFeeRevenueDetailParams +from .payment_balance_activity_app_fee_refund_detail import PaymentBalanceActivityAppFeeRefundDetailParams from .payment_balance_activity_automatic_savings_detail import PaymentBalanceActivityAutomaticSavingsDetailParams from .payment_balance_activity_automatic_savings_reversed_detail import ( PaymentBalanceActivityAutomaticSavingsReversedDetailParams, @@ -19,8 +19,8 @@ from .payment_balance_activity_free_processing_detail import PaymentBalanceActivityFreeProcessingDetailParams from .payment_balance_activity_hold_adjustment_detail import PaymentBalanceActivityHoldAdjustmentDetailParams from .payment_balance_activity_open_dispute_detail import PaymentBalanceActivityOpenDisputeDetailParams -from .payment_balance_activity_other_adjustment_detail import PaymentBalanceActivityOtherAdjustmentDetailParams from .payment_balance_activity_other_detail import PaymentBalanceActivityOtherDetailParams +from .payment_balance_activity_other_adjustment_detail import PaymentBalanceActivityOtherAdjustmentDetailParams from .payment_balance_activity_refund_detail import PaymentBalanceActivityRefundDetailParams from .payment_balance_activity_release_adjustment_detail import PaymentBalanceActivityReleaseAdjustmentDetailParams from .payment_balance_activity_reserve_hold_detail import PaymentBalanceActivityReserveHoldDetailParams @@ -31,17 +31,17 @@ from .payment_balance_activity_square_capital_reversed_payment_detail import ( PaymentBalanceActivitySquareCapitalReversedPaymentDetailParams, ) +from .payment_balance_activity_tax_on_fee_detail import PaymentBalanceActivityTaxOnFeeDetailParams +from .payment_balance_activity_third_party_fee_detail import PaymentBalanceActivityThirdPartyFeeDetailParams +from .payment_balance_activity_third_party_fee_refund_detail import ( + PaymentBalanceActivityThirdPartyFeeRefundDetailParams, +) from .payment_balance_activity_square_payroll_transfer_detail import ( PaymentBalanceActivitySquarePayrollTransferDetailParams, ) from .payment_balance_activity_square_payroll_transfer_reversed_detail import ( PaymentBalanceActivitySquarePayrollTransferReversedDetailParams, ) -from .payment_balance_activity_tax_on_fee_detail import PaymentBalanceActivityTaxOnFeeDetailParams -from .payment_balance_activity_third_party_fee_detail import PaymentBalanceActivityThirdPartyFeeDetailParams -from .payment_balance_activity_third_party_fee_refund_detail import ( - PaymentBalanceActivityThirdPartyFeeRefundDetailParams, -) class PayoutEntryParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payout_failed_event.py b/src/square/requests/payout_failed_event.py index 115e590e..eb397fd7 100644 --- a/src/square/requests/payout_failed_event.py +++ b/src/square/requests/payout_failed_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payout_failed_event_data import PayoutFailedEventDataParams diff --git a/src/square/requests/payout_failed_event_data.py b/src/square/requests/payout_failed_event_data.py index 23c47547..a83065af 100644 --- a/src/square/requests/payout_failed_event_data.py +++ b/src/square/requests/payout_failed_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payout_failed_event_object import PayoutFailedEventObjectParams diff --git a/src/square/requests/payout_failed_event_object.py b/src/square/requests/payout_failed_event_object.py index 3d792a28..0cc55f75 100644 --- a/src/square/requests/payout_failed_event_object.py +++ b/src/square/requests/payout_failed_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payout import PayoutParams diff --git a/src/square/requests/payout_fee.py b/src/square/requests/payout_fee.py index 3c7acc4e..ae5d9682 100644 --- a/src/square/requests/payout_fee.py +++ b/src/square/requests/payout_fee.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.payout_fee_type import PayoutFeeType +import typing_extensions from .money import MoneyParams +import typing +from ..types.payout_fee_type import PayoutFeeType class PayoutFeeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/payout_paid_event.py b/src/square/requests/payout_paid_event.py index 9ab52c4e..99100176 100644 --- a/src/square/requests/payout_paid_event.py +++ b/src/square/requests/payout_paid_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payout_paid_event_data import PayoutPaidEventDataParams diff --git a/src/square/requests/payout_paid_event_data.py b/src/square/requests/payout_paid_event_data.py index d459d6c5..ecf1bb71 100644 --- a/src/square/requests/payout_paid_event_data.py +++ b/src/square/requests/payout_paid_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payout_paid_event_object import PayoutPaidEventObjectParams diff --git a/src/square/requests/payout_paid_event_object.py b/src/square/requests/payout_paid_event_object.py index 92e4d2d9..3445d94d 100644 --- a/src/square/requests/payout_paid_event_object.py +++ b/src/square/requests/payout_paid_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payout import PayoutParams diff --git a/src/square/requests/payout_sent_event.py b/src/square/requests/payout_sent_event.py index fe2e96c1..51fbfc57 100644 --- a/src/square/requests/payout_sent_event.py +++ b/src/square/requests/payout_sent_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payout_sent_event_data import PayoutSentEventDataParams diff --git a/src/square/requests/payout_sent_event_data.py b/src/square/requests/payout_sent_event_data.py index 0a5cd8a1..7d7ce1ab 100644 --- a/src/square/requests/payout_sent_event_data.py +++ b/src/square/requests/payout_sent_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .payout_sent_event_object import PayoutSentEventObjectParams diff --git a/src/square/requests/payout_sent_event_object.py b/src/square/requests/payout_sent_event_object.py index a711be55..3b1897ab 100644 --- a/src/square/requests/payout_sent_event_object.py +++ b/src/square/requests/payout_sent_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payout import PayoutParams diff --git a/src/square/requests/phase.py b/src/square/requests/phase.py index 72d15cb9..80d3ffb6 100644 --- a/src/square/requests/phase.py +++ b/src/square/requests/phase.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PhaseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/phase_input.py b/src/square/requests/phase_input.py index 6ee11a09..4c36efb1 100644 --- a/src/square/requests/phase_input.py +++ b/src/square/requests/phase_input.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class PhaseInputParams(typing_extensions.TypedDict): diff --git a/src/square/requests/pre_populated_data.py b/src/square/requests/pre_populated_data.py index 74ae95ae..379e57b4 100644 --- a/src/square/requests/pre_populated_data.py +++ b/src/square/requests/pre_populated_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .address import AddressParams diff --git a/src/square/requests/processing_fee.py b/src/square/requests/processing_fee.py index 6e6a0be5..34c7c7e0 100644 --- a/src/square/requests/processing_fee.py +++ b/src/square/requests/processing_fee.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/publish_invoice_response.py b/src/square/requests/publish_invoice_response.py index 61ba6fae..e2fe3b3b 100644 --- a/src/square/requests/publish_invoice_response.py +++ b/src/square/requests/publish_invoice_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .invoice import InvoiceParams +import typing +from .error import ErrorParams class PublishInvoiceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/publish_scheduled_shift_response.py b/src/square/requests/publish_scheduled_shift_response.py index d8e6fd77..f0c40497 100644 --- a/src/square/requests/publish_scheduled_shift_response.py +++ b/src/square/requests/publish_scheduled_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .scheduled_shift import ScheduledShiftParams +import typing +from .error import ErrorParams class PublishScheduledShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/range.py b/src/square/requests/range.py index b84e5a01..c4515928 100644 --- a/src/square/requests/range.py +++ b/src/square/requests/range.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class RangeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/receipt_options.py b/src/square/requests/receipt_options.py index 7392b861..4db5f4ed 100644 --- a/src/square/requests/receipt_options.py +++ b/src/square/requests/receipt_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class ReceiptOptionsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/receive_transfer_order_response.py b/src/square/requests/receive_transfer_order_response.py deleted file mode 100644 index 2415cca1..00000000 --- a/src/square/requests/receive_transfer_order_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class ReceiveTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response for receiving items for a transfer order - """ - - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The updated transfer order - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/redeem_loyalty_reward_response.py b/src/square/requests/redeem_loyalty_reward_response.py index 8ec9b795..1047a1c1 100644 --- a/src/square/requests/redeem_loyalty_reward_response.py +++ b/src/square/requests/redeem_loyalty_reward_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_event import LoyaltyEventParams diff --git a/src/square/requests/reference.py b/src/square/requests/reference.py deleted file mode 100644 index aec6d062..00000000 --- a/src/square/requests/reference.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from ..types.reference_type import ReferenceType - - -class ReferenceParams(typing_extensions.TypedDict): - type: typing_extensions.NotRequired[ReferenceType] - """ - The type of entity a channel is associated with. - See [Type](#type-type) for possible values - """ - - id: typing_extensions.NotRequired[str] - """ - The id of the entity a channel is associated with. - """ diff --git a/src/square/requests/refund.py b/src/square/requests/refund.py index 8a87f027..c89921b3 100644 --- a/src/square/requests/refund.py +++ b/src/square/requests/refund.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .money import MoneyParams from ..types.refund_status import RefundStatus from .additional_recipient import AdditionalRecipientParams -from .money import MoneyParams class RefundParams(typing_extensions.TypedDict): diff --git a/src/square/requests/refund_created_event.py b/src/square/requests/refund_created_event.py index a0314a21..f38ade3c 100644 --- a/src/square/requests/refund_created_event.py +++ b/src/square/requests/refund_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .refund_created_event_data import RefundCreatedEventDataParams diff --git a/src/square/requests/refund_created_event_data.py b/src/square/requests/refund_created_event_data.py index d3e457bc..a2539d61 100644 --- a/src/square/requests/refund_created_event_data.py +++ b/src/square/requests/refund_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .refund_created_event_object import RefundCreatedEventObjectParams diff --git a/src/square/requests/refund_created_event_object.py b/src/square/requests/refund_created_event_object.py index 4c322bbf..70dfd0ee 100644 --- a/src/square/requests/refund_created_event_object.py +++ b/src/square/requests/refund_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payment_refund import PaymentRefundParams diff --git a/src/square/requests/refund_payment_response.py b/src/square/requests/refund_payment_response.py index ad7c43d8..bc6aa8cd 100644 --- a/src/square/requests/refund_payment_response.py +++ b/src/square/requests/refund_payment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_refund import PaymentRefundParams diff --git a/src/square/requests/refund_updated_event.py b/src/square/requests/refund_updated_event.py index 6710266b..d8a9b1f8 100644 --- a/src/square/requests/refund_updated_event.py +++ b/src/square/requests/refund_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .refund_updated_event_data import RefundUpdatedEventDataParams diff --git a/src/square/requests/refund_updated_event_data.py b/src/square/requests/refund_updated_event_data.py index 895cd4ac..cff7f6c8 100644 --- a/src/square/requests/refund_updated_event_data.py +++ b/src/square/requests/refund_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .refund_updated_event_object import RefundUpdatedEventObjectParams diff --git a/src/square/requests/refund_updated_event_object.py b/src/square/requests/refund_updated_event_object.py index 3e613f77..09bc7260 100644 --- a/src/square/requests/refund_updated_event_object.py +++ b/src/square/requests/refund_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .payment_refund import PaymentRefundParams diff --git a/src/square/requests/register_domain_response.py b/src/square/requests/register_domain_response.py index 44dd2885..7663b138 100644 --- a/src/square/requests/register_domain_response.py +++ b/src/square/requests/register_domain_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.register_domain_response_status import RegisterDomainResponseStatus +import typing_extensions +import typing from .error import ErrorParams +from ..types.register_domain_response_status import RegisterDomainResponseStatus class RegisterDomainResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/remove_group_from_customer_response.py b/src/square/requests/remove_group_from_customer_response.py index 9f0a7b82..dbe2f8cb 100644 --- a/src/square/requests/remove_group_from_customer_response.py +++ b/src/square/requests/remove_group_from_customer_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/resume_subscription_response.py b/src/square/requests/resume_subscription_response.py index fb8b9ee7..c71dadb1 100644 --- a/src/square/requests/resume_subscription_response.py +++ b/src/square/requests/resume_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams from .subscription_action import SubscriptionActionParams diff --git a/src/square/requests/retrieve_booking_custom_attribute_definition_response.py b/src/square/requests/retrieve_booking_custom_attribute_definition_response.py index 04a77de9..c53196cb 100644 --- a/src/square/requests/retrieve_booking_custom_attribute_definition_response.py +++ b/src/square/requests/retrieve_booking_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_booking_custom_attribute_response.py b/src/square/requests/retrieve_booking_custom_attribute_response.py index c15fd4b6..8a5b0d41 100644 --- a/src/square/requests/retrieve_booking_custom_attribute_response.py +++ b/src/square/requests/retrieve_booking_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_channel_response.py b/src/square/requests/retrieve_channel_response.py deleted file mode 100644 index 9ca6156a..00000000 --- a/src/square/requests/retrieve_channel_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .channel import ChannelParams -from .error import ErrorParams - - -class RetrieveChannelResponseParams(typing_extensions.TypedDict): - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Information about errors encountered during the request. - """ - - channel: typing_extensions.NotRequired[ChannelParams] - """ - The requested Channel. - """ diff --git a/src/square/requests/retrieve_job_response.py b/src/square/requests/retrieve_job_response.py index 284cf04c..b3f63846 100644 --- a/src/square/requests/retrieve_job_response.py +++ b/src/square/requests/retrieve_job_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .job import JobParams +import typing +from .error import ErrorParams class RetrieveJobResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/retrieve_location_booking_profile_response.py b/src/square/requests/retrieve_location_booking_profile_response.py index 40341b18..9f388db3 100644 --- a/src/square/requests/retrieve_location_booking_profile_response.py +++ b/src/square/requests/retrieve_location_booking_profile_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .location_booking_profile import LocationBookingProfileParams +import typing +from .error import ErrorParams class RetrieveLocationBookingProfileResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/retrieve_location_custom_attribute_definition_response.py b/src/square/requests/retrieve_location_custom_attribute_definition_response.py index 24768a4c..e1baac74 100644 --- a/src/square/requests/retrieve_location_custom_attribute_definition_response.py +++ b/src/square/requests/retrieve_location_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_location_custom_attribute_response.py b/src/square/requests/retrieve_location_custom_attribute_response.py index ed221409..3b9027d4 100644 --- a/src/square/requests/retrieve_location_custom_attribute_response.py +++ b/src/square/requests/retrieve_location_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_location_settings_response.py b/src/square/requests/retrieve_location_settings_response.py index 0761eb98..b9963397 100644 --- a/src/square/requests/retrieve_location_settings_response.py +++ b/src/square/requests/retrieve_location_settings_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .checkout_location_settings import CheckoutLocationSettingsParams +import typing_extensions +import typing from .error import ErrorParams +from .checkout_location_settings import CheckoutLocationSettingsParams class RetrieveLocationSettingsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/retrieve_merchant_custom_attribute_definition_response.py b/src/square/requests/retrieve_merchant_custom_attribute_definition_response.py index 9ce65497..d3716e5c 100644 --- a/src/square/requests/retrieve_merchant_custom_attribute_definition_response.py +++ b/src/square/requests/retrieve_merchant_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_merchant_custom_attribute_response.py b/src/square/requests/retrieve_merchant_custom_attribute_response.py index c908acd9..51e2276f 100644 --- a/src/square/requests/retrieve_merchant_custom_attribute_response.py +++ b/src/square/requests/retrieve_merchant_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_merchant_settings_response.py b/src/square/requests/retrieve_merchant_settings_response.py index 28d9f52f..59e93198 100644 --- a/src/square/requests/retrieve_merchant_settings_response.py +++ b/src/square/requests/retrieve_merchant_settings_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .checkout_merchant_settings import CheckoutMerchantSettingsParams +import typing_extensions +import typing from .error import ErrorParams +from .checkout_merchant_settings import CheckoutMerchantSettingsParams class RetrieveMerchantSettingsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/retrieve_order_custom_attribute_definition_response.py b/src/square/requests/retrieve_order_custom_attribute_definition_response.py index 5f40e98f..43dd63f9 100644 --- a/src/square/requests/retrieve_order_custom_attribute_definition_response.py +++ b/src/square/requests/retrieve_order_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_order_custom_attribute_response.py b/src/square/requests/retrieve_order_custom_attribute_response.py index c9c5f48c..5ec697b1 100644 --- a/src/square/requests/retrieve_order_custom_attribute_response.py +++ b/src/square/requests/retrieve_order_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_scheduled_shift_response.py b/src/square/requests/retrieve_scheduled_shift_response.py index 680fb0ac..55802966 100644 --- a/src/square/requests/retrieve_scheduled_shift_response.py +++ b/src/square/requests/retrieve_scheduled_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .scheduled_shift import ScheduledShiftParams +import typing +from .error import ErrorParams class RetrieveScheduledShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/retrieve_timecard_response.py b/src/square/requests/retrieve_timecard_response.py index 4386b02d..c67d22fc 100644 --- a/src/square/requests/retrieve_timecard_response.py +++ b/src/square/requests/retrieve_timecard_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .timecard import TimecardParams +import typing +from .error import ErrorParams class RetrieveTimecardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/retrieve_token_status_response.py b/src/square/requests/retrieve_token_status_response.py index 65beb01f..4c0dc37d 100644 --- a/src/square/requests/retrieve_token_status_response.py +++ b/src/square/requests/retrieve_token_status_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/retrieve_transfer_order_response.py b/src/square/requests/retrieve_transfer_order_response.py deleted file mode 100644 index 0eefb44e..00000000 --- a/src/square/requests/retrieve_transfer_order_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class RetrieveTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response containing the requested transfer order - """ - - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The requested transfer order - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/revoke_token_response.py b/src/square/requests/revoke_token_response.py index 35238e40..f6caf213 100644 --- a/src/square/requests/revoke_token_response.py +++ b/src/square/requests/revoke_token_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/risk_evaluation.py b/src/square/requests/risk_evaluation.py index b6a4dcc5..c46b8409 100644 --- a/src/square/requests/risk_evaluation.py +++ b/src/square/requests/risk_evaluation.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.risk_evaluation_risk_level import RiskEvaluationRiskLevel diff --git a/src/square/requests/save_card_options.py b/src/square/requests/save_card_options.py index 8d538494..21669437 100644 --- a/src/square/requests/save_card_options.py +++ b/src/square/requests/save_card_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SaveCardOptionsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/scheduled_shift.py b/src/square/requests/scheduled_shift.py index f8d8f3a4..3760247c 100644 --- a/src/square/requests/scheduled_shift.py +++ b/src/square/requests/scheduled_shift.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .scheduled_shift_details import ScheduledShiftDetailsParams diff --git a/src/square/requests/scheduled_shift_details.py b/src/square/requests/scheduled_shift_details.py index d57bcf4b..7ad70b97 100644 --- a/src/square/requests/scheduled_shift_details.py +++ b/src/square/requests/scheduled_shift_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class ScheduledShiftDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/scheduled_shift_filter.py b/src/square/requests/scheduled_shift_filter.py index 0e86e606..a3d89445 100644 --- a/src/square/requests/scheduled_shift_filter.py +++ b/src/square/requests/scheduled_shift_filter.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .time_range import TimeRangeParams +from .scheduled_shift_workday import ScheduledShiftWorkdayParams from ..types.scheduled_shift_filter_assignment_status import ScheduledShiftFilterAssignmentStatus from ..types.scheduled_shift_filter_scheduled_shift_status import ScheduledShiftFilterScheduledShiftStatus -from .scheduled_shift_workday import ScheduledShiftWorkdayParams -from .time_range import TimeRangeParams class ScheduledShiftFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/scheduled_shift_query.py b/src/square/requests/scheduled_shift_query.py index 3ee16b27..45a79375 100644 --- a/src/square/requests/scheduled_shift_query.py +++ b/src/square/requests/scheduled_shift_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .scheduled_shift_filter import ScheduledShiftFilterParams from .scheduled_shift_sort import ScheduledShiftSortParams diff --git a/src/square/requests/scheduled_shift_sort.py b/src/square/requests/scheduled_shift_sort.py index ba67fc8b..0f8df45b 100644 --- a/src/square/requests/scheduled_shift_sort.py +++ b/src/square/requests/scheduled_shift_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.scheduled_shift_sort_field import ScheduledShiftSortField from ..types.sort_order import SortOrder diff --git a/src/square/requests/scheduled_shift_workday.py b/src/square/requests/scheduled_shift_workday.py index 30b0abce..720473f2 100644 --- a/src/square/requests/scheduled_shift_workday.py +++ b/src/square/requests/scheduled_shift_workday.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.scheduled_shift_workday_matcher import ScheduledShiftWorkdayMatcher +import typing_extensions from .date_range import DateRangeParams +from ..types.scheduled_shift_workday_matcher import ScheduledShiftWorkdayMatcher +import typing class ScheduledShiftWorkdayParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_availability_filter.py b/src/square/requests/search_availability_filter.py index cedaa176..9b5f4891 100644 --- a/src/square/requests/search_availability_filter.py +++ b/src/square/requests/search_availability_filter.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .segment_filter import SegmentFilterParams from .time_range import TimeRangeParams +import typing_extensions +import typing +from .segment_filter import SegmentFilterParams class SearchAvailabilityFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_availability_response.py b/src/square/requests/search_availability_response.py index f33663dd..f9bae6a2 100644 --- a/src/square/requests/search_availability_response.py +++ b/src/square/requests/search_availability_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .availability import AvailabilityParams from .error import ErrorParams diff --git a/src/square/requests/search_catalog_items_response.py b/src/square/requests/search_catalog_items_response.py index 3134597b..e6fd0e23 100644 --- a/src/square/requests/search_catalog_items_response.py +++ b/src/square/requests/search_catalog_items_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class SearchCatalogItemsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_catalog_objects_response.py b/src/square/requests/search_catalog_objects_response.py index d63b322a..53c915a8 100644 --- a/src/square/requests/search_catalog_objects_response.py +++ b/src/square/requests/search_catalog_objects_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class SearchCatalogObjectsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_customers_response.py b/src/square/requests/search_customers_response.py index 57bca295..c63303c5 100644 --- a/src/square/requests/search_customers_response.py +++ b/src/square/requests/search_customers_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer import CustomerParams +import typing_extensions +import typing from .error import ErrorParams +from .customer import CustomerParams class SearchCustomersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_events_filter.py b/src/square/requests/search_events_filter.py index 7e84967e..ac74dd08 100644 --- a/src/square/requests/search_events_filter.py +++ b/src/square/requests/search_events_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .time_range import TimeRangeParams diff --git a/src/square/requests/search_events_query.py b/src/square/requests/search_events_query.py index 0fb0d526..331af398 100644 --- a/src/square/requests/search_events_query.py +++ b/src/square/requests/search_events_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .search_events_filter import SearchEventsFilterParams from .search_events_sort import SearchEventsSortParams diff --git a/src/square/requests/search_events_response.py b/src/square/requests/search_events_response.py index e2842fde..ebfbc4a3 100644 --- a/src/square/requests/search_events_response.py +++ b/src/square/requests/search_events_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .event import EventParams from .event_metadata import EventMetadataParams diff --git a/src/square/requests/search_events_sort.py b/src/square/requests/search_events_sort.py index 54702851..967fe5a0 100644 --- a/src/square/requests/search_events_sort.py +++ b/src/square/requests/search_events_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.search_events_sort_field import SearchEventsSortField from ..types.sort_order import SortOrder diff --git a/src/square/requests/search_invoices_response.py b/src/square/requests/search_invoices_response.py index 58f3da2f..79dba59a 100644 --- a/src/square/requests/search_invoices_response.py +++ b/src/square/requests/search_invoices_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .invoice import InvoiceParams +from .error import ErrorParams class SearchInvoicesResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_loyalty_accounts_request_loyalty_account_query.py b/src/square/requests/search_loyalty_accounts_request_loyalty_account_query.py index 519ac8f4..439ea77c 100644 --- a/src/square/requests/search_loyalty_accounts_request_loyalty_account_query.py +++ b/src/square/requests/search_loyalty_accounts_request_loyalty_account_query.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .loyalty_account_mapping import LoyaltyAccountMappingParams diff --git a/src/square/requests/search_loyalty_accounts_response.py b/src/square/requests/search_loyalty_accounts_response.py index f1ce95b8..17893705 100644 --- a/src/square/requests/search_loyalty_accounts_response.py +++ b/src/square/requests/search_loyalty_accounts_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_account import LoyaltyAccountParams diff --git a/src/square/requests/search_loyalty_events_response.py b/src/square/requests/search_loyalty_events_response.py index c9b0d376..f4467bcc 100644 --- a/src/square/requests/search_loyalty_events_response.py +++ b/src/square/requests/search_loyalty_events_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_event import LoyaltyEventParams diff --git a/src/square/requests/search_loyalty_rewards_request_loyalty_reward_query.py b/src/square/requests/search_loyalty_rewards_request_loyalty_reward_query.py index 7a9600ff..13ab21fd 100644 --- a/src/square/requests/search_loyalty_rewards_request_loyalty_reward_query.py +++ b/src/square/requests/search_loyalty_rewards_request_loyalty_reward_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.loyalty_reward_status import LoyaltyRewardStatus diff --git a/src/square/requests/search_loyalty_rewards_response.py b/src/square/requests/search_loyalty_rewards_response.py index ae5654f9..421260f0 100644 --- a/src/square/requests/search_loyalty_rewards_response.py +++ b/src/square/requests/search_loyalty_rewards_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .loyalty_reward import LoyaltyRewardParams diff --git a/src/square/requests/search_orders_customer_filter.py b/src/square/requests/search_orders_customer_filter.py index fa8c17e9..0cabb7a8 100644 --- a/src/square/requests/search_orders_customer_filter.py +++ b/src/square/requests/search_orders_customer_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SearchOrdersCustomerFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_orders_date_time_filter.py b/src/square/requests/search_orders_date_time_filter.py index 1d05dd0d..c2a66eba 100644 --- a/src/square/requests/search_orders_date_time_filter.py +++ b/src/square/requests/search_orders_date_time_filter.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .time_range import TimeRangeParams diff --git a/src/square/requests/search_orders_filter.py b/src/square/requests/search_orders_filter.py index cfecf6bb..793a2ae6 100644 --- a/src/square/requests/search_orders_filter.py +++ b/src/square/requests/search_orders_filter.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from .search_orders_customer_filter import SearchOrdersCustomerFilterParams +import typing_extensions +from .search_orders_state_filter import SearchOrdersStateFilterParams from .search_orders_date_time_filter import SearchOrdersDateTimeFilterParams from .search_orders_fulfillment_filter import SearchOrdersFulfillmentFilterParams from .search_orders_source_filter import SearchOrdersSourceFilterParams -from .search_orders_state_filter import SearchOrdersStateFilterParams +from .search_orders_customer_filter import SearchOrdersCustomerFilterParams class SearchOrdersFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_orders_fulfillment_filter.py b/src/square/requests/search_orders_fulfillment_filter.py index 9507c5ed..72449b18 100644 --- a/src/square/requests/search_orders_fulfillment_filter.py +++ b/src/square/requests/search_orders_fulfillment_filter.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.fulfillment_state import FulfillmentState +import typing_extensions +import typing from ..types.fulfillment_type import FulfillmentType +from ..types.fulfillment_state import FulfillmentState class SearchOrdersFulfillmentFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_orders_query.py b/src/square/requests/search_orders_query.py index 0c494a44..41f1f5f7 100644 --- a/src/square/requests/search_orders_query.py +++ b/src/square/requests/search_orders_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .search_orders_filter import SearchOrdersFilterParams from .search_orders_sort import SearchOrdersSortParams diff --git a/src/square/requests/search_orders_response.py b/src/square/requests/search_orders_response.py index f015c711..3ed5bb65 100644 --- a/src/square/requests/search_orders_response.py +++ b/src/square/requests/search_orders_response.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams -from .order import OrderParams +import typing_extensions +import typing from .order_entry import OrderEntryParams +from .order import OrderParams +from .error import ErrorParams class SearchOrdersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_orders_sort.py b/src/square/requests/search_orders_sort.py index 91ac512e..2efc3d85 100644 --- a/src/square/requests/search_orders_sort.py +++ b/src/square/requests/search_orders_sort.py @@ -2,6 +2,7 @@ import typing_extensions from ..types.search_orders_sort_field import SearchOrdersSortField +import typing_extensions from ..types.sort_order import SortOrder diff --git a/src/square/requests/search_orders_source_filter.py b/src/square/requests/search_orders_source_filter.py index 673d6535..05a8a92c 100644 --- a/src/square/requests/search_orders_source_filter.py +++ b/src/square/requests/search_orders_source_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SearchOrdersSourceFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_orders_state_filter.py b/src/square/requests/search_orders_state_filter.py index 914fd36f..e43825dc 100644 --- a/src/square/requests/search_orders_state_filter.py +++ b/src/square/requests/search_orders_state_filter.py @@ -1,8 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from ..types.order_state import OrderState diff --git a/src/square/requests/search_scheduled_shifts_response.py b/src/square/requests/search_scheduled_shifts_response.py index ff375f33..9e39b534 100644 --- a/src/square/requests/search_scheduled_shifts_response.py +++ b/src/square/requests/search_scheduled_shifts_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .scheduled_shift import ScheduledShiftParams +from .error import ErrorParams class SearchScheduledShiftsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_shifts_response.py b/src/square/requests/search_shifts_response.py index 846709cc..8ce6a38b 100644 --- a/src/square/requests/search_shifts_response.py +++ b/src/square/requests/search_shifts_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .shift import ShiftParams +from .error import ErrorParams class SearchShiftsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_subscriptions_filter.py b/src/square/requests/search_subscriptions_filter.py index 03019c96..32f4ec74 100644 --- a/src/square/requests/search_subscriptions_filter.py +++ b/src/square/requests/search_subscriptions_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SearchSubscriptionsFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_subscriptions_query.py b/src/square/requests/search_subscriptions_query.py index 67fd6978..b5c3e435 100644 --- a/src/square/requests/search_subscriptions_query.py +++ b/src/square/requests/search_subscriptions_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .search_subscriptions_filter import SearchSubscriptionsFilterParams diff --git a/src/square/requests/search_subscriptions_response.py b/src/square/requests/search_subscriptions_response.py index 1ec4ca52..e2489cc7 100644 --- a/src/square/requests/search_subscriptions_response.py +++ b/src/square/requests/search_subscriptions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams diff --git a/src/square/requests/search_team_members_filter.py b/src/square/requests/search_team_members_filter.py index 8b3303f0..ce7427f9 100644 --- a/src/square/requests/search_team_members_filter.py +++ b/src/square/requests/search_team_members_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.team_member_status import TeamMemberStatus diff --git a/src/square/requests/search_team_members_query.py b/src/square/requests/search_team_members_query.py index 04c65f8b..95965e03 100644 --- a/src/square/requests/search_team_members_query.py +++ b/src/square/requests/search_team_members_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .search_team_members_filter import SearchTeamMembersFilterParams diff --git a/src/square/requests/search_team_members_response.py b/src/square/requests/search_team_members_response.py index fba98de6..1db13d28 100644 --- a/src/square/requests/search_team_members_response.py +++ b/src/square/requests/search_team_members_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .team_member import TeamMemberParams +from .error import ErrorParams class SearchTeamMembersResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_terminal_actions_response.py b/src/square/requests/search_terminal_actions_response.py index fab186d7..66d3ceae 100644 --- a/src/square/requests/search_terminal_actions_response.py +++ b/src/square/requests/search_terminal_actions_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_action import TerminalActionParams diff --git a/src/square/requests/search_terminal_checkouts_response.py b/src/square/requests/search_terminal_checkouts_response.py index b256c4f0..85eb1317 100644 --- a/src/square/requests/search_terminal_checkouts_response.py +++ b/src/square/requests/search_terminal_checkouts_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/search_terminal_refunds_response.py b/src/square/requests/search_terminal_refunds_response.py index 294976fa..c578c273 100644 --- a/src/square/requests/search_terminal_refunds_response.py +++ b/src/square/requests/search_terminal_refunds_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/search_timecards_response.py b/src/square/requests/search_timecards_response.py index d5905093..aaba9b36 100644 --- a/src/square/requests/search_timecards_response.py +++ b/src/square/requests/search_timecards_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions +import typing from .timecard import TimecardParams +from .error import ErrorParams class SearchTimecardsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/search_transfer_orders_response.py b/src/square/requests/search_transfer_orders_response.py deleted file mode 100644 index 09440ec6..00000000 --- a/src/square/requests/search_transfer_orders_response.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class SearchTransferOrdersResponseParams(typing_extensions.TypedDict): - """ - Response for searching transfer orders - """ - - transfer_orders: typing_extensions.NotRequired[typing.Sequence[TransferOrderParams]] - """ - List of transfer orders matching the search criteria - """ - - cursor: typing_extensions.NotRequired[str] - """ - Pagination cursor for fetching the next page of results - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/search_vendors_request_filter.py b/src/square/requests/search_vendors_request_filter.py index 18bb6c48..9179f6d8 100644 --- a/src/square/requests/search_vendors_request_filter.py +++ b/src/square/requests/search_vendors_request_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.vendor_status import VendorStatus diff --git a/src/square/requests/search_vendors_request_sort.py b/src/square/requests/search_vendors_request_sort.py index fdbc5ab9..666ec42b 100644 --- a/src/square/requests/search_vendors_request_sort.py +++ b/src/square/requests/search_vendors_request_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.search_vendors_request_sort_field import SearchVendorsRequestSortField from ..types.sort_order import SortOrder diff --git a/src/square/requests/search_vendors_response.py b/src/square/requests/search_vendors_response.py index 1869dec9..1db5871d 100644 --- a/src/square/requests/search_vendors_response.py +++ b/src/square/requests/search_vendors_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .vendor import VendorParams diff --git a/src/square/requests/segment_filter.py b/src/square/requests/segment_filter.py index 8cc08b52..d1637315 100644 --- a/src/square/requests/segment_filter.py +++ b/src/square/requests/segment_filter.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .filter_value import FilterValueParams diff --git a/src/square/requests/select_options.py b/src/square/requests/select_options.py index facb038b..529f527c 100644 --- a/src/square/requests/select_options.py +++ b/src/square/requests/select_options.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing from .select_option import SelectOptionParams +import typing_extensions class SelectOptionsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/shift.py b/src/square/requests/shift.py index fbcb1412..5001354c 100644 --- a/src/square/requests/shift.py +++ b/src/square/requests/shift.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.shift_status import ShiftStatus +import typing_extensions +import typing +from .shift_wage import ShiftWageParams from .break_ import BreakParams +from ..types.shift_status import ShiftStatus from .money import MoneyParams -from .shift_wage import ShiftWageParams class ShiftParams(typing_extensions.TypedDict): diff --git a/src/square/requests/shift_filter.py b/src/square/requests/shift_filter.py index 3d7c3f32..d6839b8d 100644 --- a/src/square/requests/shift_filter.py +++ b/src/square/requests/shift_filter.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.shift_filter_status import ShiftFilterStatus -from .shift_workday import ShiftWorkdayParams from .time_range import TimeRangeParams +from .shift_workday import ShiftWorkdayParams class ShiftFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/shift_query.py b/src/square/requests/shift_query.py index 40437bbb..b008241d 100644 --- a/src/square/requests/shift_query.py +++ b/src/square/requests/shift_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .shift_filter import ShiftFilterParams from .shift_sort import ShiftSortParams diff --git a/src/square/requests/shift_sort.py b/src/square/requests/shift_sort.py index c2d5554f..aaba9888 100644 --- a/src/square/requests/shift_sort.py +++ b/src/square/requests/shift_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.shift_sort_field import ShiftSortField from ..types.sort_order import SortOrder diff --git a/src/square/requests/shift_wage.py b/src/square/requests/shift_wage.py index b73c05c3..90949121 100644 --- a/src/square/requests/shift_wage.py +++ b/src/square/requests/shift_wage.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/shift_workday.py b/src/square/requests/shift_workday.py index 88b06829..e52fae32 100644 --- a/src/square/requests/shift_workday.py +++ b/src/square/requests/shift_workday.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.shift_workday_matcher import ShiftWorkdayMatcher +import typing_extensions from .date_range import DateRangeParams +from ..types.shift_workday_matcher import ShiftWorkdayMatcher +import typing class ShiftWorkdayParams(typing_extensions.TypedDict): diff --git a/src/square/requests/shipping_fee.py b/src/square/requests/shipping_fee.py index 7a4c86c3..8eab3f4e 100644 --- a/src/square/requests/shipping_fee.py +++ b/src/square/requests/shipping_fee.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/signature_image.py b/src/square/requests/signature_image.py index 9d4e6b28..ceaa8beb 100644 --- a/src/square/requests/signature_image.py +++ b/src/square/requests/signature_image.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class SignatureImageParams(typing_extensions.TypedDict): diff --git a/src/square/requests/signature_options.py b/src/square/requests/signature_options.py index 3db0f39c..f7dcedfa 100644 --- a/src/square/requests/signature_options.py +++ b/src/square/requests/signature_options.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .signature_image import SignatureImageParams diff --git a/src/square/requests/site.py b/src/square/requests/site.py index 4ac251f5..07448c1e 100644 --- a/src/square/requests/site.py +++ b/src/square/requests/site.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SiteParams(typing_extensions.TypedDict): diff --git a/src/square/requests/snippet.py b/src/square/requests/snippet.py index 343d4539..b8c82ad6 100644 --- a/src/square/requests/snippet.py +++ b/src/square/requests/snippet.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class SnippetParams(typing_extensions.TypedDict): diff --git a/src/square/requests/source_application.py b/src/square/requests/source_application.py index 2c9daeb6..581e159e 100644 --- a/src/square/requests/source_application.py +++ b/src/square/requests/source_application.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.product import Product +import typing class SourceApplicationParams(typing_extensions.TypedDict): diff --git a/src/square/requests/square_account_details.py b/src/square/requests/square_account_details.py index 6df3dd4e..1e00023e 100644 --- a/src/square/requests/square_account_details.py +++ b/src/square/requests/square_account_details.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/standard_unit_description.py b/src/square/requests/standard_unit_description.py index 30f253e0..88550059 100644 --- a/src/square/requests/standard_unit_description.py +++ b/src/square/requests/standard_unit_description.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .measurement_unit import MeasurementUnitParams +import typing class StandardUnitDescriptionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/standard_unit_description_group.py b/src/square/requests/standard_unit_description_group.py index fd807948..1d149127 100644 --- a/src/square/requests/standard_unit_description_group.py +++ b/src/square/requests/standard_unit_description_group.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .standard_unit_description import StandardUnitDescriptionParams diff --git a/src/square/requests/start_transfer_order_response.py b/src/square/requests/start_transfer_order_response.py deleted file mode 100644 index 0bc49ade..00000000 --- a/src/square/requests/start_transfer_order_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class StartTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response for starting a transfer order. - """ - - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The updated transfer order with status changed to STARTED - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/submit_evidence_response.py b/src/square/requests/submit_evidence_response.py index 6e90c99a..49c25291 100644 --- a/src/square/requests/submit_evidence_response.py +++ b/src/square/requests/submit_evidence_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .dispute import DisputeParams +import typing_extensions +import typing from .error import ErrorParams +from .dispute import DisputeParams class SubmitEvidenceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/subscription.py b/src/square/requests/subscription.py index 4bf1b778..7df62b03 100644 --- a/src/square/requests/subscription.py +++ b/src/square/requests/subscription.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.subscription_status import SubscriptionStatus from .money import MoneyParams -from .phase import PhaseParams -from .subscription_action import SubscriptionActionParams from .subscription_source import SubscriptionSourceParams +from .subscription_action import SubscriptionActionParams +from .phase import PhaseParams class SubscriptionParams(typing_extensions.TypedDict): @@ -142,8 +142,3 @@ class SubscriptionParams(typing_extensions.TypedDict): """ array of phases for this subscription """ - - completed_date: typing_extensions.NotRequired[typing.Optional[str]] - """ - The `YYYY-MM-DD`-formatted date when the subscription enters a terminal state. - """ diff --git a/src/square/requests/subscription_action.py b/src/square/requests/subscription_action.py index e438a19f..9c6be863 100644 --- a/src/square/requests/subscription_action.py +++ b/src/square/requests/subscription_action.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.subscription_action_type import SubscriptionActionType +import typing from .phase import PhaseParams diff --git a/src/square/requests/subscription_created_event.py b/src/square/requests/subscription_created_event.py index 9e9d1cda..042d78a4 100644 --- a/src/square/requests/subscription_created_event.py +++ b/src/square/requests/subscription_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .subscription_created_event_data import SubscriptionCreatedEventDataParams diff --git a/src/square/requests/subscription_created_event_data.py b/src/square/requests/subscription_created_event_data.py index 5b871c25..6f2c999f 100644 --- a/src/square/requests/subscription_created_event_data.py +++ b/src/square/requests/subscription_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .subscription_created_event_object import SubscriptionCreatedEventObjectParams diff --git a/src/square/requests/subscription_created_event_object.py b/src/square/requests/subscription_created_event_object.py index 99137a37..ac0f44b8 100644 --- a/src/square/requests/subscription_created_event_object.py +++ b/src/square/requests/subscription_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .subscription import SubscriptionParams diff --git a/src/square/requests/subscription_event.py b/src/square/requests/subscription_event.py index b0965c53..71effc95 100644 --- a/src/square/requests/subscription_event.py +++ b/src/square/requests/subscription_event.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ..types.subscription_event_subscription_event_type import SubscriptionEventSubscriptionEventType -from .phase import PhaseParams +import typing_extensions from .subscription_event_info import SubscriptionEventInfoParams +import typing +from .phase import PhaseParams class SubscriptionEventParams(typing_extensions.TypedDict): diff --git a/src/square/requests/subscription_event_info.py b/src/square/requests/subscription_event_info.py index dd17061f..ab0267a3 100644 --- a/src/square/requests/subscription_event_info.py +++ b/src/square/requests/subscription_event_info.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.subscription_event_info_code import SubscriptionEventInfoCode diff --git a/src/square/requests/subscription_phase.py b/src/square/requests/subscription_phase.py index 398746d0..7819cf86 100644 --- a/src/square/requests/subscription_phase.py +++ b/src/square/requests/subscription_phase.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.subscription_cadence import SubscriptionCadence from .money import MoneyParams from .subscription_pricing import SubscriptionPricingParams diff --git a/src/square/requests/subscription_pricing.py b/src/square/requests/subscription_pricing.py index 746474a1..fe18bd2b 100644 --- a/src/square/requests/subscription_pricing.py +++ b/src/square/requests/subscription_pricing.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.subscription_pricing_type import SubscriptionPricingType +import typing from .money import MoneyParams diff --git a/src/square/requests/subscription_source.py b/src/square/requests/subscription_source.py index affd05ee..d47cde83 100644 --- a/src/square/requests/subscription_source.py +++ b/src/square/requests/subscription_source.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SubscriptionSourceParams(typing_extensions.TypedDict): diff --git a/src/square/requests/subscription_test_result.py b/src/square/requests/subscription_test_result.py index 055c636b..b4f852c3 100644 --- a/src/square/requests/subscription_test_result.py +++ b/src/square/requests/subscription_test_result.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class SubscriptionTestResultParams(typing_extensions.TypedDict): diff --git a/src/square/requests/subscription_updated_event.py b/src/square/requests/subscription_updated_event.py index f26b4bb2..0e4221f9 100644 --- a/src/square/requests/subscription_updated_event.py +++ b/src/square/requests/subscription_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .subscription_updated_event_data import SubscriptionUpdatedEventDataParams diff --git a/src/square/requests/subscription_updated_event_data.py b/src/square/requests/subscription_updated_event_data.py index c13941dc..c52e8cd8 100644 --- a/src/square/requests/subscription_updated_event_data.py +++ b/src/square/requests/subscription_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .subscription_updated_event_object import SubscriptionUpdatedEventObjectParams diff --git a/src/square/requests/subscription_updated_event_object.py b/src/square/requests/subscription_updated_event_object.py index 5553893a..27d2f9b4 100644 --- a/src/square/requests/subscription_updated_event_object.py +++ b/src/square/requests/subscription_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .subscription import SubscriptionParams diff --git a/src/square/requests/swap_plan_response.py b/src/square/requests/swap_plan_response.py index 4d37006b..5270c11b 100644 --- a/src/square/requests/swap_plan_response.py +++ b/src/square/requests/swap_plan_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams from .subscription_action import SubscriptionActionParams diff --git a/src/square/requests/tax_ids.py b/src/square/requests/tax_ids.py index 14d02b6b..d50377c4 100644 --- a/src/square/requests/tax_ids.py +++ b/src/square/requests/tax_ids.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class TaxIdsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/team_member.py b/src/square/requests/team_member.py index e4578990..98036314 100644 --- a/src/square/requests/team_member.py +++ b/src/square/requests/team_member.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.team_member_status import TeamMemberStatus from .team_member_assigned_locations import TeamMemberAssignedLocationsParams from .wage_setting import WageSettingParams diff --git a/src/square/requests/team_member_assigned_locations.py b/src/square/requests/team_member_assigned_locations.py index 77aeb850..5e9748d8 100644 --- a/src/square/requests/team_member_assigned_locations.py +++ b/src/square/requests/team_member_assigned_locations.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from ..types.team_member_assigned_locations_assignment_type import TeamMemberAssignedLocationsAssignmentType +import typing class TeamMemberAssignedLocationsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/team_member_booking_profile.py b/src/square/requests/team_member_booking_profile.py index 55ef8dad..93e11c7e 100644 --- a/src/square/requests/team_member_booking_profile.py +++ b/src/square/requests/team_member_booking_profile.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class TeamMemberBookingProfileParams(typing_extensions.TypedDict): diff --git a/src/square/requests/team_member_created_event.py b/src/square/requests/team_member_created_event.py index dddbbb8e..90b5a596 100644 --- a/src/square/requests/team_member_created_event.py +++ b/src/square/requests/team_member_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .team_member_created_event_data import TeamMemberCreatedEventDataParams diff --git a/src/square/requests/team_member_created_event_data.py b/src/square/requests/team_member_created_event_data.py index 0e251405..6edd1f1f 100644 --- a/src/square/requests/team_member_created_event_data.py +++ b/src/square/requests/team_member_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .team_member_created_event_object import TeamMemberCreatedEventObjectParams diff --git a/src/square/requests/team_member_created_event_object.py b/src/square/requests/team_member_created_event_object.py index d1edb904..980f4f9b 100644 --- a/src/square/requests/team_member_created_event_object.py +++ b/src/square/requests/team_member_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .team_member import TeamMemberParams diff --git a/src/square/requests/team_member_updated_event.py b/src/square/requests/team_member_updated_event.py index f63392ed..98bc0f02 100644 --- a/src/square/requests/team_member_updated_event.py +++ b/src/square/requests/team_member_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .team_member_updated_event_data import TeamMemberUpdatedEventDataParams diff --git a/src/square/requests/team_member_updated_event_data.py b/src/square/requests/team_member_updated_event_data.py index 08398360..cc5ba98a 100644 --- a/src/square/requests/team_member_updated_event_data.py +++ b/src/square/requests/team_member_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .team_member_updated_event_object import TeamMemberUpdatedEventObjectParams diff --git a/src/square/requests/team_member_updated_event_object.py b/src/square/requests/team_member_updated_event_object.py index d95b587c..1668fbe8 100644 --- a/src/square/requests/team_member_updated_event_object.py +++ b/src/square/requests/team_member_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .team_member import TeamMemberParams diff --git a/src/square/requests/team_member_wage.py b/src/square/requests/team_member_wage.py index 2d2a947d..72a1a796 100644 --- a/src/square/requests/team_member_wage.py +++ b/src/square/requests/team_member_wage.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/team_member_wage_setting_updated_event.py b/src/square/requests/team_member_wage_setting_updated_event.py index f43b6719..5a035870 100644 --- a/src/square/requests/team_member_wage_setting_updated_event.py +++ b/src/square/requests/team_member_wage_setting_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .team_member_wage_setting_updated_event_data import TeamMemberWageSettingUpdatedEventDataParams diff --git a/src/square/requests/team_member_wage_setting_updated_event_data.py b/src/square/requests/team_member_wage_setting_updated_event_data.py index aeb5e64d..6e7e7f66 100644 --- a/src/square/requests/team_member_wage_setting_updated_event_data.py +++ b/src/square/requests/team_member_wage_setting_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .team_member_wage_setting_updated_event_object import TeamMemberWageSettingUpdatedEventObjectParams diff --git a/src/square/requests/team_member_wage_setting_updated_event_object.py b/src/square/requests/team_member_wage_setting_updated_event_object.py index 4470c4bc..f2bcc33f 100644 --- a/src/square/requests/team_member_wage_setting_updated_event_object.py +++ b/src/square/requests/team_member_wage_setting_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .wage_setting import WageSettingParams diff --git a/src/square/requests/tender.py b/src/square/requests/tender.py index c85d0d50..0fc703fd 100644 --- a/src/square/requests/tender.py +++ b/src/square/requests/tender.py @@ -1,16 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.tender_type import TenderType -from .additional_recipient import AdditionalRecipientParams +import typing_extensions +import typing from .money import MoneyParams -from .tender_bank_account_details import TenderBankAccountDetailsParams -from .tender_buy_now_pay_later_details import TenderBuyNowPayLaterDetailsParams +from ..types.tender_type import TenderType from .tender_card_details import TenderCardDetailsParams from .tender_cash_details import TenderCashDetailsParams +from .tender_bank_account_details import TenderBankAccountDetailsParams +from .tender_buy_now_pay_later_details import TenderBuyNowPayLaterDetailsParams from .tender_square_account_details import TenderSquareAccountDetailsParams +from .additional_recipient import AdditionalRecipientParams class TenderParams(typing_extensions.TypedDict): diff --git a/src/square/requests/tender_bank_account_details.py b/src/square/requests/tender_bank_account_details.py index 3e5124f7..bbef9618 100644 --- a/src/square/requests/tender_bank_account_details.py +++ b/src/square/requests/tender_bank_account_details.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.tender_bank_account_details_status import TenderBankAccountDetailsStatus diff --git a/src/square/requests/tender_buy_now_pay_later_details.py b/src/square/requests/tender_buy_now_pay_later_details.py index c68f9615..51c90413 100644 --- a/src/square/requests/tender_buy_now_pay_later_details.py +++ b/src/square/requests/tender_buy_now_pay_later_details.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.tender_buy_now_pay_later_details_brand import TenderBuyNowPayLaterDetailsBrand from ..types.tender_buy_now_pay_later_details_status import TenderBuyNowPayLaterDetailsStatus diff --git a/src/square/requests/tender_card_details.py b/src/square/requests/tender_card_details.py index 5ad38675..fa3b0720 100644 --- a/src/square/requests/tender_card_details.py +++ b/src/square/requests/tender_card_details.py @@ -1,9 +1,10 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.tender_card_details_entry_method import TenderCardDetailsEntryMethod +import typing_extensions from ..types.tender_card_details_status import TenderCardDetailsStatus from .card import CardParams +from ..types.tender_card_details_entry_method import TenderCardDetailsEntryMethod class TenderCardDetailsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/tender_cash_details.py b/src/square/requests/tender_cash_details.py index a1ef03b1..e0a56d35 100644 --- a/src/square/requests/tender_cash_details.py +++ b/src/square/requests/tender_cash_details.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .money import MoneyParams diff --git a/src/square/requests/tender_square_account_details.py b/src/square/requests/tender_square_account_details.py index 16110945..f40227b3 100644 --- a/src/square/requests/tender_square_account_details.py +++ b/src/square/requests/tender_square_account_details.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.tender_square_account_details_status import TenderSquareAccountDetailsStatus diff --git a/src/square/requests/terminal_action.py b/src/square/requests/terminal_action.py index 139ba41b..54b54627 100644 --- a/src/square/requests/terminal_action.py +++ b/src/square/requests/terminal_action.py @@ -1,18 +1,18 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.action_cancel_reason import ActionCancelReason from ..types.terminal_action_action_type import TerminalActionActionType -from .confirmation_options import ConfirmationOptionsParams -from .data_collection_options import DataCollectionOptionsParams -from .device_metadata import DeviceMetadataParams from .qr_code_options import QrCodeOptionsParams -from .receipt_options import ReceiptOptionsParams from .save_card_options import SaveCardOptionsParams -from .select_options import SelectOptionsParams from .signature_options import SignatureOptionsParams +from .confirmation_options import ConfirmationOptionsParams +from .receipt_options import ReceiptOptionsParams +from .data_collection_options import DataCollectionOptionsParams +from .select_options import SelectOptionsParams +from .device_metadata import DeviceMetadataParams class TerminalActionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/terminal_action_created_event.py b/src/square/requests/terminal_action_created_event.py index 02e35f0c..4ff6bd35 100644 --- a/src/square/requests/terminal_action_created_event.py +++ b/src/square/requests/terminal_action_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_action_created_event_data import TerminalActionCreatedEventDataParams diff --git a/src/square/requests/terminal_action_created_event_data.py b/src/square/requests/terminal_action_created_event_data.py index aca2ffca..dc6c9e32 100644 --- a/src/square/requests/terminal_action_created_event_data.py +++ b/src/square/requests/terminal_action_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_action_created_event_object import TerminalActionCreatedEventObjectParams diff --git a/src/square/requests/terminal_action_created_event_object.py b/src/square/requests/terminal_action_created_event_object.py index b73c0f7b..08ab497a 100644 --- a/src/square/requests/terminal_action_created_event_object.py +++ b/src/square/requests/terminal_action_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_action import TerminalActionParams diff --git a/src/square/requests/terminal_action_query.py b/src/square/requests/terminal_action_query.py index 400853ec..7b8a2f5b 100644 --- a/src/square/requests/terminal_action_query.py +++ b/src/square/requests/terminal_action_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_action_query_filter import TerminalActionQueryFilterParams from .terminal_action_query_sort import TerminalActionQuerySortParams diff --git a/src/square/requests/terminal_action_query_filter.py b/src/square/requests/terminal_action_query_filter.py index bcc1f38a..36a76a4f 100644 --- a/src/square/requests/terminal_action_query_filter.py +++ b/src/square/requests/terminal_action_query_filter.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.terminal_action_action_type import TerminalActionActionType +import typing_extensions +import typing from .time_range import TimeRangeParams +from ..types.terminal_action_action_type import TerminalActionActionType class TerminalActionQueryFilterParams(typing_extensions.TypedDict): diff --git a/src/square/requests/terminal_action_query_sort.py b/src/square/requests/terminal_action_query_sort.py index b507783b..bc732dc8 100644 --- a/src/square/requests/terminal_action_query_sort.py +++ b/src/square/requests/terminal_action_query_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.sort_order import SortOrder diff --git a/src/square/requests/terminal_action_updated_event.py b/src/square/requests/terminal_action_updated_event.py index b581ca15..b6f1492f 100644 --- a/src/square/requests/terminal_action_updated_event.py +++ b/src/square/requests/terminal_action_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_action_updated_event_data import TerminalActionUpdatedEventDataParams diff --git a/src/square/requests/terminal_action_updated_event_data.py b/src/square/requests/terminal_action_updated_event_data.py index 71e90dea..c976ee8b 100644 --- a/src/square/requests/terminal_action_updated_event_data.py +++ b/src/square/requests/terminal_action_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_action_updated_event_object import TerminalActionUpdatedEventObjectParams diff --git a/src/square/requests/terminal_action_updated_event_object.py b/src/square/requests/terminal_action_updated_event_object.py index 12e8cc0b..753171d1 100644 --- a/src/square/requests/terminal_action_updated_event_object.py +++ b/src/square/requests/terminal_action_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_action import TerminalActionParams diff --git a/src/square/requests/terminal_checkout.py b/src/square/requests/terminal_checkout.py index 95a5ad93..8655cabf 100644 --- a/src/square/requests/terminal_checkout.py +++ b/src/square/requests/terminal_checkout.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.action_cancel_reason import ActionCancelReason -from ..types.checkout_options_payment_type import CheckoutOptionsPaymentType -from .device_checkout_options import DeviceCheckoutOptionsParams +import typing_extensions from .money import MoneyParams +import typing from .payment_options import PaymentOptionsParams +from .device_checkout_options import DeviceCheckoutOptionsParams +from ..types.action_cancel_reason import ActionCancelReason +from ..types.checkout_options_payment_type import CheckoutOptionsPaymentType class TerminalCheckoutParams(typing_extensions.TypedDict): diff --git a/src/square/requests/terminal_checkout_created_event.py b/src/square/requests/terminal_checkout_created_event.py index 7d81a356..99e58b60 100644 --- a/src/square/requests/terminal_checkout_created_event.py +++ b/src/square/requests/terminal_checkout_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_checkout_created_event_data import TerminalCheckoutCreatedEventDataParams diff --git a/src/square/requests/terminal_checkout_created_event_data.py b/src/square/requests/terminal_checkout_created_event_data.py index 643728ff..53d3ea6e 100644 --- a/src/square/requests/terminal_checkout_created_event_data.py +++ b/src/square/requests/terminal_checkout_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_checkout_created_event_object import TerminalCheckoutCreatedEventObjectParams diff --git a/src/square/requests/terminal_checkout_created_event_object.py b/src/square/requests/terminal_checkout_created_event_object.py index e013ab03..223147f7 100644 --- a/src/square/requests/terminal_checkout_created_event_object.py +++ b/src/square/requests/terminal_checkout_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/terminal_checkout_query.py b/src/square/requests/terminal_checkout_query.py index a6cfdeca..eb53834a 100644 --- a/src/square/requests/terminal_checkout_query.py +++ b/src/square/requests/terminal_checkout_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_checkout_query_filter import TerminalCheckoutQueryFilterParams from .terminal_checkout_query_sort import TerminalCheckoutQuerySortParams diff --git a/src/square/requests/terminal_checkout_query_filter.py b/src/square/requests/terminal_checkout_query_filter.py index 5261f298..d9f22a97 100644 --- a/src/square/requests/terminal_checkout_query_filter.py +++ b/src/square/requests/terminal_checkout_query_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .time_range import TimeRangeParams diff --git a/src/square/requests/terminal_checkout_query_sort.py b/src/square/requests/terminal_checkout_query_sort.py index cc80f534..48108b5d 100644 --- a/src/square/requests/terminal_checkout_query_sort.py +++ b/src/square/requests/terminal_checkout_query_sort.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.sort_order import SortOrder diff --git a/src/square/requests/terminal_checkout_updated_event.py b/src/square/requests/terminal_checkout_updated_event.py index f8835ca8..0c30f535 100644 --- a/src/square/requests/terminal_checkout_updated_event.py +++ b/src/square/requests/terminal_checkout_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_checkout_updated_event_data import TerminalCheckoutUpdatedEventDataParams diff --git a/src/square/requests/terminal_checkout_updated_event_data.py b/src/square/requests/terminal_checkout_updated_event_data.py index 71fbb0d0..e6b62184 100644 --- a/src/square/requests/terminal_checkout_updated_event_data.py +++ b/src/square/requests/terminal_checkout_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_checkout_updated_event_object import TerminalCheckoutUpdatedEventObjectParams diff --git a/src/square/requests/terminal_checkout_updated_event_object.py b/src/square/requests/terminal_checkout_updated_event_object.py index d17cd956..c75ac7c4 100644 --- a/src/square/requests/terminal_checkout_updated_event_object.py +++ b/src/square/requests/terminal_checkout_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_checkout import TerminalCheckoutParams diff --git a/src/square/requests/terminal_refund.py b/src/square/requests/terminal_refund.py index 919bb414..277f13da 100644 --- a/src/square/requests/terminal_refund.py +++ b/src/square/requests/terminal_refund.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.action_cancel_reason import ActionCancelReason +import typing_extensions from .money import MoneyParams +import typing +from ..types.action_cancel_reason import ActionCancelReason class TerminalRefundParams(typing_extensions.TypedDict): diff --git a/src/square/requests/terminal_refund_created_event.py b/src/square/requests/terminal_refund_created_event.py index 6da7689e..6b78e78a 100644 --- a/src/square/requests/terminal_refund_created_event.py +++ b/src/square/requests/terminal_refund_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_refund_created_event_data import TerminalRefundCreatedEventDataParams diff --git a/src/square/requests/terminal_refund_created_event_data.py b/src/square/requests/terminal_refund_created_event_data.py index 7fd127de..d0c28840 100644 --- a/src/square/requests/terminal_refund_created_event_data.py +++ b/src/square/requests/terminal_refund_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_refund_created_event_object import TerminalRefundCreatedEventObjectParams diff --git a/src/square/requests/terminal_refund_created_event_object.py b/src/square/requests/terminal_refund_created_event_object.py index 1ea59baa..02dd792d 100644 --- a/src/square/requests/terminal_refund_created_event_object.py +++ b/src/square/requests/terminal_refund_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/terminal_refund_query.py b/src/square/requests/terminal_refund_query.py index 9ebe3b65..7365aad9 100644 --- a/src/square/requests/terminal_refund_query.py +++ b/src/square/requests/terminal_refund_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_refund_query_filter import TerminalRefundQueryFilterParams from .terminal_refund_query_sort import TerminalRefundQuerySortParams diff --git a/src/square/requests/terminal_refund_query_filter.py b/src/square/requests/terminal_refund_query_filter.py index 496d531b..59932733 100644 --- a/src/square/requests/terminal_refund_query_filter.py +++ b/src/square/requests/terminal_refund_query_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .time_range import TimeRangeParams diff --git a/src/square/requests/terminal_refund_query_sort.py b/src/square/requests/terminal_refund_query_sort.py index 0e70d903..2dd8de16 100644 --- a/src/square/requests/terminal_refund_query_sort.py +++ b/src/square/requests/terminal_refund_query_sort.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class TerminalRefundQuerySortParams(typing_extensions.TypedDict): diff --git a/src/square/requests/terminal_refund_updated_event.py b/src/square/requests/terminal_refund_updated_event.py index 662a1f0f..4e3e1dbd 100644 --- a/src/square/requests/terminal_refund_updated_event.py +++ b/src/square/requests/terminal_refund_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_refund_updated_event_data import TerminalRefundUpdatedEventDataParams diff --git a/src/square/requests/terminal_refund_updated_event_data.py b/src/square/requests/terminal_refund_updated_event_data.py index 8f9dc5b6..38f52f1f 100644 --- a/src/square/requests/terminal_refund_updated_event_data.py +++ b/src/square/requests/terminal_refund_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .terminal_refund_updated_event_object import TerminalRefundUpdatedEventObjectParams diff --git a/src/square/requests/terminal_refund_updated_event_object.py b/src/square/requests/terminal_refund_updated_event_object.py index e90ca1ba..3d813009 100644 --- a/src/square/requests/terminal_refund_updated_event_object.py +++ b/src/square/requests/terminal_refund_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .terminal_refund import TerminalRefundParams diff --git a/src/square/requests/test_webhook_subscription_response.py b/src/square/requests/test_webhook_subscription_response.py index bf5bdeb1..77e779de 100644 --- a/src/square/requests/test_webhook_subscription_response.py +++ b/src/square/requests/test_webhook_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription_test_result import SubscriptionTestResultParams diff --git a/src/square/requests/time_range.py b/src/square/requests/time_range.py index 571e51d0..b2e14704 100644 --- a/src/square/requests/time_range.py +++ b/src/square/requests/time_range.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class TimeRangeParams(typing_extensions.TypedDict): diff --git a/src/square/requests/timecard.py b/src/square/requests/timecard.py index eff6a27a..b128f6a6 100644 --- a/src/square/requests/timecard.py +++ b/src/square/requests/timecard.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.timecard_status import TimecardStatus +import typing_extensions +import typing +from .timecard_wage import TimecardWageParams from .break_ import BreakParams +from ..types.timecard_status import TimecardStatus from .money import MoneyParams -from .timecard_wage import TimecardWageParams class TimecardParams(typing_extensions.TypedDict): diff --git a/src/square/requests/timecard_filter.py b/src/square/requests/timecard_filter.py index 5e9fe2fb..833a5f74 100644 --- a/src/square/requests/timecard_filter.py +++ b/src/square/requests/timecard_filter.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.timecard_filter_status import TimecardFilterStatus from .time_range import TimeRangeParams from .timecard_workday import TimecardWorkdayParams diff --git a/src/square/requests/timecard_query.py b/src/square/requests/timecard_query.py index b4f4ae40..b7fd7dd6 100644 --- a/src/square/requests/timecard_query.py +++ b/src/square/requests/timecard_query.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .timecard_filter import TimecardFilterParams from .timecard_sort import TimecardSortParams diff --git a/src/square/requests/timecard_sort.py b/src/square/requests/timecard_sort.py index 7b1760d0..d2702590 100644 --- a/src/square/requests/timecard_sort.py +++ b/src/square/requests/timecard_sort.py @@ -1,8 +1,9 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions -from ..types.sort_order import SortOrder +import typing_extensions from ..types.timecard_sort_field import TimecardSortField +from ..types.sort_order import SortOrder class TimecardSortParams(typing_extensions.TypedDict): diff --git a/src/square/requests/timecard_wage.py b/src/square/requests/timecard_wage.py index 366b04bd..c7d1bee3 100644 --- a/src/square/requests/timecard_wage.py +++ b/src/square/requests/timecard_wage.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .money import MoneyParams diff --git a/src/square/requests/timecard_workday.py b/src/square/requests/timecard_workday.py index 81399569..c3f710a1 100644 --- a/src/square/requests/timecard_workday.py +++ b/src/square/requests/timecard_workday.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.timecard_workday_matcher import TimecardWorkdayMatcher +import typing_extensions from .date_range import DateRangeParams +from ..types.timecard_workday_matcher import TimecardWorkdayMatcher +import typing class TimecardWorkdayParams(typing_extensions.TypedDict): diff --git a/src/square/requests/tip_settings.py b/src/square/requests/tip_settings.py index 1f858881..75b4cc86 100644 --- a/src/square/requests/tip_settings.py +++ b/src/square/requests/tip_settings.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class TipSettingsParams(typing_extensions.TypedDict): diff --git a/src/square/requests/transaction.py b/src/square/requests/transaction.py index a851a4b1..e90896f1 100644 --- a/src/square/requests/transaction.py +++ b/src/square/requests/transaction.py @@ -1,12 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .tender import TenderParams +from .refund import RefundParams from ..types.transaction_product import TransactionProduct from .address import AddressParams -from .refund import RefundParams -from .tender import TenderParams class TransactionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/transfer_order.py b/src/square/requests/transfer_order.py deleted file mode 100644 index 1f216f5c..00000000 --- a/src/square/requests/transfer_order.py +++ /dev/null @@ -1,131 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ..types.transfer_order_status import TransferOrderStatus -from .transfer_order_line import TransferOrderLineParams - - -class TransferOrderParams(typing_extensions.TypedDict): - """ - Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s - between [Location](entity:Location)s. Transfer orders track the entire lifecycle of an inventory - transfer, including: - - What items and quantities are being moved - - Source and destination locations - - Current [TransferOrderStatus](entity:TransferOrderStatus) - - Shipping information and tracking - - Which [TeamMember](entity:TeamMember) initiated the transfer - - This object is commonly used to: - - Track [CatalogItemVariation](entity:CatalogItemVariation) movements between [Location](entity:Location)s - - Reconcile expected vs received quantities - - Monitor transfer progress and shipping status - - Audit inventory movement history - """ - - id: typing_extensions.NotRequired[str] - """ - Unique system-generated identifier for this transfer order. Use this ID for: - - Retrieving transfer order details - - Tracking status changes via webhooks - - Linking transfers in external systems - """ - - source_location_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The source [Location](entity:Location) sending the [CatalogItemVariation](entity:CatalogItemVariation)s. - This location must: - - Be active in your Square organization - - Have sufficient inventory for the items being transferred - - Not be the same as the destination location - - This field is not updatable. - """ - - destination_location_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The destination [Location](entity:Location) receiving the [CatalogItemVariation](entity:CatalogItemVariation)s. - This location must: - - Be active in your Square organization - - Not be the same as the source location - - This field is not updatable. - """ - - status: typing_extensions.NotRequired[TransferOrderStatus] - """ - Current [TransferOrderStatus](entity:TransferOrderStatus) indicating where the order is in its lifecycle. - Status transitions follow this progression: - 1. [DRAFT](entity:TransferOrderStatus) -> [STARTED](entity:TransferOrderStatus) via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder) - 2. [STARTED](entity:TransferOrderStatus) -> [PARTIALLY_RECEIVED](entity:TransferOrderStatus) via [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) - 3. [PARTIALLY_RECEIVED](entity:TransferOrderStatus) -> [COMPLETED](entity:TransferOrderStatus) after all items received - - Orders can be [CANCELED](entity:TransferOrderStatus) from [STARTED](entity:TransferOrderStatus) or - [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - - This field is read-only and reflects the current state of the transfer order, and cannot be updated directly. Use the appropriate - endpoints (e.g. [StartPurchaseOrder](api-endpoint:TransferOrders-StartTransferOrder), to change the status. - See [TransferOrderStatus](#type-transferorderstatus) for possible values - """ - - created_at: typing_extensions.NotRequired[str] - """ - Timestamp when the transfer order was created, in RFC 3339 format. - Used for: - - Auditing transfer history - - Tracking order age - - Reporting and analytics - """ - - updated_at: typing_extensions.NotRequired[str] - """ - Timestamp when the transfer order was last updated, in RFC 3339 format. - Updated when: - - Order status changes - - Items are received - - Notes or metadata are modified - """ - - expected_at: typing_extensions.NotRequired[typing.Optional[str]] - """ - Expected transfer completion date, in RFC 3339 format. - Used for: - - Planning inventory availability - - Scheduling receiving staff - - Monitoring transfer timeliness - """ - - completed_at: typing_extensions.NotRequired[str] - """ - Timestamp when the transfer order was completed or canceled, in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). - """ - - notes: typing_extensions.NotRequired[typing.Optional[str]] - """ - Optional notes about the transfer. - """ - - tracking_number: typing_extensions.NotRequired[typing.Optional[str]] - """ - Shipment tracking number for monitoring transfer progress. - """ - - created_by_team_member_id: typing_extensions.NotRequired[str] - """ - ID of the [TeamMember](entity:TeamMember) who created this transfer order. This field is not writeable by the Connect V2 API. - """ - - line_items: typing_extensions.NotRequired[typing.Optional[typing.Sequence[TransferOrderLineParams]]] - """ - List of [CatalogItemVariation](entity:CatalogItemVariation)s being transferred. - """ - - version: typing_extensions.NotRequired[int] - """ - Version for optimistic concurrency control. This is a monotonically increasing integer - that changes whenever the transfer order is modified. Use this when calling - [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder) and other endpoints to ensure you're - not overwriting concurrent changes. - """ diff --git a/src/square/requests/transfer_order_created_event.py b/src/square/requests/transfer_order_created_event.py deleted file mode 100644 index 93dbb581..00000000 --- a/src/square/requests/transfer_order_created_event.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .transfer_order_created_event_data import TransferOrderCreatedEventDataParams - - -class TransferOrderCreatedEventParams(typing_extensions.TypedDict): - """ - Published when a transfer_order is created. - """ - - merchant_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The ID of the target merchant associated with the event. - """ - - type: typing_extensions.NotRequired[typing.Optional[str]] - """ - The type of event this represents, `"transfer_order.created"`. - """ - - event_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - A unique ID for the event. - """ - - created_at: typing_extensions.NotRequired[str] - """ - Timestamp of when the event was created, in RFC 3339 format. - """ - - data: typing_extensions.NotRequired[TransferOrderCreatedEventDataParams] - """ - Data associated with the event. - """ diff --git a/src/square/requests/transfer_order_created_event_data.py b/src/square/requests/transfer_order_created_event_data.py deleted file mode 100644 index 88a23bcc..00000000 --- a/src/square/requests/transfer_order_created_event_data.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .transfer_order_created_event_object import TransferOrderCreatedEventObjectParams - - -class TransferOrderCreatedEventDataParams(typing_extensions.TypedDict): - type: typing_extensions.NotRequired[typing.Optional[str]] - """ - Name of the affected object’s type, `"transfer_order"`. - """ - - id: typing_extensions.NotRequired[str] - """ - ID of the affected transfer_order. - """ - - object: typing_extensions.NotRequired[TransferOrderCreatedEventObjectParams] - """ - An object containing the created transfer_order. - """ diff --git a/src/square/requests/transfer_order_created_event_object.py b/src/square/requests/transfer_order_created_event_object.py deleted file mode 100644 index e0bf87f9..00000000 --- a/src/square/requests/transfer_order_created_event_object.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from .transfer_order import TransferOrderParams - - -class TransferOrderCreatedEventObjectParams(typing_extensions.TypedDict): - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The created transfer_order. - """ diff --git a/src/square/requests/transfer_order_deleted_event.py b/src/square/requests/transfer_order_deleted_event.py deleted file mode 100644 index 674de288..00000000 --- a/src/square/requests/transfer_order_deleted_event.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .transfer_order_deleted_event_data import TransferOrderDeletedEventDataParams - - -class TransferOrderDeletedEventParams(typing_extensions.TypedDict): - """ - Published when a transfer_order is deleted. - """ - - merchant_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The ID of the target merchant associated with the event. - """ - - type: typing_extensions.NotRequired[typing.Optional[str]] - """ - The type of event this represents, `"transfer_order.deleted"`. - """ - - event_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - A unique ID for the event. - """ - - created_at: typing_extensions.NotRequired[str] - """ - Timestamp of when the event was created, in RFC 3339 format. - """ - - data: typing_extensions.NotRequired[TransferOrderDeletedEventDataParams] - """ - Data associated with the event. - """ diff --git a/src/square/requests/transfer_order_deleted_event_data.py b/src/square/requests/transfer_order_deleted_event_data.py deleted file mode 100644 index 7d278943..00000000 --- a/src/square/requests/transfer_order_deleted_event_data.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions - - -class TransferOrderDeletedEventDataParams(typing_extensions.TypedDict): - type: typing_extensions.NotRequired[typing.Optional[str]] - """ - Name of the affected object’s type, `"transfer_order"`. - """ - - id: typing_extensions.NotRequired[str] - """ - ID of the affected transfer_order. - """ - - deleted: typing_extensions.NotRequired[typing.Optional[bool]] - """ - Is true if the affected object was deleted. Otherwise absent. - """ diff --git a/src/square/requests/transfer_order_filter.py b/src/square/requests/transfer_order_filter.py deleted file mode 100644 index 74f68275..00000000 --- a/src/square/requests/transfer_order_filter.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ..types.transfer_order_status import TransferOrderStatus - - -class TransferOrderFilterParams(typing_extensions.TypedDict): - """ - Filter criteria for searching transfer orders - """ - - source_location_ids: typing_extensions.NotRequired[typing.Optional[typing.Sequence[str]]] - """ - Filter by source location IDs - """ - - destination_location_ids: typing_extensions.NotRequired[typing.Optional[typing.Sequence[str]]] - """ - Filter by destination location IDs - """ - - statuses: typing_extensions.NotRequired[typing.Optional[typing.Sequence[TransferOrderStatus]]] - """ - Filter by order statuses - See [TransferOrderStatus](#type-transferorderstatus) for possible values - """ diff --git a/src/square/requests/transfer_order_goods_receipt.py b/src/square/requests/transfer_order_goods_receipt.py deleted file mode 100644 index 5bd410cb..00000000 --- a/src/square/requests/transfer_order_goods_receipt.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .transfer_order_goods_receipt_line_item import TransferOrderGoodsReceiptLineItemParams - - -class TransferOrderGoodsReceiptParams(typing_extensions.TypedDict): - """ - The goods receipt details for a transfer order. This object represents a single receipt - of goods against a transfer order, tracking: - - - Which [CatalogItemVariation](entity:CatalogItemVariation)s were received - - Quantities received in good condition - - Quantities damaged during transit/handling - - Quantities canceled during receipt - - Multiple goods receipts can be created for a single transfer order to handle: - - Partial deliveries - - Multiple shipments - - Split receipts across different dates - - Cancellations of specific quantities - - Each receipt automatically: - - Updates the transfer order status - - Adjusts received quantities - - Updates inventory levels at both source and destination [Location](entity:Location)s - """ - - line_items: typing_extensions.NotRequired[typing.Optional[typing.Sequence[TransferOrderGoodsReceiptLineItemParams]]] - """ - Line items being received. Each line item specifies: - - The item being received - - Quantity received in good condition - - Quantity received damaged - - Quantity canceled - - Constraints: - - Must include at least one line item - - Maximum of 1000 line items per receipt - - Each line item must reference a valid item from the transfer order - - Total of received, damaged, and canceled quantities cannot exceed ordered quantity - """ diff --git a/src/square/requests/transfer_order_goods_receipt_line_item.py b/src/square/requests/transfer_order_goods_receipt_line_item.py deleted file mode 100644 index cb621d00..00000000 --- a/src/square/requests/transfer_order_goods_receipt_line_item.py +++ /dev/null @@ -1,33 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions - - -class TransferOrderGoodsReceiptLineItemParams(typing_extensions.TypedDict): - """ - A simplified line item for goods receipts in transfer orders - """ - - transfer_order_line_uid: str - """ - The unique identifier of the Transfer Order line being received - """ - - quantity_received: typing_extensions.NotRequired[typing.Optional[str]] - """ - The quantity received for this line item as a decimal string (e.g. "10.5"). - These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. - """ - - quantity_damaged: typing_extensions.NotRequired[typing.Optional[str]] - """ - The quantity that was damaged during shipping/handling as a decimal string (e.g. "1.5"). - These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. - """ - - quantity_canceled: typing_extensions.NotRequired[typing.Optional[str]] - """ - The quantity that was canceled during shipping/handling as a decimal string (e.g. "1.5"). These will be immediately added to inventory in the source location. - """ diff --git a/src/square/requests/transfer_order_line.py b/src/square/requests/transfer_order_line.py deleted file mode 100644 index ef1b26f4..00000000 --- a/src/square/requests/transfer_order_line.py +++ /dev/null @@ -1,57 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - - -class TransferOrderLineParams(typing_extensions.TypedDict): - """ - Represents a line item in a transfer order. Each line item tracks a specific - [CatalogItemVariation](entity:CatalogItemVariation) being transferred, including ordered quantities - and receipt status. - """ - - uid: typing_extensions.NotRequired[str] - """ - Unique system-generated identifier for the line item. Provide when updating/removing a line via [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). - """ - - item_variation_id: str - """ - The required identifier of the [CatalogItemVariation](entity:CatalogItemVariation) being transferred. Must reference - a valid catalog item variation that exists in the [Catalog](api:Catalog). - """ - - quantity_ordered: str - """ - Total quantity ordered, formatted as a decimal string (e.g. "10 or 10.0000"). Required to be a positive number. - - To remove a line item, set `remove` to `true` in [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). - """ - - quantity_pending: typing_extensions.NotRequired[str] - """ - Calculated quantity of this line item's yet to be received stock. This is the difference between the total quantity ordered and the sum of quantities received, canceled, and damaged. - """ - - quantity_received: typing_extensions.NotRequired[str] - """ - Quantity received at destination. These items are added to the destination - [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. - - This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). - """ - - quantity_damaged: typing_extensions.NotRequired[str] - """ - Quantity received in damaged condition. These items are added to the destination - [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. - - This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). - """ - - quantity_canceled: typing_extensions.NotRequired[str] - """ - Quantity that was canceled. These items will be immediately added to inventory in the source location. - - This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) or [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - """ diff --git a/src/square/requests/transfer_order_query.py b/src/square/requests/transfer_order_query.py deleted file mode 100644 index 6a2dca84..00000000 --- a/src/square/requests/transfer_order_query.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from .transfer_order_filter import TransferOrderFilterParams -from .transfer_order_sort import TransferOrderSortParams - - -class TransferOrderQueryParams(typing_extensions.TypedDict): - """ - Query parameters for searching transfer orders - """ - - filter: typing_extensions.NotRequired[TransferOrderFilterParams] - """ - Filter criteria - """ - - sort: typing_extensions.NotRequired[TransferOrderSortParams] - """ - Sort configuration - """ diff --git a/src/square/requests/transfer_order_sort.py b/src/square/requests/transfer_order_sort.py deleted file mode 100644 index 8d5b5f37..00000000 --- a/src/square/requests/transfer_order_sort.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from ..types.sort_order import SortOrder -from ..types.transfer_order_sort_field import TransferOrderSortField - - -class TransferOrderSortParams(typing_extensions.TypedDict): - """ - Sort configuration for search results - """ - - field: typing_extensions.NotRequired[TransferOrderSortField] - """ - Field to sort by - See [TransferOrderSortField](#type-transferordersortfield) for possible values - """ - - order: typing_extensions.NotRequired[SortOrder] - """ - Sort order direction - See [SortOrder](#type-sortorder) for possible values - """ diff --git a/src/square/requests/transfer_order_updated_event.py b/src/square/requests/transfer_order_updated_event.py deleted file mode 100644 index b292c136..00000000 --- a/src/square/requests/transfer_order_updated_event.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .transfer_order_updated_event_data import TransferOrderUpdatedEventDataParams - - -class TransferOrderUpdatedEventParams(typing_extensions.TypedDict): - """ - Published when a transfer_order is updated. - """ - - merchant_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The ID of the target merchant associated with the event. - """ - - type: typing_extensions.NotRequired[typing.Optional[str]] - """ - The type of event this represents, `"transfer_order.updated"`. - """ - - event_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - A unique ID for the event. - """ - - created_at: typing_extensions.NotRequired[str] - """ - Timestamp of when the event was created, in RFC 3339 format. - """ - - data: typing_extensions.NotRequired[TransferOrderUpdatedEventDataParams] - """ - Data associated with the event. - """ diff --git a/src/square/requests/transfer_order_updated_event_data.py b/src/square/requests/transfer_order_updated_event_data.py deleted file mode 100644 index f28a8488..00000000 --- a/src/square/requests/transfer_order_updated_event_data.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .transfer_order_updated_event_object import TransferOrderUpdatedEventObjectParams - - -class TransferOrderUpdatedEventDataParams(typing_extensions.TypedDict): - type: typing_extensions.NotRequired[typing.Optional[str]] - """ - Name of the affected object’s type, `"transfer_order"`. - """ - - id: typing_extensions.NotRequired[str] - """ - ID of the affected transfer_order. - """ - - object: typing_extensions.NotRequired[TransferOrderUpdatedEventObjectParams] - """ - An object containing the updated transfer_order. - """ diff --git a/src/square/requests/transfer_order_updated_event_object.py b/src/square/requests/transfer_order_updated_event_object.py deleted file mode 100644 index e64de1f3..00000000 --- a/src/square/requests/transfer_order_updated_event_object.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from .transfer_order import TransferOrderParams - - -class TransferOrderUpdatedEventObjectParams(typing_extensions.TypedDict): - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The updated transfer_order. - """ diff --git a/src/square/requests/unlink_customer_from_gift_card_response.py b/src/square/requests/unlink_customer_from_gift_card_response.py index b5b547a1..6c8bdd96 100644 --- a/src/square/requests/unlink_customer_from_gift_card_response.py +++ b/src/square/requests/unlink_customer_from_gift_card_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .gift_card import GiftCardParams diff --git a/src/square/requests/update_booking_custom_attribute_definition_response.py b/src/square/requests/update_booking_custom_attribute_definition_response.py index fcbf489b..384e4289 100644 --- a/src/square/requests/update_booking_custom_attribute_definition_response.py +++ b/src/square/requests/update_booking_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_booking_response.py b/src/square/requests/update_booking_response.py index 6bc6b64c..0e6f9a3a 100644 --- a/src/square/requests/update_booking_response.py +++ b/src/square/requests/update_booking_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .booking import BookingParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_break_type_response.py b/src/square/requests/update_break_type_response.py index b0469bf6..88080a68 100644 --- a/src/square/requests/update_break_type_response.py +++ b/src/square/requests/update_break_type_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .break_type import BreakTypeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_catalog_image_response.py b/src/square/requests/update_catalog_image_response.py index 12e4512f..744425c8 100644 --- a/src/square/requests/update_catalog_image_response.py +++ b/src/square/requests/update_catalog_image_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams class UpdateCatalogImageResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_customer_custom_attribute_definition_response.py b/src/square/requests/update_customer_custom_attribute_definition_response.py index 166bbeba..fbdac86d 100644 --- a/src/square/requests/update_customer_custom_attribute_definition_response.py +++ b/src/square/requests/update_customer_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_customer_group_response.py b/src/square/requests/update_customer_group_response.py index 536d4ee8..fb13daa2 100644 --- a/src/square/requests/update_customer_group_response.py +++ b/src/square/requests/update_customer_group_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer_group import CustomerGroupParams +import typing_extensions +import typing from .error import ErrorParams +from .customer_group import CustomerGroupParams class UpdateCustomerGroupResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_customer_response.py b/src/square/requests/update_customer_response.py index 327a31f6..6ab19543 100644 --- a/src/square/requests/update_customer_response.py +++ b/src/square/requests/update_customer_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .customer import CustomerParams +import typing_extensions +import typing from .error import ErrorParams +from .customer import CustomerParams class UpdateCustomerResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_invoice_response.py b/src/square/requests/update_invoice_response.py index 1a1b0a46..c5e0f5a6 100644 --- a/src/square/requests/update_invoice_response.py +++ b/src/square/requests/update_invoice_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .invoice import InvoiceParams +import typing +from .error import ErrorParams class UpdateInvoiceResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_item_modifier_lists_response.py b/src/square/requests/update_item_modifier_lists_response.py index 483bd155..effa0f67 100644 --- a/src/square/requests/update_item_modifier_lists_response.py +++ b/src/square/requests/update_item_modifier_lists_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/update_item_taxes_response.py b/src/square/requests/update_item_taxes_response.py index 68f30735..57fdb7e4 100644 --- a/src/square/requests/update_item_taxes_response.py +++ b/src/square/requests/update_item_taxes_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/update_job_response.py b/src/square/requests/update_job_response.py index 0ed8f5a7..26aac973 100644 --- a/src/square/requests/update_job_response.py +++ b/src/square/requests/update_job_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .job import JobParams +import typing +from .error import ErrorParams class UpdateJobResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_location_custom_attribute_definition_response.py b/src/square/requests/update_location_custom_attribute_definition_response.py index d048dafc..fc30eaa1 100644 --- a/src/square/requests/update_location_custom_attribute_definition_response.py +++ b/src/square/requests/update_location_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_location_response.py b/src/square/requests/update_location_response.py index 39ea07e2..012f6e40 100644 --- a/src/square/requests/update_location_response.py +++ b/src/square/requests/update_location_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .location import LocationParams diff --git a/src/square/requests/update_location_settings_response.py b/src/square/requests/update_location_settings_response.py index 1baec76f..e6f8162a 100644 --- a/src/square/requests/update_location_settings_response.py +++ b/src/square/requests/update_location_settings_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .checkout_location_settings import CheckoutLocationSettingsParams +import typing_extensions +import typing from .error import ErrorParams +from .checkout_location_settings import CheckoutLocationSettingsParams class UpdateLocationSettingsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_merchant_custom_attribute_definition_response.py b/src/square/requests/update_merchant_custom_attribute_definition_response.py index 2496b814..45836a30 100644 --- a/src/square/requests/update_merchant_custom_attribute_definition_response.py +++ b/src/square/requests/update_merchant_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_merchant_settings_response.py b/src/square/requests/update_merchant_settings_response.py index c01e2473..d0470471 100644 --- a/src/square/requests/update_merchant_settings_response.py +++ b/src/square/requests/update_merchant_settings_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .checkout_merchant_settings import CheckoutMerchantSettingsParams +import typing_extensions +import typing from .error import ErrorParams +from .checkout_merchant_settings import CheckoutMerchantSettingsParams class UpdateMerchantSettingsResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_order_custom_attribute_definition_response.py b/src/square/requests/update_order_custom_attribute_definition_response.py index 4f017ce9..7355c1d0 100644 --- a/src/square/requests/update_order_custom_attribute_definition_response.py +++ b/src/square/requests/update_order_custom_attribute_definition_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute_definition import CustomAttributeDefinitionParams +import typing from .error import ErrorParams diff --git a/src/square/requests/update_order_response.py b/src/square/requests/update_order_response.py index 5de4049a..6a1bb6dc 100644 --- a/src/square/requests/update_order_response.py +++ b/src/square/requests/update_order_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .order import OrderParams +import typing +from .error import ErrorParams class UpdateOrderResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_payment_link_response.py b/src/square/requests/update_payment_link_response.py index cca78889..da847e4e 100644 --- a/src/square/requests/update_payment_link_response.py +++ b/src/square/requests/update_payment_link_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment_link import PaymentLinkParams diff --git a/src/square/requests/update_payment_response.py b/src/square/requests/update_payment_response.py index 9f2e2a02..ab511b34 100644 --- a/src/square/requests/update_payment_response.py +++ b/src/square/requests/update_payment_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .payment import PaymentParams diff --git a/src/square/requests/update_scheduled_shift_response.py b/src/square/requests/update_scheduled_shift_response.py index 654f2df2..fcc21e63 100644 --- a/src/square/requests/update_scheduled_shift_response.py +++ b/src/square/requests/update_scheduled_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .scheduled_shift import ScheduledShiftParams +import typing +from .error import ErrorParams class UpdateScheduledShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_shift_response.py b/src/square/requests/update_shift_response.py index 190b0a10..1749ba06 100644 --- a/src/square/requests/update_shift_response.py +++ b/src/square/requests/update_shift_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .shift import ShiftParams +import typing +from .error import ErrorParams class UpdateShiftResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_subscription_response.py b/src/square/requests/update_subscription_response.py index 522752d5..3dd0e07f 100644 --- a/src/square/requests/update_subscription_response.py +++ b/src/square/requests/update_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .subscription import SubscriptionParams diff --git a/src/square/requests/update_team_member_request.py b/src/square/requests/update_team_member_request.py index ad652136..d03dfcff 100644 --- a/src/square/requests/update_team_member_request.py +++ b/src/square/requests/update_team_member_request.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from .team_member import TeamMemberParams diff --git a/src/square/requests/update_team_member_response.py b/src/square/requests/update_team_member_response.py index 72d8dc36..39f6ee3b 100644 --- a/src/square/requests/update_team_member_response.py +++ b/src/square/requests/update_team_member_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .team_member import TeamMemberParams +import typing +from .error import ErrorParams class UpdateTeamMemberResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_timecard_response.py b/src/square/requests/update_timecard_response.py index 313a6ab2..ead80da7 100644 --- a/src/square/requests/update_timecard_response.py +++ b/src/square/requests/update_timecard_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .timecard import TimecardParams +import typing +from .error import ErrorParams class UpdateTimecardResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_transfer_order_data.py b/src/square/requests/update_transfer_order_data.py deleted file mode 100644 index c16f8b15..00000000 --- a/src/square/requests/update_transfer_order_data.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .update_transfer_order_line_data import UpdateTransferOrderLineDataParams - - -class UpdateTransferOrderDataParams(typing_extensions.TypedDict): - """ - Data model for updating a transfer order. All fields are optional. - """ - - source_location_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The source [Location](entity:Location) that will send the items. Must be an active location - in your Square account with sufficient inventory of the requested items. - """ - - destination_location_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - The destination [Location](entity:Location) that will receive the items. Must be an active location - in your Square account. - """ - - expected_at: typing_extensions.NotRequired[typing.Optional[str]] - """ - Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). - """ - - notes: typing_extensions.NotRequired[typing.Optional[str]] - """ - Optional notes about the transfer - """ - - tracking_number: typing_extensions.NotRequired[typing.Optional[str]] - """ - Shipment tracking number - """ - - line_items: typing_extensions.NotRequired[typing.Optional[typing.Sequence[UpdateTransferOrderLineDataParams]]] - """ - List of items being transferred - """ diff --git a/src/square/requests/update_transfer_order_line_data.py b/src/square/requests/update_transfer_order_line_data.py deleted file mode 100644 index ce5982df..00000000 --- a/src/square/requests/update_transfer_order_line_data.py +++ /dev/null @@ -1,33 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions - - -class UpdateTransferOrderLineDataParams(typing_extensions.TypedDict): - """ - Represents a line item update in a transfer order - """ - - uid: typing_extensions.NotRequired[typing.Optional[str]] - """ - Line item id being updated. Required for updating/removing existing line items, but should not be set for new line items. - """ - - item_variation_id: typing_extensions.NotRequired[typing.Optional[str]] - """ - Catalog item variation being transferred - - Required for new line items, but otherwise is not updatable. - """ - - quantity_ordered: typing_extensions.NotRequired[typing.Optional[str]] - """ - Total quantity ordered - """ - - remove: typing_extensions.NotRequired[typing.Optional[bool]] - """ - Flag to remove the line item during update. Must include `uid` in removal request - """ diff --git a/src/square/requests/update_transfer_order_response.py b/src/square/requests/update_transfer_order_response.py deleted file mode 100644 index cff2fe53..00000000 --- a/src/square/requests/update_transfer_order_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams -from .transfer_order import TransferOrderParams - - -class UpdateTransferOrderResponseParams(typing_extensions.TypedDict): - """ - Response for updating a transfer order - """ - - transfer_order: typing_extensions.NotRequired[TransferOrderParams] - """ - The updated transfer order - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request - """ diff --git a/src/square/requests/update_vendor_request.py b/src/square/requests/update_vendor_request.py index 04176e0c..743d10d1 100644 --- a/src/square/requests/update_vendor_request.py +++ b/src/square/requests/update_vendor_request.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .vendor import VendorParams diff --git a/src/square/requests/update_vendor_response.py b/src/square/requests/update_vendor_response.py index 05805b99..7f650293 100644 --- a/src/square/requests/update_vendor_response.py +++ b/src/square/requests/update_vendor_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .vendor import VendorParams diff --git a/src/square/requests/update_wage_setting_response.py b/src/square/requests/update_wage_setting_response.py index 401d762c..78cc16a1 100644 --- a/src/square/requests/update_wage_setting_response.py +++ b/src/square/requests/update_wage_setting_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .wage_setting import WageSettingParams +import typing +from .error import ErrorParams class UpdateWageSettingResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/update_webhook_subscription_response.py b/src/square/requests/update_webhook_subscription_response.py index 179c0804..35207ef1 100644 --- a/src/square/requests/update_webhook_subscription_response.py +++ b/src/square/requests/update_webhook_subscription_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .webhook_subscription import WebhookSubscriptionParams diff --git a/src/square/requests/update_webhook_subscription_signature_key_response.py b/src/square/requests/update_webhook_subscription_signature_key_response.py index 7d1293a1..7c32029e 100644 --- a/src/square/requests/update_webhook_subscription_signature_key_response.py +++ b/src/square/requests/update_webhook_subscription_signature_key_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/update_workweek_config_response.py b/src/square/requests/update_workweek_config_response.py index fab22faa..81f65126 100644 --- a/src/square/requests/update_workweek_config_response.py +++ b/src/square/requests/update_workweek_config_response.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .error import ErrorParams +import typing_extensions from .workweek_config import WorkweekConfigParams +import typing +from .error import ErrorParams class UpdateWorkweekConfigResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/upsert_booking_custom_attribute_response.py b/src/square/requests/upsert_booking_custom_attribute_response.py index 2dd695c3..b6f5f746 100644 --- a/src/square/requests/upsert_booking_custom_attribute_response.py +++ b/src/square/requests/upsert_booking_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/upsert_catalog_object_response.py b/src/square/requests/upsert_catalog_object_response.py index 67111f36..eb5e362f 100644 --- a/src/square/requests/upsert_catalog_object_response.py +++ b/src/square/requests/upsert_catalog_object_response.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from .catalog_id_mapping import CatalogIdMappingParams -from .catalog_object import CatalogObjectParams +import typing_extensions +import typing from .error import ErrorParams +from .catalog_object import CatalogObjectParams +from .catalog_id_mapping import CatalogIdMappingParams class UpsertCatalogObjectResponseParams(typing_extensions.TypedDict): diff --git a/src/square/requests/upsert_customer_custom_attribute_response.py b/src/square/requests/upsert_customer_custom_attribute_response.py index bd1002f7..23b67899 100644 --- a/src/square/requests/upsert_customer_custom_attribute_response.py +++ b/src/square/requests/upsert_customer_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/upsert_location_custom_attribute_response.py b/src/square/requests/upsert_location_custom_attribute_response.py index 0426d562..7db6da5b 100644 --- a/src/square/requests/upsert_location_custom_attribute_response.py +++ b/src/square/requests/upsert_location_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/upsert_merchant_custom_attribute_response.py b/src/square/requests/upsert_merchant_custom_attribute_response.py index e747c16a..27d98a1e 100644 --- a/src/square/requests/upsert_merchant_custom_attribute_response.py +++ b/src/square/requests/upsert_merchant_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/upsert_order_custom_attribute_response.py b/src/square/requests/upsert_order_custom_attribute_response.py index 820cfe5f..0719be3c 100644 --- a/src/square/requests/upsert_order_custom_attribute_response.py +++ b/src/square/requests/upsert_order_custom_attribute_response.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions import typing_extensions from .custom_attribute import CustomAttributeParams +import typing from .error import ErrorParams diff --git a/src/square/requests/upsert_snippet_response.py b/src/square/requests/upsert_snippet_response.py index 6921aa03..3adff5bf 100644 --- a/src/square/requests/upsert_snippet_response.py +++ b/src/square/requests/upsert_snippet_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams from .snippet import SnippetParams diff --git a/src/square/requests/v1money.py b/src/square/requests/v1money.py index 0e4fa4c2..edf44a20 100644 --- a/src/square/requests/v1money.py +++ b/src/square/requests/v1money.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from ..types.currency import Currency diff --git a/src/square/requests/v1order.py b/src/square/requests/v1order.py index 020a1b93..d9a68c9c 100644 --- a/src/square/requests/v1order.py +++ b/src/square/requests/v1order.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing +from .error import ErrorParams from ..types.v1order_state import V1OrderState from .address import AddressParams -from .error import ErrorParams from .v1money import V1MoneyParams -from .v1order_history_entry import V1OrderHistoryEntryParams from .v1tender import V1TenderParams +from .v1order_history_entry import V1OrderHistoryEntryParams class V1OrderParams(typing_extensions.TypedDict): diff --git a/src/square/requests/v1order_history_entry.py b/src/square/requests/v1order_history_entry.py index a4ffb99c..6ee178be 100644 --- a/src/square/requests/v1order_history_entry.py +++ b/src/square/requests/v1order_history_entry.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.v1order_history_entry_action import V1OrderHistoryEntryAction diff --git a/src/square/requests/v1tender.py b/src/square/requests/v1tender.py index 2a45fe0c..63c1b9f9 100644 --- a/src/square/requests/v1tender.py +++ b/src/square/requests/v1tender.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +from ..types.v1tender_type import V1TenderType +import typing from ..types.v1tender_card_brand import V1TenderCardBrand from ..types.v1tender_entry_method import V1TenderEntryMethod -from ..types.v1tender_type import V1TenderType from .v1money import V1MoneyParams diff --git a/src/square/requests/vendor.py b/src/square/requests/vendor.py index bbb1247f..7e2db184 100644 --- a/src/square/requests/vendor.py +++ b/src/square/requests/vendor.py @@ -1,11 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions -from ..types.vendor_status import VendorStatus +import typing_extensions +import typing from .address import AddressParams from .vendor_contact import VendorContactParams +from ..types.vendor_status import VendorStatus class VendorParams(typing_extensions.TypedDict): diff --git a/src/square/requests/vendor_contact.py b/src/square/requests/vendor_contact.py index c7cf2d65..bb0b7cc0 100644 --- a/src/square/requests/vendor_contact.py +++ b/src/square/requests/vendor_contact.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class VendorContactParams(typing_extensions.TypedDict): diff --git a/src/square/requests/vendor_created_event.py b/src/square/requests/vendor_created_event.py index d441df10..7408448e 100644 --- a/src/square/requests/vendor_created_event.py +++ b/src/square/requests/vendor_created_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .vendor_created_event_data import VendorCreatedEventDataParams diff --git a/src/square/requests/vendor_created_event_data.py b/src/square/requests/vendor_created_event_data.py index b75b8fe6..68a245a2 100644 --- a/src/square/requests/vendor_created_event_data.py +++ b/src/square/requests/vendor_created_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .vendor_created_event_object import VendorCreatedEventObjectParams diff --git a/src/square/requests/vendor_created_event_object.py b/src/square/requests/vendor_created_event_object.py index 0c72b421..7d6f2286 100644 --- a/src/square/requests/vendor_created_event_object.py +++ b/src/square/requests/vendor_created_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.vendor_created_event_object_operation import VendorCreatedEventObjectOperation from .vendor import VendorParams diff --git a/src/square/requests/vendor_updated_event.py b/src/square/requests/vendor_updated_event.py index 0c33d282..653c88e3 100644 --- a/src/square/requests/vendor_updated_event.py +++ b/src/square/requests/vendor_updated_event.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .vendor_updated_event_data import VendorUpdatedEventDataParams diff --git a/src/square/requests/vendor_updated_event_data.py b/src/square/requests/vendor_updated_event_data.py index 5ee1813f..423490ab 100644 --- a/src/square/requests/vendor_updated_event_data.py +++ b/src/square/requests/vendor_updated_event_data.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .vendor_updated_event_object import VendorUpdatedEventObjectParams diff --git a/src/square/requests/vendor_updated_event_object.py b/src/square/requests/vendor_updated_event_object.py index e5daa87e..e15e4ca9 100644 --- a/src/square/requests/vendor_updated_event_object.py +++ b/src/square/requests/vendor_updated_event_object.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.vendor_updated_event_object_operation import VendorUpdatedEventObjectOperation from .vendor import VendorParams diff --git a/src/square/requests/void_transaction_response.py b/src/square/requests/void_transaction_response.py index dab4a82e..cf83738f 100644 --- a/src/square/requests/void_transaction_response.py +++ b/src/square/requests/void_transaction_response.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .error import ErrorParams diff --git a/src/square/requests/wage_setting.py b/src/square/requests/wage_setting.py index d077c8fe..823db935 100644 --- a/src/square/requests/wage_setting.py +++ b/src/square/requests/wage_setting.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing from .job_assignment import JobAssignmentParams diff --git a/src/square/requests/webhook_subscription.py b/src/square/requests/webhook_subscription.py index 72d71dd4..e479801e 100644 --- a/src/square/requests/webhook_subscription.py +++ b/src/square/requests/webhook_subscription.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions +import typing_extensions +import typing class WebhookSubscriptionParams(typing_extensions.TypedDict): diff --git a/src/square/requests/workweek_config.py b/src/square/requests/workweek_config.py index ade9d7fb..defc9435 100644 --- a/src/square/requests/workweek_config.py +++ b/src/square/requests/workweek_config.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import typing_extensions import typing_extensions from ..types.weekday import Weekday diff --git a/src/square/sites/__init__.py b/src/square/sites/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/sites/__init__.py +++ b/src/square/sites/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/sites/client.py b/src/square/sites/client.py index aae113f8..4cecbc39 100644 --- a/src/square/sites/client.py +++ b/src/square/sites/client.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawSitesClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.list_sites_response import ListSitesResponse -from .raw_client import AsyncRawSitesClient, RawSitesClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawSitesClient class SitesClient: @@ -49,8 +50,8 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Li ) client.sites.list() """ - _response = self._raw_client.list(request_options=request_options) - return _response.data + response = self._raw_client.list(request_options=request_options) + return response.data class AsyncSitesClient: @@ -102,5 +103,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list(request_options=request_options) - return _response.data + response = await self._raw_client.list(request_options=request_options) + return response.data diff --git a/src/square/sites/raw_client.py b/src/square/sites/raw_client.py index 67ee2a44..b9804ed4 100644 --- a/src/square/sites/raw_client.py +++ b/src/square/sites/raw_client.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.http_response import HttpResponse from ..types.list_sites_response import ListSitesResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawSitesClient: @@ -49,8 +50,8 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Ht return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawSitesClient: @@ -93,5 +94,5 @@ async def list( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/snippets/__init__.py b/src/square/snippets/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/snippets/__init__.py +++ b/src/square/snippets/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/snippets/client.py b/src/square/snippets/client.py index 0257aff6..cd80df90 100644 --- a/src/square/snippets/client.py +++ b/src/square/snippets/client.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawSnippetsClient from ..core.request_options import RequestOptions -from ..requests.snippet import SnippetParams -from ..types.delete_snippet_response import DeleteSnippetResponse from ..types.get_snippet_response import GetSnippetResponse +from ..requests.snippet import SnippetParams from ..types.upsert_snippet_response import UpsertSnippetResponse -from .raw_client import AsyncRawSnippetsClient, RawSnippetsClient +from ..types.delete_snippet_response import DeleteSnippetResponse +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawSnippetsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -62,8 +63,8 @@ def get(self, site_id: str, *, request_options: typing.Optional[RequestOptions] site_id="site_id", ) """ - _response = self._raw_client.get(site_id, request_options=request_options) - return _response.data + response = self._raw_client.get(site_id, request_options=request_options) + return response.data def upsert( self, site_id: str, *, snippet: SnippetParams, request_options: typing.Optional[RequestOptions] = None @@ -105,8 +106,8 @@ def upsert( snippet={"content": ""}, ) """ - _response = self._raw_client.upsert(site_id, snippet=snippet, request_options=request_options) - return _response.data + response = self._raw_client.upsert(site_id, snippet=snippet, request_options=request_options) + return response.data def delete(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeleteSnippetResponse: """ @@ -141,8 +142,8 @@ def delete(self, site_id: str, *, request_options: typing.Optional[RequestOption site_id="site_id", ) """ - _response = self._raw_client.delete(site_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(site_id, request_options=request_options) + return response.data class AsyncSnippetsClient: @@ -201,8 +202,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(site_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(site_id, request_options=request_options) + return response.data async def upsert( self, site_id: str, *, snippet: SnippetParams, request_options: typing.Optional[RequestOptions] = None @@ -252,8 +253,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.upsert(site_id, snippet=snippet, request_options=request_options) - return _response.data + response = await self._raw_client.upsert(site_id, snippet=snippet, request_options=request_options) + return response.data async def delete( self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -298,5 +299,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(site_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(site_id, request_options=request_options) + return response.data diff --git a/src/square/snippets/raw_client.py b/src/square/snippets/raw_client.py index a327c08e..bc576437 100644 --- a/src/square/snippets/raw_client.py +++ b/src/square/snippets/raw_client.py @@ -1,19 +1,20 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.http_response import HttpResponse +from ..types.get_snippet_response import GetSnippetResponse +from ..core.jsonable_encoder import jsonable_encoder from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.snippet import SnippetParams -from ..types.delete_snippet_response import DeleteSnippetResponse -from ..types.get_snippet_response import GetSnippetResponse from ..types.upsert_snippet_response import UpsertSnippetResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from ..types.delete_snippet_response import DeleteSnippetResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -64,8 +65,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def upsert( self, site_id: str, *, snippet: SnippetParams, request_options: typing.Optional[RequestOptions] = None @@ -121,8 +122,8 @@ def upsert( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -165,8 +166,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawSnippetsClient: @@ -214,8 +215,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def upsert( self, site_id: str, *, snippet: SnippetParams, request_options: typing.Optional[RequestOptions] = None @@ -271,8 +272,8 @@ async def upsert( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -315,5 +316,5 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/subscriptions/__init__.py b/src/square/subscriptions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/subscriptions/__init__.py +++ b/src/square/subscriptions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/subscriptions/client.py b/src/square/subscriptions/client.py index b4ebec5e..6aa3ab88 100644 --- a/src/square/subscriptions/client.py +++ b/src/square/subscriptions/client.py @@ -1,31 +1,37 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawSubscriptionsClient from ..requests.money import MoneyParams +from ..requests.subscription_source import SubscriptionSourceParams from ..requests.phase import PhaseParams -from ..requests.phase_input import PhaseInputParams +from ..core.request_options import RequestOptions +from ..types.create_subscription_response import CreateSubscriptionResponse +from ..types.bulk_swap_plan_response import BulkSwapPlanResponse from ..requests.search_subscriptions_query import SearchSubscriptionsQueryParams +from ..types.search_subscriptions_response import SearchSubscriptionsResponse +from ..types.get_subscription_response import GetSubscriptionResponse from ..requests.subscription import SubscriptionParams -from ..requests.subscription_source import SubscriptionSourceParams -from ..types.bulk_swap_plan_response import BulkSwapPlanResponse -from ..types.cancel_subscription_response import CancelSubscriptionResponse -from ..types.change_billing_anchor_date_response import ChangeBillingAnchorDateResponse -from ..types.change_timing import ChangeTiming -from ..types.create_subscription_response import CreateSubscriptionResponse +from ..types.update_subscription_response import UpdateSubscriptionResponse from ..types.delete_subscription_action_response import DeleteSubscriptionActionResponse -from ..types.get_subscription_response import GetSubscriptionResponse +from ..types.change_billing_anchor_date_response import ChangeBillingAnchorDateResponse +from ..types.cancel_subscription_response import CancelSubscriptionResponse +from ..core.pagination import SyncPager +from ..types.subscription_event import SubscriptionEvent +from ..core.jsonable_encoder import jsonable_encoder from ..types.list_subscription_events_response import ListSubscriptionEventsResponse +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.change_timing import ChangeTiming from ..types.pause_subscription_response import PauseSubscriptionResponse from ..types.resume_subscription_response import ResumeSubscriptionResponse -from ..types.search_subscriptions_response import SearchSubscriptionsResponse -from ..types.subscription_event import SubscriptionEvent +from ..requests.phase_input import PhaseInputParams from ..types.swap_plan_response import SwapPlanResponse -from ..types.update_subscription_response import UpdateSubscriptionResponse -from .raw_client import AsyncRawSubscriptionsClient, RawSubscriptionsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawSubscriptionsClient +from ..core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -104,7 +110,7 @@ def create( at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` - occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription + occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription stops through the end of the last cycle. tax_percentage : typing.Optional[str] @@ -166,7 +172,7 @@ def create( ], ) """ - _response = self._raw_client.create( + response = self._raw_client.create( location_id=location_id, customer_id=customer_id, idempotency_key=idempotency_key, @@ -182,7 +188,7 @@ def create( phases=phases, request_options=request_options, ) - return _response.data + return response.data def bulk_swap_plan( self, @@ -232,13 +238,13 @@ def bulk_swap_plan( location_id="S8GWD5R9QB376", ) """ - _response = self._raw_client.bulk_swap_plan( + response = self._raw_client.bulk_swap_plan( new_plan_variation_id=new_plan_variation_id, old_plan_variation_id=old_plan_variation_id, location_id=location_id, request_options=request_options, ) - return _response.data + return response.data def search( self, @@ -315,10 +321,10 @@ def search( }, ) """ - _response = self._raw_client.search( + response = self._raw_client.search( cursor=cursor, limit=limit, query=query, include=include, request_options=request_options ) - return _response.data + return response.data def get( self, @@ -362,8 +368,8 @@ def get( include="include", ) """ - _response = self._raw_client.get(subscription_id, include=include, request_options=request_options) - return _response.data + response = self._raw_client.get(subscription_id, include=include, request_options=request_options) + return response.data def update( self, @@ -406,8 +412,8 @@ def update( subscription={"card_id": "{NEW CARD ID}"}, ) """ - _response = self._raw_client.update(subscription_id, subscription=subscription, request_options=request_options) - return _response.data + response = self._raw_client.update(subscription_id, subscription=subscription, request_options=request_options) + return response.data def delete_action( self, subscription_id: str, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -443,8 +449,8 @@ def delete_action( action_id="action_id", ) """ - _response = self._raw_client.delete_action(subscription_id, action_id, request_options=request_options) - return _response.data + response = self._raw_client.delete_action(subscription_id, action_id, request_options=request_options) + return response.data def change_billing_anchor_date( self, @@ -493,13 +499,13 @@ def change_billing_anchor_date( monthly_billing_anchor_date=1, ) """ - _response = self._raw_client.change_billing_anchor_date( + response = self._raw_client.change_billing_anchor_date( subscription_id, monthly_billing_anchor_date=monthly_billing_anchor_date, effective_date=effective_date, request_options=request_options, ) - return _response.data + return response.data def cancel( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -533,8 +539,8 @@ def cancel( subscription_id="subscription_id", ) """ - _response = self._raw_client.cancel(subscription_id, request_options=request_options) - return _response.data + response = self._raw_client.cancel(subscription_id, request_options=request_options) + return response.data def list_events( self, @@ -543,7 +549,7 @@ def list_events( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: + ) -> SyncPager[SubscriptionEvent]: """ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. @@ -568,7 +574,7 @@ def list_events( Returns ------- - SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] + SyncPager[SubscriptionEvent] Success Examples @@ -589,9 +595,38 @@ def list_events( for page in response.iter_pages(): yield page """ - return self._raw_client.list_events( - subscription_id, cursor=cursor, limit=limit, request_options=request_options + _response = self._raw_client._client_wrapper.httpx_client.request( + f"v2/subscriptions/{jsonable_encoder(subscription_id)}/events", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListSubscriptionEventsResponse, + construct_type( + type_=ListSubscriptionEventsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list_events( + subscription_id, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.subscription_events + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def pause( self, @@ -656,7 +691,7 @@ def pause( subscription_id="subscription_id", ) """ - _response = self._raw_client.pause( + response = self._raw_client.pause( subscription_id, pause_effective_date=pause_effective_date, pause_cycle_duration=pause_cycle_duration, @@ -665,7 +700,7 @@ def pause( pause_reason=pause_reason, request_options=request_options, ) - return _response.data + return response.data def resume( self, @@ -710,13 +745,13 @@ def resume( subscription_id="subscription_id", ) """ - _response = self._raw_client.resume( + response = self._raw_client.resume( subscription_id, resume_effective_date=resume_effective_date, resume_change_timing=resume_change_timing, request_options=request_options, ) - return _response.data + return response.data def swap_plan( self, @@ -766,10 +801,10 @@ def swap_plan( ], ) """ - _response = self._raw_client.swap_plan( + response = self._raw_client.swap_plan( subscription_id, new_plan_variation_id=new_plan_variation_id, phases=phases, request_options=request_options ) - return _response.data + return response.data class AsyncSubscriptionsClient: @@ -845,7 +880,7 @@ async def create( at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` - occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription + occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription stops through the end of the last cycle. tax_percentage : typing.Optional[str] @@ -915,7 +950,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( location_id=location_id, customer_id=customer_id, idempotency_key=idempotency_key, @@ -931,7 +966,7 @@ async def main() -> None: phases=phases, request_options=request_options, ) - return _response.data + return response.data async def bulk_swap_plan( self, @@ -989,13 +1024,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.bulk_swap_plan( + response = await self._raw_client.bulk_swap_plan( new_plan_variation_id=new_plan_variation_id, old_plan_variation_id=old_plan_variation_id, location_id=location_id, request_options=request_options, ) - return _response.data + return response.data async def search( self, @@ -1080,10 +1115,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( cursor=cursor, limit=limit, query=query, include=include, request_options=request_options ) - return _response.data + return response.data async def get( self, @@ -1135,8 +1170,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(subscription_id, include=include, request_options=request_options) - return _response.data + response = await self._raw_client.get(subscription_id, include=include, request_options=request_options) + return response.data async def update( self, @@ -1187,10 +1222,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( subscription_id, subscription=subscription, request_options=request_options ) - return _response.data + return response.data async def delete_action( self, subscription_id: str, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1234,8 +1269,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete_action(subscription_id, action_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete_action(subscription_id, action_id, request_options=request_options) + return response.data async def change_billing_anchor_date( self, @@ -1292,13 +1327,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.change_billing_anchor_date( + response = await self._raw_client.change_billing_anchor_date( subscription_id, monthly_billing_anchor_date=monthly_billing_anchor_date, effective_date=effective_date, request_options=request_options, ) - return _response.data + return response.data async def cancel( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1340,8 +1375,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(subscription_id, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(subscription_id, request_options=request_options) + return response.data async def list_events( self, @@ -1350,7 +1385,7 @@ async def list_events( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: + ) -> AsyncPager[SubscriptionEvent]: """ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. @@ -1375,7 +1410,7 @@ async def list_events( Returns ------- - AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] + AsyncPager[SubscriptionEvent] Success Examples @@ -1397,7 +1432,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -1405,9 +1439,38 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list_events( - subscription_id, cursor=cursor, limit=limit, request_options=request_options + _response = await self._raw_client._client_wrapper.httpx_client.request( + f"v2/subscriptions/{jsonable_encoder(subscription_id)}/events", + method="GET", + params={ + "cursor": cursor, + "limit": limit, + }, + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListSubscriptionEventsResponse, + construct_type( + type_=ListSubscriptionEventsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list_events( + subscription_id, + cursor=_parsed_next, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.subscription_events + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def pause( self, @@ -1480,7 +1543,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.pause( + response = await self._raw_client.pause( subscription_id, pause_effective_date=pause_effective_date, pause_cycle_duration=pause_cycle_duration, @@ -1489,7 +1552,7 @@ async def main() -> None: pause_reason=pause_reason, request_options=request_options, ) - return _response.data + return response.data async def resume( self, @@ -1542,13 +1605,13 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.resume( + response = await self._raw_client.resume( subscription_id, resume_effective_date=resume_effective_date, resume_change_timing=resume_change_timing, request_options=request_options, ) - return _response.data + return response.data async def swap_plan( self, @@ -1606,7 +1669,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.swap_plan( + response = await self._raw_client.swap_plan( subscription_id, new_plan_variation_id=new_plan_variation_id, phases=phases, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/subscriptions/raw_client.py b/src/square/subscriptions/raw_client.py index da656ca0..299bfa56 100644 --- a/src/square/subscriptions/raw_client.py +++ b/src/square/subscriptions/raw_client.py @@ -1,36 +1,34 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager +from ..core.client_wrapper import SyncClientWrapper +from ..requests.money import MoneyParams +from ..requests.subscription_source import SubscriptionSourceParams +from ..requests.phase import PhaseParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_subscription_response import CreateSubscriptionResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.money import MoneyParams -from ..requests.phase import PhaseParams -from ..requests.phase_input import PhaseInputParams +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.bulk_swap_plan_response import BulkSwapPlanResponse from ..requests.search_subscriptions_query import SearchSubscriptionsQueryParams +from ..types.search_subscriptions_response import SearchSubscriptionsResponse +from ..types.get_subscription_response import GetSubscriptionResponse +from ..core.jsonable_encoder import jsonable_encoder from ..requests.subscription import SubscriptionParams -from ..requests.subscription_source import SubscriptionSourceParams -from ..types.bulk_swap_plan_response import BulkSwapPlanResponse -from ..types.cancel_subscription_response import CancelSubscriptionResponse +from ..types.update_subscription_response import UpdateSubscriptionResponse +from ..types.delete_subscription_action_response import DeleteSubscriptionActionResponse from ..types.change_billing_anchor_date_response import ChangeBillingAnchorDateResponse +from ..types.cancel_subscription_response import CancelSubscriptionResponse from ..types.change_timing import ChangeTiming -from ..types.create_subscription_response import CreateSubscriptionResponse -from ..types.delete_subscription_action_response import DeleteSubscriptionActionResponse -from ..types.get_subscription_response import GetSubscriptionResponse -from ..types.list_subscription_events_response import ListSubscriptionEventsResponse from ..types.pause_subscription_response import PauseSubscriptionResponse from ..types.resume_subscription_response import ResumeSubscriptionResponse -from ..types.search_subscriptions_response import SearchSubscriptionsResponse -from ..types.subscription_event import SubscriptionEvent +from ..requests.phase_input import PhaseInputParams from ..types.swap_plan_response import SwapPlanResponse -from ..types.update_subscription_response import UpdateSubscriptionResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -98,7 +96,7 @@ def create( at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` - occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription + occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription stops through the end of the last cycle. tax_percentage : typing.Optional[str] @@ -181,8 +179,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def bulk_swap_plan( self, @@ -245,8 +243,8 @@ def bulk_swap_plan( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -335,8 +333,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, @@ -388,8 +386,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -446,8 +444,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete_action( self, subscription_id: str, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -488,8 +486,8 @@ def delete_action( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def change_billing_anchor_date( self, @@ -551,8 +549,8 @@ def change_billing_anchor_date( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -592,76 +590,8 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def list_events( - self, - subscription_id: str, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: - """ - Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. - - Parameters - ---------- - subscription_id : str - The ID of the subscription to retrieve the events for. - - cursor : typing.Optional[str] - When the total number of resulting subscription events exceeds the limit of a paged response, - specify the cursor returned from a preceding response here to fetch the next set of results. - If the cursor is unset, the response contains the last page of the results. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The upper limit on the number of subscription events to return - in a paged response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/subscriptions/{jsonable_encoder(subscription_id)}/events", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListSubscriptionEventsResponse, - construct_type( - type_=ListSubscriptionEventsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.subscription_events - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list_events( - subscription_id, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def pause( self, @@ -743,8 +673,8 @@ def pause( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def resume( self, @@ -803,8 +733,8 @@ def resume( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def swap_plan( self, @@ -866,8 +796,8 @@ def swap_plan( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawSubscriptionsClient: @@ -932,7 +862,7 @@ async def create( at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` - occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription + occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription stops through the end of the last cycle. tax_percentage : typing.Optional[str] @@ -1015,8 +945,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def bulk_swap_plan( self, @@ -1079,8 +1009,8 @@ async def bulk_swap_plan( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -1169,8 +1099,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, @@ -1222,8 +1152,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -1280,8 +1210,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete_action( self, subscription_id: str, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1322,8 +1252,8 @@ async def delete_action( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def change_billing_anchor_date( self, @@ -1385,8 +1315,8 @@ async def change_billing_anchor_date( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -1426,79 +1356,8 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def list_events( - self, - subscription_id: str, - *, - cursor: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: - """ - Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. - - Parameters - ---------- - subscription_id : str - The ID of the subscription to retrieve the events for. - - cursor : typing.Optional[str] - When the total number of resulting subscription events exceeds the limit of a paged response, - specify the cursor returned from a preceding response here to fetch the next set of results. - If the cursor is unset, the response contains the last page of the results. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - limit : typing.Optional[int] - The upper limit on the number of subscription events to return - in a paged response. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/subscriptions/{jsonable_encoder(subscription_id)}/events", - method="GET", - params={ - "cursor": cursor, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListSubscriptionEventsResponse, - construct_type( - type_=ListSubscriptionEventsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.subscription_events - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list_events( - subscription_id, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def pause( self, @@ -1580,8 +1439,8 @@ async def pause( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def resume( self, @@ -1640,8 +1499,8 @@ async def resume( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def swap_plan( self, @@ -1703,5 +1562,5 @@ async def swap_plan( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/team/__init__.py b/src/square/team/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/team/__init__.py +++ b/src/square/team/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/team/client.py b/src/square/team/client.py index 00da1e88..8f85fa96 100644 --- a/src/square/team/client.py +++ b/src/square/team/client.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawTeamClient from ..core.request_options import RequestOptions +from ..types.list_jobs_response import ListJobsResponse from ..requests.job import JobParams from ..types.create_job_response import CreateJobResponse -from ..types.list_jobs_response import ListJobsResponse from ..types.retrieve_job_response import RetrieveJobResponse from ..types.update_job_response import UpdateJobResponse -from .raw_client import AsyncRawTeamClient, RawTeamClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawTeamClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -62,8 +63,8 @@ def list_jobs( cursor="cursor", ) """ - _response = self._raw_client.list_jobs(cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.list_jobs(cursor=cursor, request_options=request_options) + return response.data def create_job( self, *, job: JobParams, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -102,10 +103,10 @@ def create_job( idempotency_key="idempotency-key-0", ) """ - _response = self._raw_client.create_job( + response = self._raw_client.create_job( job=job, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def retrieve_job( self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -137,8 +138,8 @@ def retrieve_job( job_id="job_id", ) """ - _response = self._raw_client.retrieve_job(job_id, request_options=request_options) - return _response.data + response = self._raw_client.retrieve_job(job_id, request_options=request_options) + return response.data def update_job( self, job_id: str, *, job: JobParams, request_options: typing.Optional[RequestOptions] = None @@ -177,8 +178,8 @@ def update_job( job={"title": "Cashier 1", "is_tip_eligible": True}, ) """ - _response = self._raw_client.update_job(job_id, job=job, request_options=request_options) - return _response.data + response = self._raw_client.update_job(job_id, job=job, request_options=request_options) + return response.data class AsyncTeamClient: @@ -236,8 +237,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list_jobs(cursor=cursor, request_options=request_options) - return _response.data + response = await self._raw_client.list_jobs(cursor=cursor, request_options=request_options) + return response.data async def create_job( self, *, job: JobParams, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -284,10 +285,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create_job( + response = await self._raw_client.create_job( job=job, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def retrieve_job( self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -327,8 +328,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.retrieve_job(job_id, request_options=request_options) - return _response.data + response = await self._raw_client.retrieve_job(job_id, request_options=request_options) + return response.data async def update_job( self, job_id: str, *, job: JobParams, request_options: typing.Optional[RequestOptions] = None @@ -375,5 +376,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_job(job_id, job=job, request_options=request_options) - return _response.data + response = await self._raw_client.update_job(job_id, job=job, request_options=request_options) + return response.data diff --git a/src/square/team/raw_client.py b/src/square/team/raw_client.py index cdcbd1e7..f614e329 100644 --- a/src/square/team/raw_client.py +++ b/src/square/team/raw_client.py @@ -1,20 +1,21 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.http_response import HttpResponse +from ..types.list_jobs_response import ListJobsResponse from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.job import JobParams from ..types.create_job_response import CreateJobResponse -from ..types.list_jobs_response import ListJobsResponse +from ..core.serialization import convert_and_respect_annotation_metadata from ..types.retrieve_job_response import RetrieveJobResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.update_job_response import UpdateJobResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -65,8 +66,8 @@ def list_jobs( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create_job( self, *, job: JobParams, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -118,8 +119,8 @@ def create_job( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def retrieve_job( self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -157,8 +158,8 @@ def retrieve_job( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_job( self, job_id: str, *, job: JobParams, request_options: typing.Optional[RequestOptions] = None @@ -209,8 +210,8 @@ def update_job( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawTeamClient: @@ -258,8 +259,8 @@ async def list_jobs( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create_job( self, *, job: JobParams, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None @@ -311,8 +312,8 @@ async def create_job( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def retrieve_job( self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -350,8 +351,8 @@ async def retrieve_job( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_job( self, job_id: str, *, job: JobParams, request_options: typing.Optional[RequestOptions] = None @@ -402,5 +403,5 @@ async def update_job( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/team_members/__init__.py b/src/square/team_members/__init__.py index 9ab60957..437b8e02 100644 --- a/src/square/team_members/__init__.py +++ b/src/square/team_members/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import wage_setting -_dynamic_imports: typing.Dict[str, str] = {"wage_setting": ".wage_setting"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import wage_setting __all__ = ["wage_setting"] diff --git a/src/square/team_members/client.py b/src/square/team_members/client.py index 9dc0559c..75ba050f 100644 --- a/src/square/team_members/client.py +++ b/src/square/team_members/client.py @@ -1,25 +1,24 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawTeamMembersClient +from .wage_setting.client import WageSettingClient +from ..requests.team_member import TeamMemberParams from ..core.request_options import RequestOptions +from ..types.create_team_member_response import CreateTeamMemberResponse from ..requests.create_team_member_request import CreateTeamMemberRequestParams -from ..requests.search_team_members_query import SearchTeamMembersQueryParams -from ..requests.team_member import TeamMemberParams -from ..requests.update_team_member_request import UpdateTeamMemberRequestParams from ..types.batch_create_team_members_response import BatchCreateTeamMembersResponse +from ..requests.update_team_member_request import UpdateTeamMemberRequestParams from ..types.batch_update_team_members_response import BatchUpdateTeamMembersResponse -from ..types.create_team_member_response import CreateTeamMemberResponse -from ..types.get_team_member_response import GetTeamMemberResponse +from ..requests.search_team_members_query import SearchTeamMembersQueryParams from ..types.search_team_members_response import SearchTeamMembersResponse +from ..types.get_team_member_response import GetTeamMemberResponse from ..types.update_team_member_response import UpdateTeamMemberResponse -from .raw_client import AsyncRawTeamMembersClient, RawTeamMembersClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawTeamMembersClient +from .wage_setting.client import AsyncWageSettingClient -if typing.TYPE_CHECKING: - from .wage_setting.client import AsyncWageSettingClient, WageSettingClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -27,8 +26,7 @@ class TeamMembersClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTeamMembersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._wage_setting: typing.Optional[WageSettingClient] = None + self.wage_setting = WageSettingClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTeamMembersClient: @@ -116,10 +114,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, team_member=team_member, request_options=request_options ) - return _response.data + return response.data def batch_create( self, @@ -189,8 +187,8 @@ def batch_create( }, ) """ - _response = self._raw_client.batch_create(team_members=team_members, request_options=request_options) - return _response.data + response = self._raw_client.batch_create(team_members=team_members, request_options=request_options) + return response.data def batch_update( self, @@ -264,8 +262,8 @@ def batch_update( }, ) """ - _response = self._raw_client.batch_update(team_members=team_members, request_options=request_options) - return _response.data + response = self._raw_client.batch_update(team_members=team_members, request_options=request_options) + return response.data def search( self, @@ -312,8 +310,8 @@ def search( limit=10, ) """ - _response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options) + return response.data def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -346,8 +344,8 @@ def get( team_member_id="team_member_id", ) """ - _response = self._raw_client.get(team_member_id, request_options=request_options) - return _response.data + response = self._raw_client.get(team_member_id, request_options=request_options) + return response.data def update( self, @@ -417,23 +415,14 @@ def update( }, ) """ - _response = self._raw_client.update(team_member_id, team_member=team_member, request_options=request_options) - return _response.data - - @property - def wage_setting(self): - if self._wage_setting is None: - from .wage_setting.client import WageSettingClient # noqa: E402 - - self._wage_setting = WageSettingClient(client_wrapper=self._client_wrapper) - return self._wage_setting + response = self._raw_client.update(team_member_id, team_member=team_member, request_options=request_options) + return response.data class AsyncTeamMembersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTeamMembersClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._wage_setting: typing.Optional[AsyncWageSettingClient] = None + self.wage_setting = AsyncWageSettingClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTeamMembersClient: @@ -529,10 +518,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, team_member=team_member, request_options=request_options ) - return _response.data + return response.data async def batch_create( self, @@ -610,8 +599,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_create(team_members=team_members, request_options=request_options) - return _response.data + response = await self._raw_client.batch_create(team_members=team_members, request_options=request_options) + return response.data async def batch_update( self, @@ -693,8 +682,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_update(team_members=team_members, request_options=request_options) - return _response.data + response = await self._raw_client.batch_update(team_members=team_members, request_options=request_options) + return response.data async def search( self, @@ -751,10 +740,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, limit=limit, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -795,8 +784,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(team_member_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(team_member_id, request_options=request_options) + return response.data async def update( self, @@ -874,15 +863,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( team_member_id, team_member=team_member, request_options=request_options ) - return _response.data - - @property - def wage_setting(self): - if self._wage_setting is None: - from .wage_setting.client import AsyncWageSettingClient # noqa: E402 - - self._wage_setting = AsyncWageSettingClient(client_wrapper=self._client_wrapper) - return self._wage_setting + return response.data diff --git a/src/square/team_members/raw_client.py b/src/square/team_members/raw_client.py index b47fbdf3..5be92401 100644 --- a/src/square/team_members/raw_client.py +++ b/src/square/team_members/raw_client.py @@ -1,25 +1,26 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper +from ..requests.team_member import TeamMemberParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.create_team_member_response import CreateTeamMemberResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..requests.create_team_member_request import CreateTeamMemberRequestParams -from ..requests.search_team_members_query import SearchTeamMembersQueryParams -from ..requests.team_member import TeamMemberParams -from ..requests.update_team_member_request import UpdateTeamMemberRequestParams from ..types.batch_create_team_members_response import BatchCreateTeamMembersResponse +from ..requests.update_team_member_request import UpdateTeamMemberRequestParams from ..types.batch_update_team_members_response import BatchUpdateTeamMembersResponse -from ..types.create_team_member_response import CreateTeamMemberResponse -from ..types.get_team_member_response import GetTeamMemberResponse +from ..requests.search_team_members_query import SearchTeamMembersQueryParams from ..types.search_team_members_response import SearchTeamMembersResponse +from ..types.get_team_member_response import GetTeamMemberResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.update_team_member_response import UpdateTeamMemberResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -74,9 +75,6 @@ def create( object_=team_member, annotation=TeamMemberParams, direction="write" ), }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -92,8 +90,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_create( self, @@ -152,8 +150,8 @@ def batch_create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_update( self, @@ -212,8 +210,8 @@ def batch_update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -276,8 +274,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -316,8 +314,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -356,9 +354,6 @@ def update( object_=team_member, annotation=TeamMemberParams, direction="write" ), }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -374,8 +369,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawTeamMembersClient: @@ -427,9 +422,6 @@ async def create( object_=team_member, annotation=TeamMemberParams, direction="write" ), }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -445,8 +437,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_create( self, @@ -505,8 +497,8 @@ async def batch_create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_update( self, @@ -565,8 +557,8 @@ async def batch_update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -629,8 +621,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -669,8 +661,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -709,9 +701,6 @@ async def update( object_=team_member, annotation=TeamMemberParams, direction="write" ), }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -727,5 +716,5 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/team_members/wage_setting/__init__.py b/src/square/team_members/wage_setting/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/team_members/wage_setting/__init__.py +++ b/src/square/team_members/wage_setting/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/team_members/wage_setting/client.py b/src/square/team_members/wage_setting/client.py index 9d5b4ccc..d355d32f 100644 --- a/src/square/team_members/wage_setting/client.py +++ b/src/square/team_members/wage_setting/client.py @@ -1,13 +1,14 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawWageSettingClient from ...core.request_options import RequestOptions -from ...requests.wage_setting import WageSettingParams from ...types.get_wage_setting_response import GetWageSettingResponse +from ...requests.wage_setting import WageSettingParams from ...types.update_wage_setting_response import UpdateWageSettingResponse -from .raw_client import AsyncRawWageSettingClient, RawWageSettingClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawWageSettingClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -63,8 +64,8 @@ def get( team_member_id="team_member_id", ) """ - _response = self._raw_client.get(team_member_id, request_options=request_options) - return _response.data + response = self._raw_client.get(team_member_id, request_options=request_options) + return response.data def update( self, @@ -130,8 +131,8 @@ def update( }, ) """ - _response = self._raw_client.update(team_member_id, wage_setting=wage_setting, request_options=request_options) - return _response.data + response = self._raw_client.update(team_member_id, wage_setting=wage_setting, request_options=request_options) + return response.data class AsyncWageSettingClient: @@ -192,8 +193,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(team_member_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(team_member_id, request_options=request_options) + return response.data async def update( self, @@ -267,7 +268,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( team_member_id, wage_setting=wage_setting, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/team_members/wage_setting/raw_client.py b/src/square/team_members/wage_setting/raw_client.py index 35ddec82..ba1be623 100644 --- a/src/square/team_members/wage_setting/raw_client.py +++ b/src/square/team_members/wage_setting/raw_client.py @@ -1,18 +1,19 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper from ...core.request_options import RequestOptions -from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.http_response import HttpResponse +from ...types.get_wage_setting_response import GetWageSettingResponse +from ...core.jsonable_encoder import jsonable_encoder from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.wage_setting import WageSettingParams -from ...types.get_wage_setting_response import GetWageSettingResponse from ...types.update_wage_setting_response import UpdateWageSettingResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -63,8 +64,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -129,8 +130,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawWageSettingClient: @@ -178,8 +179,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -244,5 +245,5 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/terminal/__init__.py b/src/square/terminal/__init__.py index 0f6c8376..c12a7ecb 100644 --- a/src/square/terminal/__init__.py +++ b/src/square/terminal/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import actions, checkouts, refunds -_dynamic_imports: typing.Dict[str, str] = {"actions": ".actions", "checkouts": ".checkouts", "refunds": ".refunds"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import actions, checkouts, refunds __all__ = ["actions", "checkouts", "refunds"] diff --git a/src/square/terminal/actions/__init__.py b/src/square/terminal/actions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/terminal/actions/__init__.py +++ b/src/square/terminal/actions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/terminal/actions/client.py b/src/square/terminal/actions/client.py index e7209de5..126745ec 100644 --- a/src/square/terminal/actions/client.py +++ b/src/square/terminal/actions/client.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawActionsClient from ...requests.terminal_action import TerminalActionParams -from ...requests.terminal_action_query import TerminalActionQueryParams -from ...types.cancel_terminal_action_response import CancelTerminalActionResponse +from ...core.request_options import RequestOptions from ...types.create_terminal_action_response import CreateTerminalActionResponse -from ...types.get_terminal_action_response import GetTerminalActionResponse +from ...requests.terminal_action_query import TerminalActionQueryParams from ...types.search_terminal_actions_response import SearchTerminalActionsResponse -from .raw_client import AsyncRawActionsClient, RawActionsClient +from ...types.get_terminal_action_response import GetTerminalActionResponse +from ...types.cancel_terminal_action_response import CancelTerminalActionResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawActionsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -81,10 +82,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, action=action, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -135,8 +136,8 @@ def search( limit=2, ) """ - _response = self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) + return response.data def get( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -168,8 +169,8 @@ def get( action_id="action_id", ) """ - _response = self._raw_client.get(action_id, request_options=request_options) - return _response.data + response = self._raw_client.get(action_id, request_options=request_options) + return response.data def cancel( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -201,8 +202,8 @@ def cancel( action_id="action_id", ) """ - _response = self._raw_client.cancel(action_id, request_options=request_options) - return _response.data + response = self._raw_client.cancel(action_id, request_options=request_options) + return response.data class AsyncActionsClient: @@ -278,10 +279,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, action=action, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -340,10 +341,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, cursor=cursor, limit=limit, request_options=request_options ) - return _response.data + return response.data async def get( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -383,8 +384,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(action_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(action_id, request_options=request_options) + return response.data async def cancel( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -424,5 +425,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(action_id, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(action_id, request_options=request_options) + return response.data diff --git a/src/square/terminal/actions/raw_client.py b/src/square/terminal/actions/raw_client.py index e65e41b5..7ad5ea69 100644 --- a/src/square/terminal/actions/raw_client.py +++ b/src/square/terminal/actions/raw_client.py @@ -1,21 +1,22 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.terminal_action import TerminalActionParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_terminal_action_response import CreateTerminalActionResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.terminal_action import TerminalActionParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.terminal_action_query import TerminalActionQueryParams -from ...types.cancel_terminal_action_response import CancelTerminalActionResponse -from ...types.create_terminal_action_response import CreateTerminalActionResponse -from ...types.get_terminal_action_response import GetTerminalActionResponse from ...types.search_terminal_actions_response import SearchTerminalActionsResponse +from ...types.get_terminal_action_response import GetTerminalActionResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...types.cancel_terminal_action_response import CancelTerminalActionResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -82,8 +83,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -147,8 +148,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -186,8 +187,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -225,8 +226,8 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawActionsClient: @@ -290,8 +291,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -355,8 +356,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -394,8 +395,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, action_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -433,5 +434,5 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/terminal/checkouts/__init__.py b/src/square/terminal/checkouts/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/terminal/checkouts/__init__.py +++ b/src/square/terminal/checkouts/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/terminal/checkouts/client.py b/src/square/terminal/checkouts/client.py index 9c124ea3..be752860 100644 --- a/src/square/terminal/checkouts/client.py +++ b/src/square/terminal/checkouts/client.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawCheckoutsClient from ...requests.terminal_checkout import TerminalCheckoutParams -from ...requests.terminal_checkout_query import TerminalCheckoutQueryParams -from ...types.cancel_terminal_checkout_response import CancelTerminalCheckoutResponse +from ...core.request_options import RequestOptions from ...types.create_terminal_checkout_response import CreateTerminalCheckoutResponse -from ...types.get_terminal_checkout_response import GetTerminalCheckoutResponse +from ...requests.terminal_checkout_query import TerminalCheckoutQueryParams from ...types.search_terminal_checkouts_response import SearchTerminalCheckoutsResponse -from .raw_client import AsyncRawCheckoutsClient, RawCheckoutsClient +from ...types.get_terminal_checkout_response import GetTerminalCheckoutResponse +from ...types.cancel_terminal_checkout_response import CancelTerminalCheckoutResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawCheckoutsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -78,10 +79,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, checkout=checkout, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -128,8 +129,8 @@ def search( limit=2, ) """ - _response = self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) + return response.data def get( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -161,8 +162,8 @@ def get( checkout_id="checkout_id", ) """ - _response = self._raw_client.get(checkout_id, request_options=request_options) - return _response.data + response = self._raw_client.get(checkout_id, request_options=request_options) + return response.data def cancel( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -194,8 +195,8 @@ def cancel( checkout_id="checkout_id", ) """ - _response = self._raw_client.cancel(checkout_id, request_options=request_options) - return _response.data + response = self._raw_client.cancel(checkout_id, request_options=request_options) + return response.data class AsyncCheckoutsClient: @@ -270,10 +271,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, checkout=checkout, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -328,10 +329,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, cursor=cursor, limit=limit, request_options=request_options ) - return _response.data + return response.data async def get( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -371,8 +372,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(checkout_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(checkout_id, request_options=request_options) + return response.data async def cancel( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -412,5 +413,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(checkout_id, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(checkout_id, request_options=request_options) + return response.data diff --git a/src/square/terminal/checkouts/raw_client.py b/src/square/terminal/checkouts/raw_client.py index 66b66deb..9567001d 100644 --- a/src/square/terminal/checkouts/raw_client.py +++ b/src/square/terminal/checkouts/raw_client.py @@ -1,21 +1,22 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.terminal_checkout import TerminalCheckoutParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_terminal_checkout_response import CreateTerminalCheckoutResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.terminal_checkout import TerminalCheckoutParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.terminal_checkout_query import TerminalCheckoutQueryParams -from ...types.cancel_terminal_checkout_response import CancelTerminalCheckoutResponse -from ...types.create_terminal_checkout_response import CreateTerminalCheckoutResponse -from ...types.get_terminal_checkout_response import GetTerminalCheckoutResponse from ...types.search_terminal_checkouts_response import SearchTerminalCheckoutsResponse +from ...types.get_terminal_checkout_response import GetTerminalCheckoutResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...types.cancel_terminal_checkout_response import CancelTerminalCheckoutResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -82,8 +83,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -146,8 +147,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -185,8 +186,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -224,8 +225,8 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawCheckoutsClient: @@ -289,8 +290,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -353,8 +354,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -392,8 +393,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -431,5 +432,5 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/terminal/client.py b/src/square/terminal/client.py index 2f71f21b..9ab0a2c4 100644 --- a/src/square/terminal/client.py +++ b/src/square/terminal/client.py @@ -1,29 +1,30 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawTerminalClient +from .actions.client import ActionsClient +from .checkouts.client import CheckoutsClient +from .refunds.client import RefundsClient import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.dismiss_terminal_action_response import DismissTerminalActionResponse from ..types.dismiss_terminal_checkout_response import DismissTerminalCheckoutResponse from ..types.dismiss_terminal_refund_response import DismissTerminalRefundResponse -from .raw_client import AsyncRawTerminalClient, RawTerminalClient - -if typing.TYPE_CHECKING: - from .actions.client import ActionsClient, AsyncActionsClient - from .checkouts.client import AsyncCheckoutsClient, CheckoutsClient - from .refunds.client import AsyncRefundsClient, RefundsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawTerminalClient +from .actions.client import AsyncActionsClient +from .checkouts.client import AsyncCheckoutsClient +from .refunds.client import AsyncRefundsClient class TerminalClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawTerminalClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._actions: typing.Optional[ActionsClient] = None - self._checkouts: typing.Optional[CheckoutsClient] = None - self._refunds: typing.Optional[RefundsClient] = None + self.actions = ActionsClient(client_wrapper=client_wrapper) + + self.checkouts = CheckoutsClient(client_wrapper=client_wrapper) + + self.refunds = RefundsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawTerminalClient: @@ -68,8 +69,8 @@ def dismiss_terminal_action( action_id="action_id", ) """ - _response = self._raw_client.dismiss_terminal_action(action_id, request_options=request_options) - return _response.data + response = self._raw_client.dismiss_terminal_action(action_id, request_options=request_options) + return response.data def dismiss_terminal_checkout( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -101,8 +102,8 @@ def dismiss_terminal_checkout( checkout_id="checkout_id", ) """ - _response = self._raw_client.dismiss_terminal_checkout(checkout_id, request_options=request_options) - return _response.data + response = self._raw_client.dismiss_terminal_checkout(checkout_id, request_options=request_options) + return response.data def dismiss_terminal_refund( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -134,41 +135,18 @@ def dismiss_terminal_refund( terminal_refund_id="terminal_refund_id", ) """ - _response = self._raw_client.dismiss_terminal_refund(terminal_refund_id, request_options=request_options) - return _response.data - - @property - def actions(self): - if self._actions is None: - from .actions.client import ActionsClient # noqa: E402 - - self._actions = ActionsClient(client_wrapper=self._client_wrapper) - return self._actions - - @property - def checkouts(self): - if self._checkouts is None: - from .checkouts.client import CheckoutsClient # noqa: E402 - - self._checkouts = CheckoutsClient(client_wrapper=self._client_wrapper) - return self._checkouts - - @property - def refunds(self): - if self._refunds is None: - from .refunds.client import RefundsClient # noqa: E402 - - self._refunds = RefundsClient(client_wrapper=self._client_wrapper) - return self._refunds + response = self._raw_client.dismiss_terminal_refund(terminal_refund_id, request_options=request_options) + return response.data class AsyncTerminalClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawTerminalClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._actions: typing.Optional[AsyncActionsClient] = None - self._checkouts: typing.Optional[AsyncCheckoutsClient] = None - self._refunds: typing.Optional[AsyncRefundsClient] = None + self.actions = AsyncActionsClient(client_wrapper=client_wrapper) + + self.checkouts = AsyncCheckoutsClient(client_wrapper=client_wrapper) + + self.refunds = AsyncRefundsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawTerminalClient: @@ -221,8 +199,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.dismiss_terminal_action(action_id, request_options=request_options) - return _response.data + response = await self._raw_client.dismiss_terminal_action(action_id, request_options=request_options) + return response.data async def dismiss_terminal_checkout( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -262,8 +240,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.dismiss_terminal_checkout(checkout_id, request_options=request_options) - return _response.data + response = await self._raw_client.dismiss_terminal_checkout(checkout_id, request_options=request_options) + return response.data async def dismiss_terminal_refund( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -303,29 +281,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.dismiss_terminal_refund(terminal_refund_id, request_options=request_options) - return _response.data - - @property - def actions(self): - if self._actions is None: - from .actions.client import AsyncActionsClient # noqa: E402 - - self._actions = AsyncActionsClient(client_wrapper=self._client_wrapper) - return self._actions - - @property - def checkouts(self): - if self._checkouts is None: - from .checkouts.client import AsyncCheckoutsClient # noqa: E402 - - self._checkouts = AsyncCheckoutsClient(client_wrapper=self._client_wrapper) - return self._checkouts - - @property - def refunds(self): - if self._refunds is None: - from .refunds.client import AsyncRefundsClient # noqa: E402 - - self._refunds = AsyncRefundsClient(client_wrapper=self._client_wrapper) - return self._refunds + response = await self._raw_client.dismiss_terminal_refund(terminal_refund_id, request_options=request_options) + return response.data diff --git a/src/square/terminal/raw_client.py b/src/square/terminal/raw_client.py index 4b3dbe6e..96ad6068 100644 --- a/src/square/terminal/raw_client.py +++ b/src/square/terminal/raw_client.py @@ -1,17 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.http_response import HttpResponse from ..types.dismiss_terminal_action_response import DismissTerminalActionResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.dismiss_terminal_checkout_response import DismissTerminalCheckoutResponse from ..types.dismiss_terminal_refund_response import DismissTerminalRefundResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse class RawTerminalClient: @@ -56,8 +57,8 @@ def dismiss_terminal_action( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def dismiss_terminal_checkout( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -95,8 +96,8 @@ def dismiss_terminal_checkout( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def dismiss_terminal_refund( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -134,8 +135,8 @@ def dismiss_terminal_refund( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawTerminalClient: @@ -180,8 +181,8 @@ async def dismiss_terminal_action( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def dismiss_terminal_checkout( self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -219,8 +220,8 @@ async def dismiss_terminal_checkout( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def dismiss_terminal_refund( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -258,5 +259,5 @@ async def dismiss_terminal_refund( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/terminal/refunds/__init__.py b/src/square/terminal/refunds/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/terminal/refunds/__init__.py +++ b/src/square/terminal/refunds/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/terminal/refunds/client.py b/src/square/terminal/refunds/client.py index 3df92941..d900f00c 100644 --- a/src/square/terminal/refunds/client.py +++ b/src/square/terminal/refunds/client.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawRefundsClient from ...requests.terminal_refund import TerminalRefundParams -from ...requests.terminal_refund_query import TerminalRefundQueryParams -from ...types.cancel_terminal_refund_response import CancelTerminalRefundResponse +from ...core.request_options import RequestOptions from ...types.create_terminal_refund_response import CreateTerminalRefundResponse -from ...types.get_terminal_refund_response import GetTerminalRefundResponse +from ...requests.terminal_refund_query import TerminalRefundQueryParams from ...types.search_terminal_refunds_response import SearchTerminalRefundsResponse -from .raw_client import AsyncRawRefundsClient, RawRefundsClient +from ...types.get_terminal_refund_response import GetTerminalRefundResponse +from ...types.cancel_terminal_refund_response import CancelTerminalRefundResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawRefundsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -77,10 +78,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, refund=refund, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -127,8 +128,8 @@ def search( limit=1, ) """ - _response = self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) - return _response.data + response = self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) + return response.data def get( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -160,8 +161,8 @@ def get( terminal_refund_id="terminal_refund_id", ) """ - _response = self._raw_client.get(terminal_refund_id, request_options=request_options) - return _response.data + response = self._raw_client.get(terminal_refund_id, request_options=request_options) + return response.data def cancel( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -193,8 +194,8 @@ def cancel( terminal_refund_id="terminal_refund_id", ) """ - _response = self._raw_client.cancel(terminal_refund_id, request_options=request_options) - return _response.data + response = self._raw_client.cancel(terminal_refund_id, request_options=request_options) + return response.data class AsyncRefundsClient: @@ -266,10 +267,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, refund=refund, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -324,10 +325,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( query=query, cursor=cursor, limit=limit, request_options=request_options ) - return _response.data + return response.data async def get( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -367,8 +368,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(terminal_refund_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(terminal_refund_id, request_options=request_options) + return response.data async def cancel( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -408,5 +409,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.cancel(terminal_refund_id, request_options=request_options) - return _response.data + response = await self._raw_client.cancel(terminal_refund_id, request_options=request_options) + return response.data diff --git a/src/square/terminal/refunds/raw_client.py b/src/square/terminal/refunds/raw_client.py index 3ed83e41..0dc1553d 100644 --- a/src/square/terminal/refunds/raw_client.py +++ b/src/square/terminal/refunds/raw_client.py @@ -1,21 +1,22 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import SyncClientWrapper +from ...requests.terminal_refund import TerminalRefundParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_terminal_refund_response import CreateTerminalRefundResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.terminal_refund import TerminalRefundParams +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.terminal_refund_query import TerminalRefundQueryParams -from ...types.cancel_terminal_refund_response import CancelTerminalRefundResponse -from ...types.create_terminal_refund_response import CreateTerminalRefundResponse -from ...types.get_terminal_refund_response import GetTerminalRefundResponse from ...types.search_terminal_refunds_response import SearchTerminalRefundsResponse +from ...types.get_terminal_refund_response import GetTerminalRefundResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...types.cancel_terminal_refund_response import CancelTerminalRefundResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -81,8 +82,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -145,8 +146,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -184,8 +185,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def cancel( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -223,8 +224,8 @@ def cancel( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawRefundsClient: @@ -287,8 +288,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -351,8 +352,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -390,8 +391,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def cancel( self, terminal_refund_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -429,5 +430,5 @@ async def cancel( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/transfer_orders/__init__.py b/src/square/transfer_orders/__init__.py deleted file mode 100644 index 5cde0202..00000000 --- a/src/square/transfer_orders/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/src/square/transfer_orders/client.py b/src/square/transfer_orders/client.py deleted file mode 100644 index fee6a89e..00000000 --- a/src/square/transfer_orders/client.py +++ /dev/null @@ -1,1123 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..requests.create_transfer_order_data import CreateTransferOrderDataParams -from ..requests.transfer_order_goods_receipt import TransferOrderGoodsReceiptParams -from ..requests.transfer_order_query import TransferOrderQueryParams -from ..requests.update_transfer_order_data import UpdateTransferOrderDataParams -from ..types.cancel_transfer_order_response import CancelTransferOrderResponse -from ..types.create_transfer_order_response import CreateTransferOrderResponse -from ..types.delete_transfer_order_response import DeleteTransferOrderResponse -from ..types.receive_transfer_order_response import ReceiveTransferOrderResponse -from ..types.retrieve_transfer_order_response import RetrieveTransferOrderResponse -from ..types.search_transfer_orders_response import SearchTransferOrdersResponse -from ..types.start_transfer_order_response import StartTransferOrderResponse -from ..types.transfer_order import TransferOrder -from ..types.update_transfer_order_response import UpdateTransferOrderResponse -from .raw_client import AsyncRawTransferOrdersClient, RawTransferOrdersClient - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class TransferOrdersClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawTransferOrdersClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawTransferOrdersClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawTransferOrdersClient - """ - return self._raw_client - - def create( - self, - *, - idempotency_key: str, - transfer_order: CreateTransferOrderDataParams, - request_options: typing.Optional[RequestOptions] = None, - ) -> CreateTransferOrderResponse: - """ - Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent - to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. - The source and destination locations must be different and must belong to your Square account. - - In [DRAFT](entity:TransferOrderStatus) status, you can: - - Add or remove items - - Modify quantities - - Update shipping information - - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - - The request requires source_location_id and destination_location_id. - Inventory levels are not affected until the order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - - Common integration points: - - Sync with warehouse management systems - - Automate regular stock transfers - - Initialize transfers from inventory optimization systems - - Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. - - Parameters - ---------- - idempotency_key : str - A unique string that identifies this CreateTransferOrder request. Keys can be - any valid string but must be unique for every CreateTransferOrder request. - - transfer_order : CreateTransferOrderDataParams - The transfer order to create - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CreateTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.create( - idempotency_key="65cc0586-3e82-384s-b524-3885cffd52", - transfer_order={ - "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", - "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", - "expected_at": "2025-11-09T05:00:00Z", - "notes": "Example transfer order for inventory redistribution between locations", - "tracking_number": "TRACK123456789", - "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", - "line_items": [ - { - "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", - "quantity_ordered": "5", - }, - { - "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", - "quantity_ordered": "3", - }, - ], - }, - ) - """ - _response = self._raw_client.create( - idempotency_key=idempotency_key, transfer_order=transfer_order, request_options=request_options - ) - return _response.data - - def search( - self, - *, - query: typing.Optional[TransferOrderQueryParams] = OMIT, - cursor: typing.Optional[str] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TransferOrder, SearchTransferOrdersResponse]: - """ - Searches for transfer orders using filters. Returns a paginated list of matching - [TransferOrder](entity:TransferOrder)s sorted by creation date. - - Common search scenarios: - - Find orders for a source [Location](entity:Location) - - Find orders for a destination [Location](entity:Location) - - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) - - Parameters - ---------- - query : typing.Optional[TransferOrderQueryParams] - The search query - - cursor : typing.Optional[str] - Pagination cursor from a previous search response - - limit : typing.Optional[int] - Maximum number of results to return (1-100) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[TransferOrder, SearchTransferOrdersResponse] - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - response = client.transfer_orders.search( - query={ - "filter": { - "source_location_ids": ["EXAMPLE_SOURCE_LOCATION_ID_123"], - "destination_location_ids": ["EXAMPLE_DEST_LOCATION_ID_456"], - "statuses": ["STARTED", "PARTIALLY_RECEIVED"], - }, - "sort": {"field": "UPDATED_AT", "order": "DESC"}, - }, - cursor="eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit=10, - ) - for item in response: - yield item - # alternatively, you can paginate page-by-page - for page in response.iter_pages(): - yield page - """ - return self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) - - def get( - self, transfer_order_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> RetrieveTransferOrderResponse: - """ - Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete - order details including: - - - Basic information (status, dates, notes) - - Line items with ordered and received quantities - - Source and destination [Location](entity:Location)s - - Tracking information (if available) - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to retrieve - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - RetrieveTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.get( - transfer_order_id="transfer_order_id", - ) - """ - _response = self._raw_client.get(transfer_order_id, request_options=request_options) - return _response.data - - def update( - self, - transfer_order_id: str, - *, - idempotency_key: str, - transfer_order: UpdateTransferOrderDataParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> UpdateTransferOrderResponse: - """ - Updates an existing transfer order. This endpoint supports sparse updates, - allowing you to modify specific fields without affecting others. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to update - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores - - transfer_order : UpdateTransferOrderDataParams - The transfer order updates to apply - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - UpdateTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.update( - transfer_order_id="transfer_order_id", - idempotency_key="f47ac10b-58cc-4372-a567-0e02b2c3d479", - transfer_order={ - "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_789", - "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_101", - "expected_at": "2025-11-10T08:00:00Z", - "notes": "Updated: Priority transfer due to low stock at destination", - "tracking_number": "TRACK987654321", - "line_items": [ - {"uid": "1", "quantity_ordered": "7"}, - { - "item_variation_id": "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - "quantity_ordered": "2", - }, - {"uid": "2", "remove": True}, - ], - }, - version=1753109537351, - ) - """ - _response = self._raw_client.update( - transfer_order_id, - idempotency_key=idempotency_key, - transfer_order=transfer_order, - version=version, - request_options=request_options, - ) - return _response.data - - def delete( - self, - transfer_order_id: str, - *, - version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> DeleteTransferOrderResponse: - """ - Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. - Only draft orders can be deleted. Once an order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. - - Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to delete - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DeleteTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.delete( - transfer_order_id="transfer_order_id", - version=1000000, - ) - """ - _response = self._raw_client.delete(transfer_order_id, version=version, request_options=request_options) - return _response.data - - def cancel( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CancelTransferOrderResponse: - """ - Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or - [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no - longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. - - Common reasons for cancellation: - - Items no longer needed at destination - - Source location needs the inventory - - Order created in error - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CancelTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.cancel( - transfer_order_id="transfer_order_id", - idempotency_key="65cc0586-3e82-4d08-b524-3885cffd52", - version=1753117449752, - ) - """ - _response = self._raw_client.cancel( - transfer_order_id, idempotency_key=idempotency_key, version=version, request_options=request_options - ) - return _response.data - - def receive( - self, - transfer_order_id: str, - *, - idempotency_key: str, - receipt: TransferOrderGoodsReceiptParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> ReceiveTransferOrderResponse: - """ - Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. - This endpoint supports partial receiving - you can receive items in multiple batches. - - For each line item, you can specify: - - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) - - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) - - Quantity canceled (returned to source location's inventory) - - The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. - Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - - When all items are either received, damaged, or canceled, the order moves to - [COMPLETED](entity:TransferOrderStatus) status. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to receive items for - - idempotency_key : str - A unique key to make this request idempotent - - receipt : TransferOrderGoodsReceiptParams - The receipt details - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ReceiveTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.receive( - transfer_order_id="transfer_order_id", - idempotency_key="EXAMPLE_IDEMPOTENCY_KEY_101", - receipt={ - "line_items": [ - { - "transfer_order_line_uid": "transfer_order_line_uid", - "quantity_received": "3", - "quantity_damaged": "1", - "quantity_canceled": "1", - }, - { - "transfer_order_line_uid": "transfer_order_line_uid", - "quantity_received": "2", - "quantity_canceled": "1", - }, - ] - }, - version=1753118664873, - ) - """ - _response = self._raw_client.receive( - transfer_order_id, - idempotency_key=idempotency_key, - receipt=receipt, - version=version, - request_options=request_options, - ) - return _response.data - - def start( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> StartTransferOrderResponse: - """ - Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. - This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - - The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. - Once started, the order can no longer be deleted, but it can be canceled via - [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to start. Must be in DRAFT status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - StartTransferOrderResponse - Success - - Examples - -------- - from square import Square - - client = Square( - token="YOUR_TOKEN", - ) - client.transfer_orders.start( - transfer_order_id="transfer_order_id", - idempotency_key="EXAMPLE_IDEMPOTENCY_KEY_789", - version=1753109537351, - ) - """ - _response = self._raw_client.start( - transfer_order_id, idempotency_key=idempotency_key, version=version, request_options=request_options - ) - return _response.data - - -class AsyncTransferOrdersClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawTransferOrdersClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawTransferOrdersClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawTransferOrdersClient - """ - return self._raw_client - - async def create( - self, - *, - idempotency_key: str, - transfer_order: CreateTransferOrderDataParams, - request_options: typing.Optional[RequestOptions] = None, - ) -> CreateTransferOrderResponse: - """ - Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent - to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. - The source and destination locations must be different and must belong to your Square account. - - In [DRAFT](entity:TransferOrderStatus) status, you can: - - Add or remove items - - Modify quantities - - Update shipping information - - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - - The request requires source_location_id and destination_location_id. - Inventory levels are not affected until the order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - - Common integration points: - - Sync with warehouse management systems - - Automate regular stock transfers - - Initialize transfers from inventory optimization systems - - Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. - - Parameters - ---------- - idempotency_key : str - A unique string that identifies this CreateTransferOrder request. Keys can be - any valid string but must be unique for every CreateTransferOrder request. - - transfer_order : CreateTransferOrderDataParams - The transfer order to create - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CreateTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.create( - idempotency_key="65cc0586-3e82-384s-b524-3885cffd52", - transfer_order={ - "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", - "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", - "expected_at": "2025-11-09T05:00:00Z", - "notes": "Example transfer order for inventory redistribution between locations", - "tracking_number": "TRACK123456789", - "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", - "line_items": [ - { - "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", - "quantity_ordered": "5", - }, - { - "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", - "quantity_ordered": "3", - }, - ], - }, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.create( - idempotency_key=idempotency_key, transfer_order=transfer_order, request_options=request_options - ) - return _response.data - - async def search( - self, - *, - query: typing.Optional[TransferOrderQueryParams] = OMIT, - cursor: typing.Optional[str] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TransferOrder, SearchTransferOrdersResponse]: - """ - Searches for transfer orders using filters. Returns a paginated list of matching - [TransferOrder](entity:TransferOrder)s sorted by creation date. - - Common search scenarios: - - Find orders for a source [Location](entity:Location) - - Find orders for a destination [Location](entity:Location) - - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) - - Parameters - ---------- - query : typing.Optional[TransferOrderQueryParams] - The search query - - cursor : typing.Optional[str] - Pagination cursor from a previous search response - - limit : typing.Optional[int] - Maximum number of results to return (1-100) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[TransferOrder, SearchTransferOrdersResponse] - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - response = await client.transfer_orders.search( - query={ - "filter": { - "source_location_ids": ["EXAMPLE_SOURCE_LOCATION_ID_123"], - "destination_location_ids": ["EXAMPLE_DEST_LOCATION_ID_456"], - "statuses": ["STARTED", "PARTIALLY_RECEIVED"], - }, - "sort": {"field": "UPDATED_AT", "order": "DESC"}, - }, - cursor="eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit=10, - ) - async for item in response: - yield item - - # alternatively, you can paginate page-by-page - async for page in response.iter_pages(): - yield page - - - asyncio.run(main()) - """ - return await self._raw_client.search(query=query, cursor=cursor, limit=limit, request_options=request_options) - - async def get( - self, transfer_order_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> RetrieveTransferOrderResponse: - """ - Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete - order details including: - - - Basic information (status, dates, notes) - - Line items with ordered and received quantities - - Source and destination [Location](entity:Location)s - - Tracking information (if available) - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to retrieve - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - RetrieveTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.get( - transfer_order_id="transfer_order_id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.get(transfer_order_id, request_options=request_options) - return _response.data - - async def update( - self, - transfer_order_id: str, - *, - idempotency_key: str, - transfer_order: UpdateTransferOrderDataParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> UpdateTransferOrderResponse: - """ - Updates an existing transfer order. This endpoint supports sparse updates, - allowing you to modify specific fields without affecting others. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to update - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores - - transfer_order : UpdateTransferOrderDataParams - The transfer order updates to apply - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - UpdateTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.update( - transfer_order_id="transfer_order_id", - idempotency_key="f47ac10b-58cc-4372-a567-0e02b2c3d479", - transfer_order={ - "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_789", - "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_101", - "expected_at": "2025-11-10T08:00:00Z", - "notes": "Updated: Priority transfer due to low stock at destination", - "tracking_number": "TRACK987654321", - "line_items": [ - {"uid": "1", "quantity_ordered": "7"}, - { - "item_variation_id": "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - "quantity_ordered": "2", - }, - {"uid": "2", "remove": True}, - ], - }, - version=1753109537351, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.update( - transfer_order_id, - idempotency_key=idempotency_key, - transfer_order=transfer_order, - version=version, - request_options=request_options, - ) - return _response.data - - async def delete( - self, - transfer_order_id: str, - *, - version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> DeleteTransferOrderResponse: - """ - Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. - Only draft orders can be deleted. Once an order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. - - Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to delete - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DeleteTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.delete( - transfer_order_id="transfer_order_id", - version=1000000, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.delete(transfer_order_id, version=version, request_options=request_options) - return _response.data - - async def cancel( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CancelTransferOrderResponse: - """ - Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or - [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no - longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. - - Common reasons for cancellation: - - Items no longer needed at destination - - Source location needs the inventory - - Order created in error - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CancelTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.cancel( - transfer_order_id="transfer_order_id", - idempotency_key="65cc0586-3e82-4d08-b524-3885cffd52", - version=1753117449752, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.cancel( - transfer_order_id, idempotency_key=idempotency_key, version=version, request_options=request_options - ) - return _response.data - - async def receive( - self, - transfer_order_id: str, - *, - idempotency_key: str, - receipt: TransferOrderGoodsReceiptParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> ReceiveTransferOrderResponse: - """ - Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. - This endpoint supports partial receiving - you can receive items in multiple batches. - - For each line item, you can specify: - - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) - - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) - - Quantity canceled (returned to source location's inventory) - - The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. - Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - - When all items are either received, damaged, or canceled, the order moves to - [COMPLETED](entity:TransferOrderStatus) status. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to receive items for - - idempotency_key : str - A unique key to make this request idempotent - - receipt : TransferOrderGoodsReceiptParams - The receipt details - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ReceiveTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.receive( - transfer_order_id="transfer_order_id", - idempotency_key="EXAMPLE_IDEMPOTENCY_KEY_101", - receipt={ - "line_items": [ - { - "transfer_order_line_uid": "transfer_order_line_uid", - "quantity_received": "3", - "quantity_damaged": "1", - "quantity_canceled": "1", - }, - { - "transfer_order_line_uid": "transfer_order_line_uid", - "quantity_received": "2", - "quantity_canceled": "1", - }, - ] - }, - version=1753118664873, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.receive( - transfer_order_id, - idempotency_key=idempotency_key, - receipt=receipt, - version=version, - request_options=request_options, - ) - return _response.data - - async def start( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> StartTransferOrderResponse: - """ - Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. - This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - - The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. - Once started, the order can no longer be deleted, but it can be canceled via - [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to start. Must be in DRAFT status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - StartTransferOrderResponse - Success - - Examples - -------- - import asyncio - - from square import AsyncSquare - - client = AsyncSquare( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.transfer_orders.start( - transfer_order_id="transfer_order_id", - idempotency_key="EXAMPLE_IDEMPOTENCY_KEY_789", - version=1753109537351, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.start( - transfer_order_id, idempotency_key=idempotency_key, version=version, request_options=request_options - ) - return _response.data diff --git a/src/square/transfer_orders/raw_client.py b/src/square/transfer_orders/raw_client.py deleted file mode 100644 index 515b181c..00000000 --- a/src/square/transfer_orders/raw_client.py +++ /dev/null @@ -1,1106 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..core.unchecked_base_model import construct_type -from ..requests.create_transfer_order_data import CreateTransferOrderDataParams -from ..requests.transfer_order_goods_receipt import TransferOrderGoodsReceiptParams -from ..requests.transfer_order_query import TransferOrderQueryParams -from ..requests.update_transfer_order_data import UpdateTransferOrderDataParams -from ..types.cancel_transfer_order_response import CancelTransferOrderResponse -from ..types.create_transfer_order_response import CreateTransferOrderResponse -from ..types.delete_transfer_order_response import DeleteTransferOrderResponse -from ..types.receive_transfer_order_response import ReceiveTransferOrderResponse -from ..types.retrieve_transfer_order_response import RetrieveTransferOrderResponse -from ..types.search_transfer_orders_response import SearchTransferOrdersResponse -from ..types.start_transfer_order_response import StartTransferOrderResponse -from ..types.transfer_order import TransferOrder -from ..types.update_transfer_order_response import UpdateTransferOrderResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawTransferOrdersClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def create( - self, - *, - idempotency_key: str, - transfer_order: CreateTransferOrderDataParams, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CreateTransferOrderResponse]: - """ - Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent - to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. - The source and destination locations must be different and must belong to your Square account. - - In [DRAFT](entity:TransferOrderStatus) status, you can: - - Add or remove items - - Modify quantities - - Update shipping information - - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - - The request requires source_location_id and destination_location_id. - Inventory levels are not affected until the order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - - Common integration points: - - Sync with warehouse management systems - - Automate regular stock transfers - - Initialize transfers from inventory optimization systems - - Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. - - Parameters - ---------- - idempotency_key : str - A unique string that identifies this CreateTransferOrder request. Keys can be - any valid string but must be unique for every CreateTransferOrder request. - - transfer_order : CreateTransferOrderDataParams - The transfer order to create - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CreateTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/transfer-orders", - method="POST", - json={ - "idempotency_key": idempotency_key, - "transfer_order": convert_and_respect_annotation_metadata( - object_=transfer_order, annotation=CreateTransferOrderDataParams, direction="write" - ), - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CreateTransferOrderResponse, - construct_type( - type_=CreateTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def search( - self, - *, - query: typing.Optional[TransferOrderQueryParams] = OMIT, - cursor: typing.Optional[str] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TransferOrder, SearchTransferOrdersResponse]: - """ - Searches for transfer orders using filters. Returns a paginated list of matching - [TransferOrder](entity:TransferOrder)s sorted by creation date. - - Common search scenarios: - - Find orders for a source [Location](entity:Location) - - Find orders for a destination [Location](entity:Location) - - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) - - Parameters - ---------- - query : typing.Optional[TransferOrderQueryParams] - The search query - - cursor : typing.Optional[str] - Pagination cursor from a previous search response - - limit : typing.Optional[int] - Maximum number of results to return (1-100) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[TransferOrder, SearchTransferOrdersResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/transfer-orders/search", - method="POST", - json={ - "query": convert_and_respect_annotation_metadata( - object_=query, annotation=TransferOrderQueryParams, direction="write" - ), - "cursor": cursor, - "limit": limit, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - SearchTransferOrdersResponse, - construct_type( - type_=SearchTransferOrdersResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.transfer_orders - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.search( - query=query, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def get( - self, transfer_order_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[RetrieveTransferOrderResponse]: - """ - Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete - order details including: - - - Basic information (status, dates, notes) - - Line items with ordered and received quantities - - Source and destination [Location](entity:Location)s - - Tracking information (if available) - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to retrieve - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[RetrieveTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - RetrieveTransferOrderResponse, - construct_type( - type_=RetrieveTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def update( - self, - transfer_order_id: str, - *, - idempotency_key: str, - transfer_order: UpdateTransferOrderDataParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[UpdateTransferOrderResponse]: - """ - Updates an existing transfer order. This endpoint supports sparse updates, - allowing you to modify specific fields without affecting others. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to update - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores - - transfer_order : UpdateTransferOrderDataParams - The transfer order updates to apply - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[UpdateTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}", - method="PUT", - json={ - "idempotency_key": idempotency_key, - "transfer_order": convert_and_respect_annotation_metadata( - object_=transfer_order, annotation=UpdateTransferOrderDataParams, direction="write" - ), - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - UpdateTransferOrderResponse, - construct_type( - type_=UpdateTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def delete( - self, - transfer_order_id: str, - *, - version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[DeleteTransferOrderResponse]: - """ - Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. - Only draft orders can be deleted. Once an order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. - - Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to delete - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[DeleteTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}", - method="DELETE", - params={ - "version": version, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - DeleteTransferOrderResponse, - construct_type( - type_=DeleteTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def cancel( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CancelTransferOrderResponse]: - """ - Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or - [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no - longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. - - Common reasons for cancellation: - - Items no longer needed at destination - - Source location needs the inventory - - Order created in error - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CancelTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}/cancel", - method="POST", - json={ - "idempotency_key": idempotency_key, - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CancelTransferOrderResponse, - construct_type( - type_=CancelTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def receive( - self, - transfer_order_id: str, - *, - idempotency_key: str, - receipt: TransferOrderGoodsReceiptParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ReceiveTransferOrderResponse]: - """ - Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. - This endpoint supports partial receiving - you can receive items in multiple batches. - - For each line item, you can specify: - - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) - - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) - - Quantity canceled (returned to source location's inventory) - - The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. - Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - - When all items are either received, damaged, or canceled, the order moves to - [COMPLETED](entity:TransferOrderStatus) status. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to receive items for - - idempotency_key : str - A unique key to make this request idempotent - - receipt : TransferOrderGoodsReceiptParams - The receipt details - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[ReceiveTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}/receive", - method="POST", - json={ - "idempotency_key": idempotency_key, - "receipt": convert_and_respect_annotation_metadata( - object_=receipt, annotation=TransferOrderGoodsReceiptParams, direction="write" - ), - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - ReceiveTransferOrderResponse, - construct_type( - type_=ReceiveTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def start( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[StartTransferOrderResponse]: - """ - Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. - This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - - The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. - Once started, the order can no longer be deleted, but it can be canceled via - [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to start. Must be in DRAFT status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[StartTransferOrderResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}/start", - method="POST", - json={ - "idempotency_key": idempotency_key, - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - StartTransferOrderResponse, - construct_type( - type_=StartTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawTransferOrdersClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def create( - self, - *, - idempotency_key: str, - transfer_order: CreateTransferOrderDataParams, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CreateTransferOrderResponse]: - """ - Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent - to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. - The source and destination locations must be different and must belong to your Square account. - - In [DRAFT](entity:TransferOrderStatus) status, you can: - - Add or remove items - - Modify quantities - - Update shipping information - - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - - The request requires source_location_id and destination_location_id. - Inventory levels are not affected until the order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - - Common integration points: - - Sync with warehouse management systems - - Automate regular stock transfers - - Initialize transfers from inventory optimization systems - - Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. - - Parameters - ---------- - idempotency_key : str - A unique string that identifies this CreateTransferOrder request. Keys can be - any valid string but must be unique for every CreateTransferOrder request. - - transfer_order : CreateTransferOrderDataParams - The transfer order to create - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CreateTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/transfer-orders", - method="POST", - json={ - "idempotency_key": idempotency_key, - "transfer_order": convert_and_respect_annotation_metadata( - object_=transfer_order, annotation=CreateTransferOrderDataParams, direction="write" - ), - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CreateTransferOrderResponse, - construct_type( - type_=CreateTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def search( - self, - *, - query: typing.Optional[TransferOrderQueryParams] = OMIT, - cursor: typing.Optional[str] = OMIT, - limit: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TransferOrder, SearchTransferOrdersResponse]: - """ - Searches for transfer orders using filters. Returns a paginated list of matching - [TransferOrder](entity:TransferOrder)s sorted by creation date. - - Common search scenarios: - - Find orders for a source [Location](entity:Location) - - Find orders for a destination [Location](entity:Location) - - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) - - Parameters - ---------- - query : typing.Optional[TransferOrderQueryParams] - The search query - - cursor : typing.Optional[str] - Pagination cursor from a previous search response - - limit : typing.Optional[int] - Maximum number of results to return (1-100) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[TransferOrder, SearchTransferOrdersResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/transfer-orders/search", - method="POST", - json={ - "query": convert_and_respect_annotation_metadata( - object_=query, annotation=TransferOrderQueryParams, direction="write" - ), - "cursor": cursor, - "limit": limit, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - SearchTransferOrdersResponse, - construct_type( - type_=SearchTransferOrdersResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.transfer_orders - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.search( - query=query, - cursor=_parsed_next, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def get( - self, transfer_order_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[RetrieveTransferOrderResponse]: - """ - Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete - order details including: - - - Basic information (status, dates, notes) - - Line items with ordered and received quantities - - Source and destination [Location](entity:Location)s - - Tracking information (if available) - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to retrieve - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[RetrieveTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - RetrieveTransferOrderResponse, - construct_type( - type_=RetrieveTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def update( - self, - transfer_order_id: str, - *, - idempotency_key: str, - transfer_order: UpdateTransferOrderDataParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[UpdateTransferOrderResponse]: - """ - Updates an existing transfer order. This endpoint supports sparse updates, - allowing you to modify specific fields without affecting others. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to update - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores - - transfer_order : UpdateTransferOrderDataParams - The transfer order updates to apply - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[UpdateTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}", - method="PUT", - json={ - "idempotency_key": idempotency_key, - "transfer_order": convert_and_respect_annotation_metadata( - object_=transfer_order, annotation=UpdateTransferOrderDataParams, direction="write" - ), - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - UpdateTransferOrderResponse, - construct_type( - type_=UpdateTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def delete( - self, - transfer_order_id: str, - *, - version: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[DeleteTransferOrderResponse]: - """ - Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. - Only draft orders can be deleted. Once an order is started via - [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. - - Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to delete - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[DeleteTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}", - method="DELETE", - params={ - "version": version, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - DeleteTransferOrderResponse, - construct_type( - type_=DeleteTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def cancel( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CancelTransferOrderResponse]: - """ - Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or - [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no - longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. - - Common reasons for cancellation: - - Items no longer needed at destination - - Source location needs the inventory - - Order created in error - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CancelTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}/cancel", - method="POST", - json={ - "idempotency_key": idempotency_key, - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CancelTransferOrderResponse, - construct_type( - type_=CancelTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def receive( - self, - transfer_order_id: str, - *, - idempotency_key: str, - receipt: TransferOrderGoodsReceiptParams, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ReceiveTransferOrderResponse]: - """ - Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. - This endpoint supports partial receiving - you can receive items in multiple batches. - - For each line item, you can specify: - - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) - - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) - - Quantity canceled (returned to source location's inventory) - - The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. - Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - - When all items are either received, damaged, or canceled, the order moves to - [COMPLETED](entity:TransferOrderStatus) status. - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to receive items for - - idempotency_key : str - A unique key to make this request idempotent - - receipt : TransferOrderGoodsReceiptParams - The receipt details - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[ReceiveTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}/receive", - method="POST", - json={ - "idempotency_key": idempotency_key, - "receipt": convert_and_respect_annotation_metadata( - object_=receipt, annotation=TransferOrderGoodsReceiptParams, direction="write" - ), - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - ReceiveTransferOrderResponse, - construct_type( - type_=ReceiveTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def start( - self, - transfer_order_id: str, - *, - idempotency_key: str, - version: typing.Optional[int] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[StartTransferOrderResponse]: - """ - Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. - This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - - The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. - Once started, the order can no longer be deleted, but it can be canceled via - [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - - Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - - Parameters - ---------- - transfer_order_id : str - The ID of the transfer order to start. Must be in DRAFT status. - - idempotency_key : str - A unique string that identifies this UpdateTransferOrder request. Keys can be - any valid string but must be unique for every UpdateTransferOrder request. - - version : typing.Optional[int] - Version for optimistic concurrency - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[StartTransferOrderResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - f"v2/transfer-orders/{jsonable_encoder(transfer_order_id)}/start", - method="POST", - json={ - "idempotency_key": idempotency_key, - "version": version, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - StartTransferOrderResponse, - construct_type( - type_=StartTransferOrderResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/square/types/__init__.py b/src/square/types/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/types/__init__.py +++ b/src/square/types/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/types/accept_dispute_response.py b/src/square/types/accept_dispute_response.py index 1f8a7edb..9f0bf8b1 100644 --- a/src/square/types/accept_dispute_response.py +++ b/src/square/types/accept_dispute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute import Dispute -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class AcceptDisputeResponse(UncheckedBaseModel): diff --git a/src/square/types/accepted_payment_methods.py b/src/square/types/accepted_payment_methods.py index 71e3175c..77f21b90 100644 --- a/src/square/types/accepted_payment_methods.py +++ b/src/square/types/accepted_payment_methods.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class AcceptedPaymentMethods(UncheckedBaseModel): diff --git a/src/square/types/accumulate_loyalty_points_response.py b/src/square/types/accumulate_loyalty_points_response.py index 29d2527e..e325083f 100644 --- a/src/square/types/accumulate_loyalty_points_response.py +++ b/src/square/types/accumulate_loyalty_points_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_event import LoyaltyEvent +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class AccumulateLoyaltyPointsResponse(UncheckedBaseModel): diff --git a/src/square/types/ach_details.py b/src/square/types/ach_details.py index d74fe7dc..93008cf2 100644 --- a/src/square/types/ach_details.py +++ b/src/square/types/ach_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class AchDetails(UncheckedBaseModel): diff --git a/src/square/types/add_group_to_customer_response.py b/src/square/types/add_group_to_customer_response.py index 66230cb2..024dc6db 100644 --- a/src/square/types/add_group_to_customer_response.py +++ b/src/square/types/add_group_to_customer_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class AddGroupToCustomerResponse(UncheckedBaseModel): diff --git a/src/square/types/additional_recipient.py b/src/square/types/additional_recipient.py index 33d422e1..e004fd97 100644 --- a/src/square/types/additional_recipient.py +++ b/src/square/types/additional_recipient.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class AdditionalRecipient(UncheckedBaseModel): diff --git a/src/square/types/address.py b/src/square/types/address.py index 2a521d93..e8845466 100644 --- a/src/square/types/address.py +++ b/src/square/types/address.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic +from ..core.unchecked_base_model import UncheckedBaseModel import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .country import Country +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Address(UncheckedBaseModel): diff --git a/src/square/types/adjust_loyalty_points_response.py b/src/square/types/adjust_loyalty_points_response.py index 631c79ed..f1b92bac 100644 --- a/src/square/types/adjust_loyalty_points_response.py +++ b/src/square/types/adjust_loyalty_points_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_event import LoyaltyEvent +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class AdjustLoyaltyPointsResponse(UncheckedBaseModel): diff --git a/src/square/types/afterpay_details.py b/src/square/types/afterpay_details.py index e031dd74..cf691d9b 100644 --- a/src/square/types/afterpay_details.py +++ b/src/square/types/afterpay_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class AfterpayDetails(UncheckedBaseModel): diff --git a/src/square/types/application_details.py b/src/square/types/application_details.py index f5130c43..0a040830 100644 --- a/src/square/types/application_details.py +++ b/src/square/types/application_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .application_details_external_square_product import ApplicationDetailsExternalSquareProduct import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .application_details_external_square_product import ApplicationDetailsExternalSquareProduct class ApplicationDetails(UncheckedBaseModel): diff --git a/src/square/types/appointment_segment.py b/src/square/types/appointment_segment.py index 670043b2..9e8a8b97 100644 --- a/src/square/types/appointment_segment.py +++ b/src/square/types/appointment_segment.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class AppointmentSegment(UncheckedBaseModel): diff --git a/src/square/types/availability.py b/src/square/types/availability.py index abe78790..27e210a4 100644 --- a/src/square/types/availability.py +++ b/src/square/types/availability.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .appointment_segment import AppointmentSegment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Availability(UncheckedBaseModel): diff --git a/src/square/types/bank_account.py b/src/square/types/bank_account.py index 6ded1ce9..6972aa8d 100644 --- a/src/square/types/bank_account.py +++ b/src/square/types/bank_account.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .bank_account_status import BankAccountStatus -from .bank_account_type import BankAccountType +import pydantic from .country import Country from .currency import Currency +from .bank_account_type import BankAccountType +import typing +from .bank_account_status import BankAccountStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccount(UncheckedBaseModel): diff --git a/src/square/types/bank_account_created_event.py b/src/square/types/bank_account_created_event.py index 737c8b35..b3872935 100644 --- a/src/square/types/bank_account_created_event.py +++ b/src/square/types/bank_account_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account_created_event_data import BankAccountCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/bank_account_created_event_data.py b/src/square/types/bank_account_created_event_data.py index 1cf23caa..78b5860b 100644 --- a/src/square/types/bank_account_created_event_data.py +++ b/src/square/types/bank_account_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account_created_event_object import BankAccountCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/bank_account_created_event_object.py b/src/square/types/bank_account_created_event_object.py index 8d02b0c6..30826635 100644 --- a/src/square/types/bank_account_created_event_object.py +++ b/src/square/types/bank_account_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .bank_account import BankAccount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .bank_account import BankAccount class BankAccountCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/bank_account_disabled_event.py b/src/square/types/bank_account_disabled_event.py index 7dedd436..87a676a4 100644 --- a/src/square/types/bank_account_disabled_event.py +++ b/src/square/types/bank_account_disabled_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account_disabled_event_data import BankAccountDisabledEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountDisabledEvent(UncheckedBaseModel): diff --git a/src/square/types/bank_account_disabled_event_data.py b/src/square/types/bank_account_disabled_event_data.py index eb4b8ad3..ca4fd970 100644 --- a/src/square/types/bank_account_disabled_event_data.py +++ b/src/square/types/bank_account_disabled_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account_disabled_event_object import BankAccountDisabledEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountDisabledEventData(UncheckedBaseModel): diff --git a/src/square/types/bank_account_disabled_event_object.py b/src/square/types/bank_account_disabled_event_object.py index f218ad66..09b066e1 100644 --- a/src/square/types/bank_account_disabled_event_object.py +++ b/src/square/types/bank_account_disabled_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .bank_account import BankAccount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .bank_account import BankAccount class BankAccountDisabledEventObject(UncheckedBaseModel): diff --git a/src/square/types/bank_account_payment_details.py b/src/square/types/bank_account_payment_details.py index df83d3c9..322e9995 100644 --- a/src/square/types/bank_account_payment_details.py +++ b/src/square/types/bank_account_payment_details.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .ach_details import AchDetails from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountPaymentDetails(UncheckedBaseModel): diff --git a/src/square/types/bank_account_verified_event.py b/src/square/types/bank_account_verified_event.py index 7f0c08a9..0a137308 100644 --- a/src/square/types/bank_account_verified_event.py +++ b/src/square/types/bank_account_verified_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account_verified_event_data import BankAccountVerifiedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountVerifiedEvent(UncheckedBaseModel): diff --git a/src/square/types/bank_account_verified_event_data.py b/src/square/types/bank_account_verified_event_data.py index 6bc3f160..2d9cfb5a 100644 --- a/src/square/types/bank_account_verified_event_data.py +++ b/src/square/types/bank_account_verified_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account_verified_event_object import BankAccountVerifiedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BankAccountVerifiedEventData(UncheckedBaseModel): diff --git a/src/square/types/bank_account_verified_event_object.py b/src/square/types/bank_account_verified_event_object.py index dff2c54c..3639dc4c 100644 --- a/src/square/types/bank_account_verified_event_object.py +++ b/src/square/types/bank_account_verified_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .bank_account import BankAccount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .bank_account import BankAccount class BankAccountVerifiedEventObject(UncheckedBaseModel): diff --git a/src/square/types/batch_change_inventory_request.py b/src/square/types/batch_change_inventory_request.py index ef6df43e..b07be8df 100644 --- a/src/square/types/batch_change_inventory_request.py +++ b/src/square/types/batch_change_inventory_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .inventory_change import InventoryChange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchChangeInventoryRequest(UncheckedBaseModel): diff --git a/src/square/types/batch_change_inventory_response.py b/src/square/types/batch_change_inventory_response.py index c297c9fe..0f992bab 100644 --- a/src/square/types/batch_change_inventory_response.py +++ b/src/square/types/batch_change_inventory_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error -from .inventory_change import InventoryChange +import pydantic from .inventory_count import InventoryCount +from .inventory_change import InventoryChange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchChangeInventoryResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_create_team_members_response.py b/src/square/types/batch_create_team_members_response.py index 3abc2a02..19f93d61 100644 --- a/src/square/types/batch_create_team_members_response.py +++ b/src/square/types/batch_create_team_members_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .create_team_member_response import CreateTeamMemberResponse +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchCreateTeamMembersResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_create_vendors_response.py b/src/square/types/batch_create_vendors_response.py index cea4b23d..3ab97f2e 100644 --- a/src/square/types/batch_create_vendors_response.py +++ b/src/square/types/batch_create_vendors_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .create_vendor_response import CreateVendorResponse -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchCreateVendorsResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_delete_catalog_objects_response.py b/src/square/types/batch_delete_catalog_objects_response.py index a69c2218..a59d6ba6 100644 --- a/src/square/types/batch_delete_catalog_objects_response.py +++ b/src/square/types/batch_delete_catalog_objects_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class BatchDeleteCatalogObjectsResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_get_catalog_objects_response.py b/src/square/types/batch_get_catalog_objects_response.py index cdaf63f9..57ca01ca 100644 --- a/src/square/types/batch_get_catalog_objects_response.py +++ b/src/square/types/batch_get_catalog_objects_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchGetCatalogObjectsResponse(UncheckedBaseModel): @@ -16,12 +24,12 @@ class BatchGetCatalogObjectsResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ A list of [CatalogObject](entity:CatalogObject)s returned. """ - related_objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + related_objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. """ @@ -34,18 +42,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - BatchGetCatalogObjectsResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/batch_get_inventory_changes_response.py b/src/square/types/batch_get_inventory_changes_response.py index 3f1ca249..6d4225a9 100644 --- a/src/square/types/batch_get_inventory_changes_response.py +++ b/src/square/types/batch_get_inventory_changes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_change import InventoryChange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchGetInventoryChangesResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_get_inventory_counts_request.py b/src/square/types/batch_get_inventory_counts_request.py index b8b0ec34..4b5d166d 100644 --- a/src/square/types/batch_get_inventory_counts_request.py +++ b/src/square/types/batch_get_inventory_counts_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_state import InventoryState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchGetInventoryCountsRequest(UncheckedBaseModel): diff --git a/src/square/types/batch_get_inventory_counts_response.py b/src/square/types/batch_get_inventory_counts_response.py index 0404e55f..26111e33 100644 --- a/src/square/types/batch_get_inventory_counts_response.py +++ b/src/square/types/batch_get_inventory_counts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_count import InventoryCount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchGetInventoryCountsResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_get_orders_response.py b/src/square/types/batch_get_orders_response.py index 0d3dab83..735f6795 100644 --- a/src/square/types/batch_get_orders_response.py +++ b/src/square/types/batch_get_orders_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchGetOrdersResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_get_vendors_response.py b/src/square/types/batch_get_vendors_response.py index f3b81215..b88d2efe 100644 --- a/src/square/types/batch_get_vendors_response.py +++ b/src/square/types/batch_get_vendors_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .get_vendor_response import GetVendorResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchGetVendorsResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_retrieve_inventory_changes_request.py b/src/square/types/batch_retrieve_inventory_changes_request.py index dcdf8497..5659616b 100644 --- a/src/square/types/batch_retrieve_inventory_changes_request.py +++ b/src/square/types/batch_retrieve_inventory_changes_request.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_change_type import InventoryChangeType from .inventory_state import InventoryState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchRetrieveInventoryChangesRequest(UncheckedBaseModel): diff --git a/src/square/types/batch_update_team_members_response.py b/src/square/types/batch_update_team_members_response.py index 2cd85479..479f4a00 100644 --- a/src/square/types/batch_update_team_members_response.py +++ b/src/square/types/batch_update_team_members_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .update_team_member_response import UpdateTeamMemberResponse import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .update_team_member_response import UpdateTeamMemberResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchUpdateTeamMembersResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_update_vendors_response.py b/src/square/types/batch_update_vendors_response.py index 160e9480..dc30f6ca 100644 --- a/src/square/types/batch_update_vendors_response.py +++ b/src/square/types/batch_update_vendors_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .update_vendor_response import UpdateVendorResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchUpdateVendorsResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_upsert_catalog_objects_response.py b/src/square/types/batch_upsert_catalog_objects_response.py index 87abcc51..64381bcd 100644 --- a/src/square/types/batch_upsert_catalog_objects_response.py +++ b/src/square/types/batch_upsert_catalog_objects_response.py @@ -1,14 +1,22 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_object import CatalogObject from .catalog_id_mapping import CatalogIdMapping -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchUpsertCatalogObjectsResponse(UncheckedBaseModel): @@ -17,7 +25,7 @@ class BatchUpsertCatalogObjectsResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ The created successfully created CatalogObjects. """ @@ -40,18 +48,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - BatchUpsertCatalogObjectsResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py b/src/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py index f015e341..f1419dd7 100644 --- a/src/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py +++ b/src/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .custom_attribute import CustomAttribute +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest(UncheckedBaseModel): diff --git a/src/square/types/batch_upsert_customer_custom_attributes_response.py b/src/square/types/batch_upsert_customer_custom_attributes_response.py index 802822ab..d39627ef 100644 --- a/src/square/types/batch_upsert_customer_custom_attributes_response.py +++ b/src/square/types/batch_upsert_customer_custom_attributes_response.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response import ( BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse, ) +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchUpsertCustomerCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py b/src/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py index f35386d0..52407342 100644 --- a/src/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py +++ b/src/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute import CustomAttribute from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse(UncheckedBaseModel): diff --git a/src/square/types/booking.py b/src/square/types/booking.py index 122ccf8c..54e6f2e0 100644 --- a/src/square/types/booking.py +++ b/src/square/types/booking.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .address import Address -from .appointment_segment import AppointmentSegment -from .booking_booking_source import BookingBookingSource -from .booking_creator_details import BookingCreatorDetails from .booking_status import BookingStatus +from .appointment_segment import AppointmentSegment from .business_appointment_settings_booking_location_type import BusinessAppointmentSettingsBookingLocationType +from .booking_creator_details import BookingCreatorDetails +from .booking_booking_source import BookingBookingSource +from .address import Address +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Booking(UncheckedBaseModel): diff --git a/src/square/types/booking_created_event.py b/src/square/types/booking_created_event.py index efe1ff42..34a60913 100644 --- a/src/square/types/booking_created_event.py +++ b/src/square/types/booking_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .booking_created_event_data import BookingCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_created_event_data.py b/src/square/types/booking_created_event_data.py index 6dd3c62b..8a2b80d5 100644 --- a/src/square/types/booking_created_event_data.py +++ b/src/square/types/booking_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .booking_created_event_object import BookingCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/booking_created_event_object.py b/src/square/types/booking_created_event_object.py index d4255f56..8e483b6e 100644 --- a/src/square/types/booking_created_event_object.py +++ b/src/square/types/booking_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .booking import Booking import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .booking import Booking class BookingCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/booking_creator_details.py b/src/square/types/booking_creator_details.py index 08d463ae..9e37b5bd 100644 --- a/src/square/types/booking_creator_details.py +++ b/src/square/types/booking_creator_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .booking_creator_details_creator_type import BookingCreatorDetailsCreatorType import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .booking_creator_details_creator_type import BookingCreatorDetailsCreatorType class BookingCreatorDetails(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_definition_owned_created_event.py b/src/square/types/booking_custom_attribute_definition_owned_created_event.py index e72d893a..37751b09 100644 --- a/src/square/types/booking_custom_attribute_definition_owned_created_event.py +++ b/src/square/types/booking_custom_attribute_definition_owned_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDefinitionOwnedCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_definition_owned_deleted_event.py b/src/square/types/booking_custom_attribute_definition_owned_deleted_event.py index a0904e1d..052565b5 100644 --- a/src/square/types/booking_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/types/booking_custom_attribute_definition_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDefinitionOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_definition_owned_updated_event.py b/src/square/types/booking_custom_attribute_definition_owned_updated_event.py index 86e7b5b4..344871ba 100644 --- a/src/square/types/booking_custom_attribute_definition_owned_updated_event.py +++ b/src/square/types/booking_custom_attribute_definition_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDefinitionOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_definition_visible_created_event.py b/src/square/types/booking_custom_attribute_definition_visible_created_event.py index 8a3120d9..09e84f12 100644 --- a/src/square/types/booking_custom_attribute_definition_visible_created_event.py +++ b/src/square/types/booking_custom_attribute_definition_visible_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDefinitionVisibleCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_definition_visible_deleted_event.py b/src/square/types/booking_custom_attribute_definition_visible_deleted_event.py index 614d1634..c1c8779f 100644 --- a/src/square/types/booking_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/types/booking_custom_attribute_definition_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDefinitionVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_definition_visible_updated_event.py b/src/square/types/booking_custom_attribute_definition_visible_updated_event.py index b38b614f..d577e6d5 100644 --- a/src/square/types/booking_custom_attribute_definition_visible_updated_event.py +++ b/src/square/types/booking_custom_attribute_definition_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDefinitionVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_delete_request.py b/src/square/types/booking_custom_attribute_delete_request.py index 6e7bcf89..c429f342 100644 --- a/src/square/types/booking_custom_attribute_delete_request.py +++ b/src/square/types/booking_custom_attribute_delete_request.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class BookingCustomAttributeDeleteRequest(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_delete_response.py b/src/square/types/booking_custom_attribute_delete_response.py index 94bea07b..0c1bf332 100644 --- a/src/square/types/booking_custom_attribute_delete_response.py +++ b/src/square/types/booking_custom_attribute_delete_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeDeleteResponse(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_owned_deleted_event.py b/src/square/types/booking_custom_attribute_owned_deleted_event.py index ad02fbb4..6b2243e5 100644 --- a/src/square/types/booking_custom_attribute_owned_deleted_event.py +++ b/src/square/types/booking_custom_attribute_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_owned_updated_event.py b/src/square/types/booking_custom_attribute_owned_updated_event.py index f603760b..44c1abca 100644 --- a/src/square/types/booking_custom_attribute_owned_updated_event.py +++ b/src/square/types/booking_custom_attribute_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_upsert_request.py b/src/square/types/booking_custom_attribute_upsert_request.py index 3c4f4ad7..23fa6d38 100644 --- a/src/square/types/booking_custom_attribute_upsert_request.py +++ b/src/square/types/booking_custom_attribute_upsert_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .custom_attribute import CustomAttribute +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeUpsertRequest(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_upsert_response.py b/src/square/types/booking_custom_attribute_upsert_response.py index f408c4b8..50f15a02 100644 --- a/src/square/types/booking_custom_attribute_upsert_response.py +++ b/src/square/types/booking_custom_attribute_upsert_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute import CustomAttribute from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeUpsertResponse(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_visible_deleted_event.py b/src/square/types/booking_custom_attribute_visible_deleted_event.py index 243f0905..e8fd80d1 100644 --- a/src/square/types/booking_custom_attribute_visible_deleted_event.py +++ b/src/square/types/booking_custom_attribute_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_custom_attribute_visible_updated_event.py b/src/square/types/booking_custom_attribute_visible_updated_event.py index e5a8ebb2..0610be21 100644 --- a/src/square/types/booking_custom_attribute_visible_updated_event.py +++ b/src/square/types/booking_custom_attribute_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingCustomAttributeVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_updated_event.py b/src/square/types/booking_updated_event.py index ea72b5c5..b6d4a43b 100644 --- a/src/square/types/booking_updated_event.py +++ b/src/square/types/booking_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .booking_updated_event_data import BookingUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/booking_updated_event_data.py b/src/square/types/booking_updated_event_data.py index 741b4ca1..c547bae0 100644 --- a/src/square/types/booking_updated_event_data.py +++ b/src/square/types/booking_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .booking_updated_event_object import BookingUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BookingUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/booking_updated_event_object.py b/src/square/types/booking_updated_event_object.py index 4003d4b4..5437cbdd 100644 --- a/src/square/types/booking_updated_event_object.py +++ b/src/square/types/booking_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .booking import Booking import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .booking import Booking class BookingUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/break_.py b/src/square/types/break_.py index 77da7832..069c59bd 100644 --- a/src/square/types/break_.py +++ b/src/square/types/break_.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Break(UncheckedBaseModel): diff --git a/src/square/types/break_type.py b/src/square/types/break_type.py index 067acdd5..2678da22 100644 --- a/src/square/types/break_type.py +++ b/src/square/types/break_type.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class BreakType(UncheckedBaseModel): diff --git a/src/square/types/bulk_create_customer_data.py b/src/square/types/bulk_create_customer_data.py index 9ec61e8c..f1ceff45 100644 --- a/src/square/types/bulk_create_customer_data.py +++ b/src/square/types/bulk_create_customer_data.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address from .customer_tax_ids import CustomerTaxIds +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkCreateCustomerData(UncheckedBaseModel): diff --git a/src/square/types/bulk_create_customers_response.py b/src/square/types/bulk_create_customers_response.py index 9fa9b316..abd227cc 100644 --- a/src/square/types/bulk_create_customers_response.py +++ b/src/square/types/bulk_create_customers_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .create_customer_response import CreateCustomerResponse +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkCreateCustomersResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_booking_custom_attributes_response.py b/src/square/types/bulk_delete_booking_custom_attributes_response.py index ed5a5cd6..e55207e6 100644 --- a/src/square/types/bulk_delete_booking_custom_attributes_response.py +++ b/src/square/types/bulk_delete_booking_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking_custom_attribute_delete_response import BookingCustomAttributeDeleteResponse +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkDeleteBookingCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_customers_response.py b/src/square/types/bulk_delete_customers_response.py index 8186fb09..02e20618 100644 --- a/src/square/types/bulk_delete_customers_response.py +++ b/src/square/types/bulk_delete_customers_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .delete_customer_response import DeleteCustomerResponse +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkDeleteCustomersResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py b/src/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py index 25b1d9da..83aa75e4 100644 --- a/src/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py +++ b/src/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_location_custom_attributes_response.py b/src/square/types/bulk_delete_location_custom_attributes_response.py index 0afdab7c..dd0bfcad 100644 --- a/src/square/types/bulk_delete_location_custom_attributes_response.py +++ b/src/square/types/bulk_delete_location_custom_attributes_response.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response import ( BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse, ) +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkDeleteLocationCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py b/src/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py index 4580d8e6..fb405c65 100644 --- a/src/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py +++ b/src/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py b/src/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py index 5a039fbb..58c44699 100644 --- a/src/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py +++ b/src/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_merchant_custom_attributes_response.py b/src/square/types/bulk_delete_merchant_custom_attributes_response.py index 792940d7..52f05920 100644 --- a/src/square/types/bulk_delete_merchant_custom_attributes_response.py +++ b/src/square/types/bulk_delete_merchant_custom_attributes_response.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response import ( BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse, ) +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkDeleteMerchantCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py b/src/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py index 2e0489bc..e19318b9 100644 --- a/src/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py +++ b/src/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py b/src/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py index e2f092cb..bee10c47 100644 --- a/src/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py +++ b/src/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute(UncheckedBaseModel): diff --git a/src/square/types/bulk_delete_order_custom_attributes_response.py b/src/square/types/bulk_delete_order_custom_attributes_response.py index 2d3c2714..09d1e52c 100644 --- a/src/square/types/bulk_delete_order_custom_attributes_response.py +++ b/src/square/types/bulk_delete_order_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponse -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkDeleteOrderCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_publish_scheduled_shifts_data.py b/src/square/types/bulk_publish_scheduled_shifts_data.py index eae202f9..c2d5a27d 100644 --- a/src/square/types/bulk_publish_scheduled_shifts_data.py +++ b/src/square/types/bulk_publish_scheduled_shifts_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class BulkPublishScheduledShiftsData(UncheckedBaseModel): diff --git a/src/square/types/bulk_publish_scheduled_shifts_response.py b/src/square/types/bulk_publish_scheduled_shifts_response.py index 61640447..0cead3cb 100644 --- a/src/square/types/bulk_publish_scheduled_shifts_response.py +++ b/src/square/types/bulk_publish_scheduled_shifts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .publish_scheduled_shift_response import PublishScheduledShiftResponse import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .publish_scheduled_shift_response import PublishScheduledShiftResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkPublishScheduledShiftsResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_retrieve_bookings_response.py b/src/square/types/bulk_retrieve_bookings_response.py index 5b12336e..5921446a 100644 --- a/src/square/types/bulk_retrieve_bookings_response.py +++ b/src/square/types/bulk_retrieve_bookings_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .get_booking_response import GetBookingResponse import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .get_booking_response import GetBookingResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkRetrieveBookingsResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_retrieve_channels_request_constants.py b/src/square/types/bulk_retrieve_channels_request_constants.py deleted file mode 100644 index 16779a7d..00000000 --- a/src/square/types/bulk_retrieve_channels_request_constants.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -BulkRetrieveChannelsRequestConstants = typing.Literal["MAX_BATCH_SIZE"] diff --git a/src/square/types/bulk_retrieve_channels_response.py b/src/square/types/bulk_retrieve_channels_response.py deleted file mode 100644 index b448ef5f..00000000 --- a/src/square/types/bulk_retrieve_channels_response.py +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .retrieve_channel_response import RetrieveChannelResponse - - -class BulkRetrieveChannelsResponse(UncheckedBaseModel): - """ - Defines the fields that are included in the request body for the - [BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint. - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Information about errors encountered during the request. - """ - - responses: typing.Optional[typing.Dict[str, RetrieveChannelResponse]] = pydantic.Field(default=None) - """ - A map of channel IDs to channel responses which tell whether - retrieval for a specific channel is success or not. - Channel response of a success retrieval would contain channel info - whereas channel response of a failed retrieval would have error info. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/bulk_retrieve_customers_response.py b/src/square/types/bulk_retrieve_customers_response.py index db08eb1f..37fe6bdc 100644 --- a/src/square/types/bulk_retrieve_customers_response.py +++ b/src/square/types/bulk_retrieve_customers_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .get_customer_response import GetCustomerResponse import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .get_customer_response import GetCustomerResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkRetrieveCustomersResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_retrieve_team_member_booking_profiles_response.py b/src/square/types/bulk_retrieve_team_member_booking_profiles_response.py index e1dc8972..5c9f6c30 100644 --- a/src/square/types/bulk_retrieve_team_member_booking_profiles_response.py +++ b/src/square/types/bulk_retrieve_team_member_booking_profiles_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkRetrieveTeamMemberBookingProfilesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_swap_plan_response.py b/src/square/types/bulk_swap_plan_response.py index e002e411..ed661de4 100644 --- a/src/square/types/bulk_swap_plan_response.py +++ b/src/square/types/bulk_swap_plan_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class BulkSwapPlanResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_update_customer_data.py b/src/square/types/bulk_update_customer_data.py index 7c2eb3d5..03236b08 100644 --- a/src/square/types/bulk_update_customer_data.py +++ b/src/square/types/bulk_update_customer_data.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address from .customer_tax_ids import CustomerTaxIds +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpdateCustomerData(UncheckedBaseModel): diff --git a/src/square/types/bulk_update_customers_response.py b/src/square/types/bulk_update_customers_response.py index 804c708e..755cd8bc 100644 --- a/src/square/types/bulk_update_customers_response.py +++ b/src/square/types/bulk_update_customers_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .update_customer_response import UpdateCustomerResponse import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .update_customer_response import UpdateCustomerResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpdateCustomersResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_booking_custom_attributes_response.py b/src/square/types/bulk_upsert_booking_custom_attributes_response.py index d6a0da93..e9631e7a 100644 --- a/src/square/types/bulk_upsert_booking_custom_attributes_response.py +++ b/src/square/types/bulk_upsert_booking_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking_custom_attribute_upsert_response import BookingCustomAttributeUpsertResponse +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertBookingCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py b/src/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py index c3e794b5..c6024c34 100644 --- a/src/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py +++ b/src/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .custom_attribute import CustomAttribute +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_location_custom_attributes_response.py b/src/square/types/bulk_upsert_location_custom_attributes_response.py index 762ffbff..71212b1d 100644 --- a/src/square/types/bulk_upsert_location_custom_attributes_response.py +++ b/src/square/types/bulk_upsert_location_custom_attributes_response.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response import ( BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse, ) +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertLocationCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py b/src/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py index e30c6196..62b7d92b 100644 --- a/src/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py +++ b/src/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute import CustomAttribute from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py b/src/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py index 91cb2096..b8c0be43 100644 --- a/src/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py +++ b/src/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .custom_attribute import CustomAttribute +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_merchant_custom_attributes_response.py b/src/square/types/bulk_upsert_merchant_custom_attributes_response.py index cbe56a86..65bbe54e 100644 --- a/src/square/types/bulk_upsert_merchant_custom_attributes_response.py +++ b/src/square/types/bulk_upsert_merchant_custom_attributes_response.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response import ( BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse, ) +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertMerchantCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py b/src/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py index 3d7ef7e3..7f890090 100644 --- a/src/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py +++ b/src/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute import CustomAttribute from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py b/src/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py index 3dd4b292..15e06957 100644 --- a/src/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py +++ b/src/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute import CustomAttribute +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute(UncheckedBaseModel): diff --git a/src/square/types/bulk_upsert_order_custom_attributes_response.py b/src/square/types/bulk_upsert_order_custom_attributes_response.py index b09f66f2..4ac16df6 100644 --- a/src/square/types/bulk_upsert_order_custom_attributes_response.py +++ b/src/square/types/bulk_upsert_order_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .upsert_order_custom_attribute_response import UpsertOrderCustomAttributeResponse +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BulkUpsertOrderCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/business_appointment_settings.py b/src/square/types/business_appointment_settings.py index af5de66c..30eddb32 100644 --- a/src/square/types/business_appointment_settings.py +++ b/src/square/types/business_appointment_settings.py @@ -1,17 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .business_appointment_settings_booking_location_type import BusinessAppointmentSettingsBookingLocationType import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .business_appointment_settings_alignment_time import BusinessAppointmentSettingsAlignmentTime -from .business_appointment_settings_booking_location_type import BusinessAppointmentSettingsBookingLocationType -from .business_appointment_settings_cancellation_policy import BusinessAppointmentSettingsCancellationPolicy from .business_appointment_settings_max_appointments_per_day_limit_type import ( BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType, ) from .money import Money +from .business_appointment_settings_cancellation_policy import BusinessAppointmentSettingsCancellationPolicy +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BusinessAppointmentSettings(UncheckedBaseModel): diff --git a/src/square/types/business_booking_profile.py b/src/square/types/business_booking_profile.py index ce21ba2d..3f9fdf40 100644 --- a/src/square/types/business_booking_profile.py +++ b/src/square/types/business_booking_profile.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .business_appointment_settings import BusinessAppointmentSettings -from .business_booking_profile_booking_policy import BusinessBookingProfileBookingPolicy from .business_booking_profile_customer_timezone_choice import BusinessBookingProfileCustomerTimezoneChoice +from .business_booking_profile_booking_policy import BusinessBookingProfileBookingPolicy +from .business_appointment_settings import BusinessAppointmentSettings +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BusinessBookingProfile(UncheckedBaseModel): diff --git a/src/square/types/business_hours.py b/src/square/types/business_hours.py index 63507106..375eeed8 100644 --- a/src/square/types/business_hours.py +++ b/src/square/types/business_hours.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .business_hours_period import BusinessHoursPeriod import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .business_hours_period import BusinessHoursPeriod class BusinessHours(UncheckedBaseModel): diff --git a/src/square/types/business_hours_period.py b/src/square/types/business_hours_period.py index 80a0c02c..d4ca2994 100644 --- a/src/square/types/business_hours_period.py +++ b/src/square/types/business_hours_period.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .day_of_week import DayOfWeek import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .day_of_week import DayOfWeek class BusinessHoursPeriod(UncheckedBaseModel): diff --git a/src/square/types/buy_now_pay_later_details.py b/src/square/types/buy_now_pay_later_details.py index bcc219c5..26a40cbd 100644 --- a/src/square/types/buy_now_pay_later_details.py +++ b/src/square/types/buy_now_pay_later_details.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .afterpay_details import AfterpayDetails from .clearpay_details import ClearpayDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class BuyNowPayLaterDetails(UncheckedBaseModel): diff --git a/src/square/types/calculate_loyalty_points_response.py b/src/square/types/calculate_loyalty_points_response.py index db1cbd65..2afdc678 100644 --- a/src/square/types/calculate_loyalty_points_response.py +++ b/src/square/types/calculate_loyalty_points_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class CalculateLoyaltyPointsResponse(UncheckedBaseModel): diff --git a/src/square/types/calculate_order_response.py b/src/square/types/calculate_order_response.py index 63d596bb..d89ba237 100644 --- a/src/square/types/calculate_order_response.py +++ b/src/square/types/calculate_order_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CalculateOrderResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_booking_response.py b/src/square/types/cancel_booking_response.py index 52e29727..ddac7350 100644 --- a/src/square/types/cancel_booking_response.py +++ b/src/square/types/cancel_booking_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking import Booking +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelBookingResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_invoice_response.py b/src/square/types/cancel_invoice_response.py index 75e4eee1..f612eff6 100644 --- a/src/square/types/cancel_invoice_response.py +++ b/src/square/types/cancel_invoice_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelInvoiceResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_loyalty_promotion_response.py b/src/square/types/cancel_loyalty_promotion_response.py index 6f6872a0..d1ade92d 100644 --- a/src/square/types/cancel_loyalty_promotion_response.py +++ b/src/square/types/cancel_loyalty_promotion_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_promotion import LoyaltyPromotion +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelLoyaltyPromotionResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_payment_by_idempotency_key_response.py b/src/square/types/cancel_payment_by_idempotency_key_response.py index e04f399c..368ec5d3 100644 --- a/src/square/types/cancel_payment_by_idempotency_key_response.py +++ b/src/square/types/cancel_payment_by_idempotency_key_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class CancelPaymentByIdempotencyKeyResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_payment_response.py b/src/square/types/cancel_payment_response.py index 4c77fec9..94a7ac32 100644 --- a/src/square/types/cancel_payment_response.py +++ b/src/square/types/cancel_payment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment import Payment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelPaymentResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_subscription_response.py b/src/square/types/cancel_subscription_response.py index 4527ba0b..63a78284 100644 --- a/src/square/types/cancel_subscription_response.py +++ b/src/square/types/cancel_subscription_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription from .subscription_action import SubscriptionAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_terminal_action_response.py b/src/square/types/cancel_terminal_action_response.py index 74d9875f..4e393d9e 100644 --- a/src/square/types/cancel_terminal_action_response.py +++ b/src/square/types/cancel_terminal_action_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_action import TerminalAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelTerminalActionResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_terminal_checkout_response.py b/src/square/types/cancel_terminal_checkout_response.py index 918c3207..8a99df36 100644 --- a/src/square/types/cancel_terminal_checkout_response.py +++ b/src/square/types/cancel_terminal_checkout_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_checkout import TerminalCheckout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelTerminalCheckoutResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_terminal_refund_response.py b/src/square/types/cancel_terminal_refund_response.py index f1b1cd3f..6c73b8af 100644 --- a/src/square/types/cancel_terminal_refund_response.py +++ b/src/square/types/cancel_terminal_refund_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_refund import TerminalRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CancelTerminalRefundResponse(UncheckedBaseModel): diff --git a/src/square/types/cancel_transfer_order_response.py b/src/square/types/cancel_transfer_order_response.py deleted file mode 100644 index 26e2324f..00000000 --- a/src/square/types/cancel_transfer_order_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class CancelTransferOrderResponse(UncheckedBaseModel): - """ - Response for canceling a transfer order - """ - - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The updated transfer order with status changed to CANCELED - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/capture_transaction_response.py b/src/square/types/capture_transaction_response.py index 1ad61d65..a552918f 100644 --- a/src/square/types/capture_transaction_response.py +++ b/src/square/types/capture_transaction_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class CaptureTransactionResponse(UncheckedBaseModel): diff --git a/src/square/types/card.py b/src/square/types/card.py index e959ab2a..93aa7eb2 100644 --- a/src/square/types/card.py +++ b/src/square/types/card.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic +from .card_brand import CardBrand import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address -from .card_brand import CardBrand +from .card_type import CardType +from .card_prepaid_type import CardPrepaidType from .card_co_brand import CardCoBrand from .card_issuer_alert import CardIssuerAlert -from .card_prepaid_type import CardPrepaidType -from .card_type import CardType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Card(UncheckedBaseModel): diff --git a/src/square/types/card_automatically_updated_event.py b/src/square/types/card_automatically_updated_event.py index be8d2ed9..87870776 100644 --- a/src/square/types/card_automatically_updated_event.py +++ b/src/square/types/card_automatically_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_automatically_updated_event_data import CardAutomaticallyUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardAutomaticallyUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/card_automatically_updated_event_data.py b/src/square/types/card_automatically_updated_event_data.py index 2b65f1a3..5540b595 100644 --- a/src/square/types/card_automatically_updated_event_data.py +++ b/src/square/types/card_automatically_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_automatically_updated_event_object import CardAutomaticallyUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardAutomaticallyUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/card_automatically_updated_event_object.py b/src/square/types/card_automatically_updated_event_object.py index a073a90d..82f90040 100644 --- a/src/square/types/card_automatically_updated_event_object.py +++ b/src/square/types/card_automatically_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .card import Card import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card import Card class CardAutomaticallyUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/card_created_event.py b/src/square/types/card_created_event.py index 67fbb239..5f93f6e9 100644 --- a/src/square/types/card_created_event.py +++ b/src/square/types/card_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_created_event_data import CardCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/card_created_event_data.py b/src/square/types/card_created_event_data.py index 118ff842..10e14290 100644 --- a/src/square/types/card_created_event_data.py +++ b/src/square/types/card_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_created_event_object import CardCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/card_created_event_object.py b/src/square/types/card_created_event_object.py index f1bfcd58..98dd7d69 100644 --- a/src/square/types/card_created_event_object.py +++ b/src/square/types/card_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .card import Card import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card import Card class CardCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/card_disabled_event.py b/src/square/types/card_disabled_event.py index 8ac71ee4..fd9c4a5d 100644 --- a/src/square/types/card_disabled_event.py +++ b/src/square/types/card_disabled_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_disabled_event_data import CardDisabledEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardDisabledEvent(UncheckedBaseModel): diff --git a/src/square/types/card_disabled_event_data.py b/src/square/types/card_disabled_event_data.py index 7eae28a1..53d71abc 100644 --- a/src/square/types/card_disabled_event_data.py +++ b/src/square/types/card_disabled_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_disabled_event_object import CardDisabledEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardDisabledEventData(UncheckedBaseModel): diff --git a/src/square/types/card_disabled_event_object.py b/src/square/types/card_disabled_event_object.py index 5029e079..b5840e37 100644 --- a/src/square/types/card_disabled_event_object.py +++ b/src/square/types/card_disabled_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .card import Card import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card import Card class CardDisabledEventObject(UncheckedBaseModel): diff --git a/src/square/types/card_forgotten_event.py b/src/square/types/card_forgotten_event.py index 26ad3067..3cbb3d28 100644 --- a/src/square/types/card_forgotten_event.py +++ b/src/square/types/card_forgotten_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_forgotten_event_data import CardForgottenEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardForgottenEvent(UncheckedBaseModel): diff --git a/src/square/types/card_forgotten_event_card.py b/src/square/types/card_forgotten_event_card.py index 3696fdac..ecfb63f0 100644 --- a/src/square/types/card_forgotten_event_card.py +++ b/src/square/types/card_forgotten_event_card.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CardForgottenEventCard(UncheckedBaseModel): diff --git a/src/square/types/card_forgotten_event_data.py b/src/square/types/card_forgotten_event_data.py index f26729de..de78aeba 100644 --- a/src/square/types/card_forgotten_event_data.py +++ b/src/square/types/card_forgotten_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_forgotten_event_object import CardForgottenEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardForgottenEventData(UncheckedBaseModel): diff --git a/src/square/types/card_forgotten_event_object.py b/src/square/types/card_forgotten_event_object.py index 2bb2ac16..b4cf61dc 100644 --- a/src/square/types/card_forgotten_event_object.py +++ b/src/square/types/card_forgotten_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .card_forgotten_event_card import CardForgottenEventCard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card_forgotten_event_card import CardForgottenEventCard class CardForgottenEventObject(UncheckedBaseModel): diff --git a/src/square/types/card_payment_details.py b/src/square/types/card_payment_details.py index f8c0eba0..8dd7b108 100644 --- a/src/square/types/card_payment_details.py +++ b/src/square/types/card_payment_details.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card -from .card_payment_timeline import CardPaymentTimeline from .device_details import DeviceDetails +from .card_payment_timeline import CardPaymentTimeline from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardPaymentDetails(UncheckedBaseModel): diff --git a/src/square/types/card_payment_timeline.py b/src/square/types/card_payment_timeline.py index 49467632..57869896 100644 --- a/src/square/types/card_payment_timeline.py +++ b/src/square/types/card_payment_timeline.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CardPaymentTimeline(UncheckedBaseModel): diff --git a/src/square/types/card_updated_event.py b/src/square/types/card_updated_event.py index a5943f9b..1f1cf38b 100644 --- a/src/square/types/card_updated_event.py +++ b/src/square/types/card_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_updated_event_data import CardUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/card_updated_event_data.py b/src/square/types/card_updated_event_data.py index d6e6027c..ff129f11 100644 --- a/src/square/types/card_updated_event_data.py +++ b/src/square/types/card_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card_updated_event_object import CardUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CardUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/card_updated_event_object.py b/src/square/types/card_updated_event_object.py index 5c31ee88..f84388bf 100644 --- a/src/square/types/card_updated_event_object.py +++ b/src/square/types/card_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .card import Card import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card import Card class CardUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/cash_app_details.py b/src/square/types/cash_app_details.py index 996e7770..6d72a572 100644 --- a/src/square/types/cash_app_details.py +++ b/src/square/types/cash_app_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CashAppDetails(UncheckedBaseModel): diff --git a/src/square/types/cash_drawer_device.py b/src/square/types/cash_drawer_device.py index 10cd29bf..7515396d 100644 --- a/src/square/types/cash_drawer_device.py +++ b/src/square/types/cash_drawer_device.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CashDrawerDevice(UncheckedBaseModel): diff --git a/src/square/types/cash_drawer_shift.py b/src/square/types/cash_drawer_shift.py index 967ddfe8..a222d903 100644 --- a/src/square/types/cash_drawer_shift.py +++ b/src/square/types/cash_drawer_shift.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .cash_drawer_device import CashDrawerDevice from .cash_drawer_shift_state import CashDrawerShiftState from .money import Money +from .cash_drawer_device import CashDrawerDevice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CashDrawerShift(UncheckedBaseModel): diff --git a/src/square/types/cash_drawer_shift_event.py b/src/square/types/cash_drawer_shift_event.py index 49a2cba7..e239a85b 100644 --- a/src/square/types/cash_drawer_shift_event.py +++ b/src/square/types/cash_drawer_shift_event.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .cash_drawer_event_type import CashDrawerEventType from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CashDrawerShiftEvent(UncheckedBaseModel): diff --git a/src/square/types/cash_drawer_shift_summary.py b/src/square/types/cash_drawer_shift_summary.py index ef988c82..7005c6c4 100644 --- a/src/square/types/cash_drawer_shift_summary.py +++ b/src/square/types/cash_drawer_shift_summary.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .cash_drawer_shift_state import CashDrawerShiftState from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CashDrawerShiftSummary(UncheckedBaseModel): diff --git a/src/square/types/cash_payment_details.py b/src/square/types/cash_payment_details.py index afe88268..bc0fd033 100644 --- a/src/square/types/cash_payment_details.py +++ b/src/square/types/cash_payment_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CashPaymentDetails(UncheckedBaseModel): diff --git a/src/square/types/catalog_availability_period.py b/src/square/types/catalog_availability_period.py index d6a4f2d4..64d21261 100644 --- a/src/square/types/catalog_availability_period.py +++ b/src/square/types/catalog_availability_period.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .day_of_week import DayOfWeek +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogAvailabilityPeriod(UncheckedBaseModel): diff --git a/src/square/types/catalog_category.py b/src/square/types/catalog_category.py index 3c69e61c..2a185f17 100644 --- a/src/square/types/catalog_category.py +++ b/src/square/types/catalog_category.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_category_type import CatalogCategoryType from .catalog_ecom_seo_data import CatalogEcomSeoData from .category_path_to_root_node import CategoryPathToRootNode +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs class CatalogCategory(UncheckedBaseModel): @@ -85,6 +84,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_object_category import CatalogObjectCategory # noqa: E402, I001 +from .catalog_object_category import CatalogObjectCategory # noqa: E402 update_forward_refs(CatalogCategory) diff --git a/src/square/types/catalog_custom_attribute_definition.py b/src/square/types/catalog_custom_attribute_definition.py index 93cf4bea..d4fe0883 100644 --- a/src/square/types/catalog_custom_attribute_definition.py +++ b/src/square/types/catalog_custom_attribute_definition.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType +import pydantic +import typing +from .source_application import SourceApplication +from .catalog_object_type import CatalogObjectType +from .catalog_custom_attribute_definition_seller_visibility import CatalogCustomAttributeDefinitionSellerVisibility from .catalog_custom_attribute_definition_app_visibility import CatalogCustomAttributeDefinitionAppVisibility +from .catalog_custom_attribute_definition_string_config import CatalogCustomAttributeDefinitionStringConfig from .catalog_custom_attribute_definition_number_config import CatalogCustomAttributeDefinitionNumberConfig from .catalog_custom_attribute_definition_selection_config import CatalogCustomAttributeDefinitionSelectionConfig -from .catalog_custom_attribute_definition_seller_visibility import CatalogCustomAttributeDefinitionSellerVisibility -from .catalog_custom_attribute_definition_string_config import CatalogCustomAttributeDefinitionStringConfig -from .catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType -from .catalog_object_type import CatalogObjectType -from .source_application import SourceApplication +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogCustomAttributeDefinition(UncheckedBaseModel): diff --git a/src/square/types/catalog_custom_attribute_definition_number_config.py b/src/square/types/catalog_custom_attribute_definition_number_config.py index 8c722499..4869d458 100644 --- a/src/square/types/catalog_custom_attribute_definition_number_config.py +++ b/src/square/types/catalog_custom_attribute_definition_number_config.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogCustomAttributeDefinitionNumberConfig(UncheckedBaseModel): diff --git a/src/square/types/catalog_custom_attribute_definition_selection_config.py b/src/square/types/catalog_custom_attribute_definition_selection_config.py index ccaf9071..34e42e21 100644 --- a/src/square/types/catalog_custom_attribute_definition_selection_config.py +++ b/src/square/types/catalog_custom_attribute_definition_selection_config.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_custom_attribute_definition_selection_config_custom_attribute_selection import ( CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection, ) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogCustomAttributeDefinitionSelectionConfig(UncheckedBaseModel): diff --git a/src/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py b/src/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py index c48b3588..cda11f87 100644 --- a/src/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py +++ b/src/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection(UncheckedBaseModel): diff --git a/src/square/types/catalog_custom_attribute_definition_string_config.py b/src/square/types/catalog_custom_attribute_definition_string_config.py index 14a89109..eac438ba 100644 --- a/src/square/types/catalog_custom_attribute_definition_string_config.py +++ b/src/square/types/catalog_custom_attribute_definition_string_config.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogCustomAttributeDefinitionStringConfig(UncheckedBaseModel): diff --git a/src/square/types/catalog_custom_attribute_value.py b/src/square/types/catalog_custom_attribute_value.py index 5eca36ab..519f60bb 100644 --- a/src/square/types/catalog_custom_attribute_value.py +++ b/src/square/types/catalog_custom_attribute_value.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_custom_attribute_definition_type import CatalogCustomAttributeDefinitionType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogCustomAttributeValue(UncheckedBaseModel): diff --git a/src/square/types/catalog_discount.py b/src/square/types/catalog_discount.py index 3aa239af..66179f39 100644 --- a/src/square/types/catalog_discount.py +++ b/src/square/types/catalog_discount.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_discount_modify_tax_basis import CatalogDiscountModifyTaxBasis from .catalog_discount_type import CatalogDiscountType from .money import Money +from .catalog_discount_modify_tax_basis import CatalogDiscountModifyTaxBasis +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogDiscount(UncheckedBaseModel): diff --git a/src/square/types/catalog_ecom_seo_data.py b/src/square/types/catalog_ecom_seo_data.py index af9947f3..f6ac1540 100644 --- a/src/square/types/catalog_ecom_seo_data.py +++ b/src/square/types/catalog_ecom_seo_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogEcomSeoData(UncheckedBaseModel): diff --git a/src/square/types/catalog_id_mapping.py b/src/square/types/catalog_id_mapping.py index 97d5d4a5..6a146a50 100644 --- a/src/square/types/catalog_id_mapping.py +++ b/src/square/types/catalog_id_mapping.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogIdMapping(UncheckedBaseModel): diff --git a/src/square/types/catalog_image.py b/src/square/types/catalog_image.py index 94fef941..5628e596 100644 --- a/src/square/types/catalog_image.py +++ b/src/square/types/catalog_image.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogImage(UncheckedBaseModel): diff --git a/src/square/types/catalog_info_response.py b/src/square/types/catalog_info_response.py index 2a8a909b..01adbd1b 100644 --- a/src/square/types/catalog_info_response.py +++ b/src/square/types/catalog_info_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_info_response_limits import CatalogInfoResponseLimits -from .error import Error from .standard_unit_description_group import StandardUnitDescriptionGroup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogInfoResponse(UncheckedBaseModel): diff --git a/src/square/types/catalog_info_response_limits.py b/src/square/types/catalog_info_response_limits.py index 4de62bb4..4a603979 100644 --- a/src/square/types/catalog_info_response_limits.py +++ b/src/square/types/catalog_info_response_limits.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogInfoResponseLimits(UncheckedBaseModel): diff --git a/src/square/types/catalog_item.py b/src/square/types/catalog_item.py index 08b5c2a6..0d3a66cc 100644 --- a/src/square/types/catalog_item.py +++ b/src/square/types/catalog_item.py @@ -1,17 +1,18 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_ecom_seo_data import CatalogEcomSeoData -from .catalog_item_food_and_beverage_details import CatalogItemFoodAndBeverageDetails from .catalog_item_modifier_list_info import CatalogItemModifierListInfo -from .catalog_item_option_for_item import CatalogItemOptionForItem from .catalog_item_product_type import CatalogItemProductType +from .catalog_item_option_for_item import CatalogItemOptionForItem +from .catalog_ecom_seo_data import CatalogEcomSeoData +from .catalog_item_food_and_beverage_details import CatalogItemFoodAndBeverageDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs class CatalogItem(UncheckedBaseModel): @@ -131,7 +132,7 @@ class CatalogItem(UncheckedBaseModel): It is currently supported for sellers of the Japanese locale only. """ - categories: typing.Optional[typing.List["CatalogObjectCategory"]] = pydantic.Field(default=None) + categories: typing.Optional[typing.List[CatalogObjectCategory]] = pydantic.Field(default=None) """ The list of categories. """ @@ -190,7 +191,7 @@ class CatalogItem(UncheckedBaseModel): The food and beverage-specific details for the `FOOD_AND_BEV` item. """ - reporting_category: typing.Optional["CatalogObjectCategory"] = pydantic.Field(default=None) + reporting_category: typing.Optional[CatalogObjectCategory] = pydantic.Field(default=None) """ The item's reporting category. """ @@ -210,17 +211,13 @@ class Config: extra = pydantic.Extra.allow -from .catalog_object_category import CatalogObjectCategory # noqa: E402, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - CatalogItem, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 +from .catalog_object import CatalogObject # noqa: E402 + +update_forward_refs(CatalogItem) diff --git a/src/square/types/catalog_item_food_and_beverage_details.py b/src/square/types/catalog_item_food_and_beverage_details.py index c2a8c78c..56041d08 100644 --- a/src/square/types/catalog_item_food_and_beverage_details.py +++ b/src/square/types/catalog_item_food_and_beverage_details.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_item_food_and_beverage_details_dietary_preference import ( CatalogItemFoodAndBeverageDetailsDietaryPreference, ) from .catalog_item_food_and_beverage_details_ingredient import CatalogItemFoodAndBeverageDetailsIngredient +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogItemFoodAndBeverageDetails(UncheckedBaseModel): diff --git a/src/square/types/catalog_item_food_and_beverage_details_dietary_preference.py b/src/square/types/catalog_item_food_and_beverage_details_dietary_preference.py index 9371dba5..282ba86f 100644 --- a/src/square/types/catalog_item_food_and_beverage_details_dietary_preference.py +++ b/src/square/types/catalog_item_food_and_beverage_details_dietary_preference.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .catalog_item_food_and_beverage_details_dietary_preference_type import ( + CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, +) import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference import ( CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference, ) -from .catalog_item_food_and_beverage_details_dietary_preference_type import ( - CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, -) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogItemFoodAndBeverageDetailsDietaryPreference(UncheckedBaseModel): diff --git a/src/square/types/catalog_item_food_and_beverage_details_ingredient.py b/src/square/types/catalog_item_food_and_beverage_details_ingredient.py index 19cb1f5e..7a4bdc7c 100644 --- a/src/square/types/catalog_item_food_and_beverage_details_ingredient.py +++ b/src/square/types/catalog_item_food_and_beverage_details_ingredient.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .catalog_item_food_and_beverage_details_dietary_preference_type import ( CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, ) +import pydantic from .catalog_item_food_and_beverage_details_ingredient_standard_ingredient import ( CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient, ) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogItemFoodAndBeverageDetailsIngredient(UncheckedBaseModel): diff --git a/src/square/types/catalog_item_modifier_list_info.py b/src/square/types/catalog_item_modifier_list_info.py index 2af03cb9..ea039797 100644 --- a/src/square/types/catalog_item_modifier_list_info.py +++ b/src/square/types/catalog_item_modifier_list_info.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .catalog_modifier_override import CatalogModifierOverride +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogItemModifierListInfo(UncheckedBaseModel): @@ -59,9 +58,9 @@ class CatalogItemModifierListInfo(UncheckedBaseModel): to a `CatalogItem` instance. """ - allow_quantities: typing.Optional[typing.Any] = None - is_conversational: typing.Optional[typing.Any] = None - hidden_from_customer_override: typing.Optional[typing.Any] = None + allow_quantities: typing.Optional[typing.Optional[typing.Any]] = None + is_conversational: typing.Optional[typing.Optional[typing.Any]] = None + hidden_from_customer_override: typing.Optional[typing.Optional[typing.Any]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/square/types/catalog_item_option.py b/src/square/types/catalog_item_option.py index af0cf3ca..20514637 100644 --- a/src/square/types/catalog_item_option.py +++ b/src/square/types/catalog_item_option.py @@ -1,12 +1,13 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs class CatalogItemOption(UncheckedBaseModel): @@ -53,16 +54,13 @@ class Config: extra = pydantic.Extra.allow -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 +from .catalog_object import CatalogObject # noqa: E402 -update_forward_refs( - CatalogItemOption, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) +update_forward_refs(CatalogItemOption) diff --git a/src/square/types/catalog_item_option_for_item.py b/src/square/types/catalog_item_option_for_item.py index 109e10ee..b08ad542 100644 --- a/src/square/types/catalog_item_option_for_item.py +++ b/src/square/types/catalog_item_option_for_item.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogItemOptionForItem(UncheckedBaseModel): diff --git a/src/square/types/catalog_item_option_value.py b/src/square/types/catalog_item_option_value.py index e60f9004..426de7c5 100644 --- a/src/square/types/catalog_item_option_value.py +++ b/src/square/types/catalog_item_option_value.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogItemOptionValue(UncheckedBaseModel): diff --git a/src/square/types/catalog_item_option_value_for_item_variation.py b/src/square/types/catalog_item_option_value_for_item_variation.py index fe38369c..058ab819 100644 --- a/src/square/types/catalog_item_option_value_for_item_variation.py +++ b/src/square/types/catalog_item_option_value_for_item_variation.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogItemOptionValueForItemVariation(UncheckedBaseModel): diff --git a/src/square/types/catalog_item_variation.py b/src/square/types/catalog_item_variation.py index ff638fd5..1c9b658c 100644 --- a/src/square/types/catalog_item_variation.py +++ b/src/square/types/catalog_item_variation.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_item_option_value_for_item_variation import CatalogItemOptionValueForItemVariation from .catalog_pricing_type import CatalogPricingType -from .catalog_stock_conversion import CatalogStockConversion -from .inventory_alert_type import InventoryAlertType -from .item_variation_location_overrides import ItemVariationLocationOverrides from .money import Money +from .item_variation_location_overrides import ItemVariationLocationOverrides +from .inventory_alert_type import InventoryAlertType +from .catalog_item_option_value_for_item_variation import CatalogItemOptionValueForItemVariation +from .catalog_stock_conversion import CatalogStockConversion +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogItemVariation(UncheckedBaseModel): diff --git a/src/square/types/catalog_measurement_unit.py b/src/square/types/catalog_measurement_unit.py index 77cfe4a8..fd659c6d 100644 --- a/src/square/types/catalog_measurement_unit.py +++ b/src/square/types/catalog_measurement_unit.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .measurement_unit import MeasurementUnit import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .measurement_unit import MeasurementUnit class CatalogMeasurementUnit(UncheckedBaseModel): diff --git a/src/square/types/catalog_modifier.py b/src/square/types/catalog_modifier.py index 196f8267..692abcc7 100644 --- a/src/square/types/catalog_modifier.py +++ b/src/square/types/catalog_modifier.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .modifier_location_overrides import ModifierLocationOverrides from .money import Money +from .modifier_location_overrides import ModifierLocationOverrides +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogModifier(UncheckedBaseModel): diff --git a/src/square/types/catalog_modifier_list.py b/src/square/types/catalog_modifier_list.py index 36be51b2..1ad14452 100644 --- a/src/square/types/catalog_modifier_list.py +++ b/src/square/types/catalog_modifier_list.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_modifier_list_modifier_type import CatalogModifierListModifierType from .catalog_modifier_list_selection_type import CatalogModifierListSelectionType +from .catalog_modifier_list_modifier_type import CatalogModifierListModifierType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs class CatalogModifierList(UncheckedBaseModel): @@ -141,16 +142,13 @@ class Config: extra = pydantic.Extra.allow -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 +from .catalog_object import CatalogObject # noqa: E402 -update_forward_refs( - CatalogModifierList, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) +update_forward_refs(CatalogModifierList) diff --git a/src/square/types/catalog_modifier_override.py b/src/square/types/catalog_modifier_override.py index 1a704f45..c45f0601 100644 --- a/src/square/types/catalog_modifier_override.py +++ b/src/square/types/catalog_modifier_override.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogModifierOverride(UncheckedBaseModel): @@ -22,8 +21,8 @@ class CatalogModifierOverride(UncheckedBaseModel): __Deprecated__: Use `on_by_default_override` instead. """ - hidden_online_override: typing.Optional[typing.Any] = None - on_by_default_override: typing.Optional[typing.Any] = None + hidden_online_override: typing.Optional[typing.Optional[typing.Any]] = None + on_by_default_override: typing.Optional[typing.Optional[typing.Any]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/square/types/catalog_object.py b/src/square/types/catalog_object.py index 167f2f54..4972b94e 100644 --- a/src/square/types/catalog_object.py +++ b/src/square/types/catalog_object.py @@ -1,48 +1,816 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel import typing +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .catalog_image import CatalogImage +from .catalog_item_variation import CatalogItemVariation +from .catalog_tax import CatalogTax +from .catalog_discount import CatalogDiscount +from .catalog_modifier import CatalogModifier +from .catalog_pricing_rule import CatalogPricingRule +from .catalog_product_set import CatalogProductSet +from .catalog_time_period import CatalogTimePeriod +from .catalog_measurement_unit import CatalogMeasurementUnit +from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariation +from .catalog_item_option_value import CatalogItemOptionValue +from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinition +from .catalog_quick_amounts_settings import CatalogQuickAmountsSettings +from .catalog_availability_period import CatalogAvailabilityPeriod +from ..core.unchecked_base_model import UnionMetadata +from ..core.pydantic_utilities import update_forward_refs + + +class CatalogObject_Item(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["ITEM"] = "ITEM" + item_data: typing.Optional["CatalogItem"] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_Image(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["IMAGE"] = "IMAGE" + image_data: typing.Optional[CatalogImage] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_Category(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["CATEGORY"] = "CATEGORY" + id: typing.Optional[str] = None + ordinal: typing.Optional[int] = None + type: typing.Optional[typing.Literal["CATEGORY"]] = None + category_data: typing.Optional["CatalogCategory"] = None + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .catalog_category import CatalogCategory # noqa: E402 +from .catalog_object_category import CatalogObjectCategory # noqa: E402 + + +class CatalogObject_ItemVariation(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["ITEM_VARIATION"] = "ITEM_VARIATION" + item_variation_data: typing.Optional[CatalogItemVariation] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_Tax(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["TAX"] = "TAX" + tax_data: typing.Optional[CatalogTax] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_Discount(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["DISCOUNT"] = "DISCOUNT" + discount_data: typing.Optional[CatalogDiscount] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_ModifierList(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["MODIFIER_LIST"] = "MODIFIER_LIST" + modifier_list_data: typing.Optional["CatalogModifierList"] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_Modifier(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["MODIFIER"] = "MODIFIER" + modifier_data: typing.Optional[CatalogModifier] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_PricingRule(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["PRICING_RULE"] = "PRICING_RULE" + pricing_rule_data: typing.Optional[CatalogPricingRule] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_ProductSet(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. -from .catalog_object_availability_period import CatalogObjectAvailabilityPeriod -from .catalog_object_category import CatalogObjectCategory -from .catalog_object_custom_attribute_definition import CatalogObjectCustomAttributeDefinition -from .catalog_object_discount import CatalogObjectDiscount -from .catalog_object_image import CatalogObjectImage -from .catalog_object_item_option_value import CatalogObjectItemOptionValue -from .catalog_object_item_variation import CatalogObjectItemVariation -from .catalog_object_measurement_unit import CatalogObjectMeasurementUnit -from .catalog_object_modifier import CatalogObjectModifier -from .catalog_object_pricing_rule import CatalogObjectPricingRule -from .catalog_object_product_set import CatalogObjectProductSet -from .catalog_object_quick_amounts_settings import CatalogObjectQuickAmountsSettings -from .catalog_object_subscription_plan_variation import CatalogObjectSubscriptionPlanVariation -from .catalog_object_tax import CatalogObjectTax -from .catalog_object_time_period import CatalogObjectTimePeriod - -if typing.TYPE_CHECKING: - from .catalog_object_item import CatalogObjectItem - from .catalog_object_item_option import CatalogObjectItemOption - from .catalog_object_modifier_list import CatalogObjectModifierList - from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan -CatalogObject = typing.Union[ - "CatalogObjectItem", - CatalogObjectImage, - CatalogObjectCategory, - CatalogObjectItemVariation, - CatalogObjectTax, - CatalogObjectDiscount, - "CatalogObjectModifierList", - CatalogObjectModifier, - CatalogObjectPricingRule, - CatalogObjectProductSet, - CatalogObjectTimePeriod, - CatalogObjectMeasurementUnit, - CatalogObjectSubscriptionPlanVariation, - "CatalogObjectItemOption", - CatalogObjectItemOptionValue, - CatalogObjectCustomAttributeDefinition, - CatalogObjectQuickAmountsSettings, - "CatalogObjectSubscriptionPlan", - CatalogObjectAvailabilityPeriod, + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["PRODUCT_SET"] = "PRODUCT_SET" + product_set_data: typing.Optional[CatalogProductSet] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_TimePeriod(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["TIME_PERIOD"] = "TIME_PERIOD" + time_period_data: typing.Optional[CatalogTimePeriod] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_MeasurementUnit(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["MEASUREMENT_UNIT"] = "MEASUREMENT_UNIT" + measurement_unit_data: typing.Optional[CatalogMeasurementUnit] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_SubscriptionPlanVariation(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["SUBSCRIPTION_PLAN_VARIATION"] = "SUBSCRIPTION_PLAN_VARIATION" + subscription_plan_variation_data: typing.Optional[CatalogSubscriptionPlanVariation] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_ItemOption(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["ITEM_OPTION"] = "ITEM_OPTION" + item_option_data: typing.Optional["CatalogItemOption"] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_ItemOptionVal(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["ITEM_OPTION_VAL"] = "ITEM_OPTION_VAL" + item_option_value_data: typing.Optional[CatalogItemOptionValue] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_CustomAttributeDefinition(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["CUSTOM_ATTRIBUTE_DEFINITION"] = "CUSTOM_ATTRIBUTE_DEFINITION" + custom_attribute_definition_data: typing.Optional[CatalogCustomAttributeDefinition] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_QuickAmountsSettings(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["QUICK_AMOUNTS_SETTINGS"] = "QUICK_AMOUNTS_SETTINGS" + quick_amounts_settings_data: typing.Optional[CatalogQuickAmountsSettings] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CatalogObject_SubscriptionPlan(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["SUBSCRIPTION_PLAN"] = "SUBSCRIPTION_PLAN" + subscription_plan_data: typing.Optional["CatalogSubscriptionPlan"] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 + + +class CatalogObject_AvailabilityPeriod(UncheckedBaseModel): + """ + The wrapper object for the catalog entries of a given object type. + + Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + + For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + + In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + + For a more detailed discussion of the Catalog data model, please see the + [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + """ + + type: typing.Literal["AVAILABILITY_PERIOD"] = "AVAILABILITY_PERIOD" + availability_period_data: typing.Optional[CatalogAvailabilityPeriod] = None + id: str + updated_at: typing.Optional[str] = None + version: typing.Optional[int] = None + is_deleted: typing.Optional[bool] = None + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = None + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = None + present_at_all_locations: typing.Optional[bool] = None + present_at_location_ids: typing.Optional[typing.List[str]] = None + absent_at_location_ids: typing.Optional[typing.List[str]] = None + image_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CatalogObject = typing_extensions.Annotated[ + typing.Union[ + CatalogObject_Item, + CatalogObject_Image, + CatalogObject_Category, + CatalogObject_ItemVariation, + CatalogObject_Tax, + CatalogObject_Discount, + CatalogObject_ModifierList, + CatalogObject_Modifier, + CatalogObject_PricingRule, + CatalogObject_ProductSet, + CatalogObject_TimePeriod, + CatalogObject_MeasurementUnit, + CatalogObject_SubscriptionPlanVariation, + CatalogObject_ItemOption, + CatalogObject_ItemOptionVal, + CatalogObject_CustomAttributeDefinition, + CatalogObject_QuickAmountsSettings, + CatalogObject_SubscriptionPlan, + CatalogObject_AvailabilityPeriod, + ], + UnionMetadata(discriminant="type"), ] +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 + +update_forward_refs(CatalogObject_Item) +update_forward_refs(CatalogObject_Category) +update_forward_refs(CatalogObject_ModifierList) +update_forward_refs(CatalogObject_ItemOption) +update_forward_refs(CatalogObject_SubscriptionPlan) diff --git a/src/square/types/catalog_object_availability_period.py b/src/square/types/catalog_object_availability_period.py index df76f0bb..0b8417a2 100644 --- a/src/square/types/catalog_object_availability_period.py +++ b/src/square/types/catalog_object_availability_period.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_availability_period import CatalogAvailabilityPeriod import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_availability_period import CatalogAvailabilityPeriod -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_v1id import CatalogV1Id -class CatalogObjectAvailabilityPeriod(UncheckedBaseModel): - type: typing.Literal["AVAILABILITY_PERIOD"] = "AVAILABILITY_PERIOD" +class CatalogObjectAvailabilityPeriod(CatalogObjectBase): availability_period_data: typing.Optional[CatalogAvailabilityPeriod] = pydantic.Field(default=None) """ Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_base.py b/src/square/types/catalog_object_base.py index 467a19f3..2e933f37 100644 --- a/src/square/types/catalog_object_base.py +++ b/src/square/types/catalog_object_base.py @@ -1,25 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_object_type import CatalogObjectType +import typing_extensions from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogObjectBase(UncheckedBaseModel): - type: CatalogObjectType = pydantic.Field() - """ - The type of this object. Each object type has expected - properties expressed in a structured format within its corresponding `*_data` field below. - See [CatalogObjectType](#type-catalogobjecttype) for possible values - """ - id: str = pydantic.Field() """ An identifier to reference this object in the catalog. When a new `CatalogObject` diff --git a/src/square/types/catalog_object_batch.py b/src/square/types/catalog_object_batch.py index d2c45b54..4b16a125 100644 --- a/src/square/types/catalog_object_batch.py +++ b/src/square/types/catalog_object_batch.py @@ -1,12 +1,20 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan import typing - +from .catalog_object import CatalogObject import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogObjectBatch(UncheckedBaseModel): @@ -14,7 +22,7 @@ class CatalogObjectBatch(UncheckedBaseModel): A batch of catalog objects. """ - objects: typing.List["CatalogObject"] = pydantic.Field() + objects: typing.List[CatalogObject] = pydantic.Field() """ A list of CatalogObjects belonging to this batch. """ @@ -27,18 +35,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - CatalogObjectBatch, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/catalog_object_category.py b/src/square/types/catalog_object_category.py index 99a35db2..1019ca60 100644 --- a/src/square/types/catalog_object_category.py +++ b/src/square/types/catalog_object_category.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs class CatalogObjectCategory(UncheckedBaseModel): @@ -30,7 +29,7 @@ class CatalogObjectCategory(UncheckedBaseModel): The order of the object within the context of the category. """ - type: typing.Literal["CATEGORY"] = "CATEGORY" + type: typing.Optional[typing.Literal["CATEGORY"]] = None category_data: typing.Optional["CatalogCategory"] = pydantic.Field(default=None) """ Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`. @@ -119,6 +118,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, I001 +from .catalog_category import CatalogCategory # noqa: E402 update_forward_refs(CatalogObjectCategory) diff --git a/src/square/types/catalog_object_custom_attribute_definition.py b/src/square/types/catalog_object_custom_attribute_definition.py index aeb77ee6..d88f60c2 100644 --- a/src/square/types/catalog_object_custom_attribute_definition.py +++ b/src/square/types/catalog_object_custom_attribute_definition.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinition import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinition -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_v1id import CatalogV1Id -class CatalogObjectCustomAttributeDefinition(UncheckedBaseModel): - type: typing.Literal["CUSTOM_ATTRIBUTE_DEFINITION"] = "CUSTOM_ATTRIBUTE_DEFINITION" +class CatalogObjectCustomAttributeDefinition(CatalogObjectBase): custom_attribute_definition_data: typing.Optional[CatalogCustomAttributeDefinition] = pydantic.Field(default=None) """ Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_discount.py b/src/square/types/catalog_object_discount.py index aae3de08..41d7bb70 100644 --- a/src/square/types/catalog_object_discount.py +++ b/src/square/types/catalog_object_discount.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_discount import CatalogDiscount import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_discount import CatalogDiscount -from .catalog_v1id import CatalogV1Id -class CatalogObjectDiscount(UncheckedBaseModel): - type: typing.Literal["DISCOUNT"] = "DISCOUNT" +class CatalogObjectDiscount(CatalogObjectBase): discount_data: typing.Optional[CatalogDiscount] = pydantic.Field(default=None) """ Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_image.py b/src/square/types/catalog_object_image.py index be690e52..cce313d7 100644 --- a/src/square/types/catalog_object_image.py +++ b/src/square/types/catalog_object_image.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_image import CatalogImage import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_image import CatalogImage -from .catalog_v1id import CatalogV1Id -class CatalogObjectImage(UncheckedBaseModel): - type: typing.Literal["IMAGE"] = "IMAGE" +class CatalogObjectImage(CatalogObjectBase): image_data: typing.Optional[CatalogImage] = pydantic.Field(default=None) """ Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_item.py b/src/square/types/catalog_object_item.py index 36e68c26..49c706b4 100644 --- a/src/square/types/catalog_object_item.py +++ b/src/square/types/catalog_object_item.py @@ -1,109 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from .catalog_object_base import CatalogObjectBase +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_v1id import CatalogV1Id +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectItem(UncheckedBaseModel): - type: typing.Literal["ITEM"] = "ITEM" +class CatalogObjectItem(CatalogObjectBase): item_data: typing.Optional["CatalogItem"] = pydantic.Field(default=None) """ Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -114,6 +26,12 @@ class Config: extra = pydantic.Extra.allow -from .catalog_item import CatalogItem # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 update_forward_refs(CatalogObjectItem) diff --git a/src/square/types/catalog_object_item_option.py b/src/square/types/catalog_object_item_option.py index 5abd62a9..4341458d 100644 --- a/src/square/types/catalog_object_item_option.py +++ b/src/square/types/catalog_object_item_option.py @@ -1,109 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from .catalog_object_base import CatalogObjectBase +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_v1id import CatalogV1Id +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectItemOption(UncheckedBaseModel): - type: typing.Literal["ITEM_OPTION"] = "ITEM_OPTION" +class CatalogObjectItemOption(CatalogObjectBase): item_option_data: typing.Optional["CatalogItemOption"] = pydantic.Field(default=None) """ Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -114,6 +26,12 @@ class Config: extra = pydantic.Extra.allow -from .catalog_item_option import CatalogItemOption # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 update_forward_refs(CatalogObjectItemOption) diff --git a/src/square/types/catalog_object_item_option_value.py b/src/square/types/catalog_object_item_option_value.py index 87f53952..c41e11ab 100644 --- a/src/square/types/catalog_object_item_option_value.py +++ b/src/square/types/catalog_object_item_option_value.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_item_option_value import CatalogItemOptionValue import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_item_option_value import CatalogItemOptionValue -from .catalog_v1id import CatalogV1Id -class CatalogObjectItemOptionValue(UncheckedBaseModel): - type: typing.Literal["ITEM_OPTION_VAL"] = "ITEM_OPTION_VAL" +class CatalogObjectItemOptionValue(CatalogObjectBase): item_option_value_data: typing.Optional[CatalogItemOptionValue] = pydantic.Field(default=None) """ Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_item_variation.py b/src/square/types/catalog_object_item_variation.py index 49c60c91..0b0e6d9a 100644 --- a/src/square/types/catalog_object_item_variation.py +++ b/src/square/types/catalog_object_item_variation.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_item_variation import CatalogItemVariation import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_item_variation import CatalogItemVariation -from .catalog_v1id import CatalogV1Id -class CatalogObjectItemVariation(UncheckedBaseModel): - type: typing.Literal["ITEM_VARIATION"] = "ITEM_VARIATION" +class CatalogObjectItemVariation(CatalogObjectBase): item_variation_data: typing.Optional[CatalogItemVariation] = pydantic.Field(default=None) """ Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_measurement_unit.py b/src/square/types/catalog_object_measurement_unit.py index e4c7eae9..95cf47de 100644 --- a/src/square/types/catalog_object_measurement_unit.py +++ b/src/square/types/catalog_object_measurement_unit.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_measurement_unit import CatalogMeasurementUnit import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_measurement_unit import CatalogMeasurementUnit -from .catalog_v1id import CatalogV1Id -class CatalogObjectMeasurementUnit(UncheckedBaseModel): - type: typing.Literal["MEASUREMENT_UNIT"] = "MEASUREMENT_UNIT" +class CatalogObjectMeasurementUnit(CatalogObjectBase): measurement_unit_data: typing.Optional[CatalogMeasurementUnit] = pydantic.Field(default=None) """ Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_modifier.py b/src/square/types/catalog_object_modifier.py index 5f7759fc..d2a8750c 100644 --- a/src/square/types/catalog_object_modifier.py +++ b/src/square/types/catalog_object_modifier.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_modifier import CatalogModifier import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_modifier import CatalogModifier -from .catalog_v1id import CatalogV1Id -class CatalogObjectModifier(UncheckedBaseModel): - type: typing.Literal["MODIFIER"] = "MODIFIER" +class CatalogObjectModifier(CatalogObjectBase): modifier_data: typing.Optional[CatalogModifier] = pydantic.Field(default=None) """ Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_modifier_list.py b/src/square/types/catalog_object_modifier_list.py index 15634226..15e95381 100644 --- a/src/square/types/catalog_object_modifier_list.py +++ b/src/square/types/catalog_object_modifier_list.py @@ -1,109 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from .catalog_object_base import CatalogObjectBase +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_v1id import CatalogV1Id +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectModifierList(UncheckedBaseModel): - type: typing.Literal["MODIFIER_LIST"] = "MODIFIER_LIST" +class CatalogObjectModifierList(CatalogObjectBase): modifier_list_data: typing.Optional["CatalogModifierList"] = pydantic.Field(default=None) """ Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -114,6 +26,12 @@ class Config: extra = pydantic.Extra.allow -from .catalog_modifier_list import CatalogModifierList # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 update_forward_refs(CatalogObjectModifierList) diff --git a/src/square/types/catalog_object_pricing_rule.py b/src/square/types/catalog_object_pricing_rule.py index c80e2707..7630e738 100644 --- a/src/square/types/catalog_object_pricing_rule.py +++ b/src/square/types/catalog_object_pricing_rule.py @@ -1,109 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_pricing_rule import CatalogPricingRule import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_pricing_rule import CatalogPricingRule -from .catalog_v1id import CatalogV1Id -class CatalogObjectPricingRule(UncheckedBaseModel): - type: typing.Literal["PRICING_RULE"] = "PRICING_RULE" +class CatalogObjectPricingRule(CatalogObjectBase): pricing_rule_data: typing.Optional[CatalogPricingRule] = pydantic.Field(default=None) """ Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`. A `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_product_set.py b/src/square/types/catalog_object_product_set.py index c7b907e6..56ba2313 100644 --- a/src/square/types/catalog_object_product_set.py +++ b/src/square/types/catalog_object_product_set.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_product_set import CatalogProductSet import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_product_set import CatalogProductSet -from .catalog_v1id import CatalogV1Id -class CatalogObjectProductSet(UncheckedBaseModel): - type: typing.Literal["PRODUCT_SET"] = "PRODUCT_SET" +class CatalogObjectProductSet(CatalogObjectBase): product_set_data: typing.Optional[CatalogProductSet] = pydantic.Field(default=None) """ Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_quick_amounts_settings.py b/src/square/types/catalog_object_quick_amounts_settings.py index da6de61f..c95cfdd3 100644 --- a/src/square/types/catalog_object_quick_amounts_settings.py +++ b/src/square/types/catalog_object_quick_amounts_settings.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_quick_amounts_settings import CatalogQuickAmountsSettings import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_quick_amounts_settings import CatalogQuickAmountsSettings -from .catalog_v1id import CatalogV1Id -class CatalogObjectQuickAmountsSettings(UncheckedBaseModel): - type: typing.Literal["QUICK_AMOUNTS_SETTINGS"] = "QUICK_AMOUNTS_SETTINGS" +class CatalogObjectQuickAmountsSettings(CatalogObjectBase): quick_amounts_settings_data: typing.Optional[CatalogQuickAmountsSettings] = pydantic.Field(default=None) """ Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_reference.py b/src/square/types/catalog_object_reference.py index 306c8d91..66efefe9 100644 --- a/src/square/types/catalog_object_reference.py +++ b/src/square/types/catalog_object_reference.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogObjectReference(UncheckedBaseModel): diff --git a/src/square/types/catalog_object_subscription_plan.py b/src/square/types/catalog_object_subscription_plan.py index 15849004..bd039e22 100644 --- a/src/square/types/catalog_object_subscription_plan.py +++ b/src/square/types/catalog_object_subscription_plan.py @@ -1,109 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - +from .catalog_object_base import CatalogObjectBase +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory import typing - import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_v1id import CatalogV1Id +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectSubscriptionPlan(UncheckedBaseModel): - type: typing.Literal["SUBSCRIPTION_PLAN"] = "SUBSCRIPTION_PLAN" +class CatalogObjectSubscriptionPlan(CatalogObjectBase): subscription_plan_data: typing.Optional["CatalogSubscriptionPlan"] = pydantic.Field(default=None) """ Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -114,6 +26,12 @@ class Config: extra = pydantic.Extra.allow -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402 update_forward_refs(CatalogObjectSubscriptionPlan) diff --git a/src/square/types/catalog_object_subscription_plan_variation.py b/src/square/types/catalog_object_subscription_plan_variation.py index eb2649f7..99795306 100644 --- a/src/square/types/catalog_object_subscription_plan_variation.py +++ b/src/square/types/catalog_object_subscription_plan_variation.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariation import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariation -from .catalog_v1id import CatalogV1Id -class CatalogObjectSubscriptionPlanVariation(UncheckedBaseModel): - type: typing.Literal["SUBSCRIPTION_PLAN_VARIATION"] = "SUBSCRIPTION_PLAN_VARIATION" +class CatalogObjectSubscriptionPlanVariation(CatalogObjectBase): subscription_plan_variation_data: typing.Optional[CatalogSubscriptionPlanVariation] = pydantic.Field(default=None) """ Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_tax.py b/src/square/types/catalog_object_tax.py index cfbbe611..fea644a3 100644 --- a/src/square/types/catalog_object_tax.py +++ b/src/square/types/catalog_object_tax.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_tax import CatalogTax import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_tax import CatalogTax -from .catalog_v1id import CatalogV1Id -class CatalogObjectTax(UncheckedBaseModel): - type: typing.Literal["TAX"] = "TAX" +class CatalogObjectTax(CatalogObjectBase): tax_data: typing.Optional[CatalogTax] = pydantic.Field(default=None) """ Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_time_period.py b/src/square/types/catalog_object_time_period.py index c307d930..eb975d58 100644 --- a/src/square/types/catalog_object_time_period.py +++ b/src/square/types/catalog_object_time_period.py @@ -1,108 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from .catalog_object_base import CatalogObjectBase import typing - +from .catalog_time_period import CatalogTimePeriod import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_custom_attribute_value import CatalogCustomAttributeValue -from .catalog_time_period import CatalogTimePeriod -from .catalog_v1id import CatalogV1Id -class CatalogObjectTimePeriod(UncheckedBaseModel): - type: typing.Literal["TIME_PERIOD"] = "TIME_PERIOD" +class CatalogObjectTimePeriod(CatalogObjectBase): time_period_data: typing.Optional[CatalogTimePeriod] = pydantic.Field(default=None) """ Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. """ - id: str = pydantic.Field() - """ - An identifier to reference this object in the catalog. When a new `CatalogObject` - is inserted, the client should set the id to a temporary identifier starting with - a "`#`" character. Other objects being inserted or updated within the same request - may use this identifier to refer to the new object. - - When the server receives the new object, it will supply a unique identifier that - replaces the temporary identifier for all future references. - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` - would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version of the object. When updating an object, the version supplied - must match the version in the database, otherwise the write will be rejected as conflicting. - """ - - is_deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, the object has been deleted from the database. Must be `false` for new objects - being inserted. When deleted, the `updated_at` field will equal the deletion time. - """ - - custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( - default=None - ) - """ - A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair - is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute - value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) - object defined by the application making the request. - - If the `CatalogCustomAttributeDefinition` object is - defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by - the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of - `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` - if the application making the request is different from the application defining the custom attribute definition. - Otherwise, the key used in the map is simply `"cocoa_brand"`. - - Application-defined custom attributes are set at a global (location-independent) level. - Custom attribute values are intended to store additional information about a catalog object - or associations with an entity in another system. Do not use custom attributes - to store any sensitive information (personally identifiable information, card details, etc.). - """ - - catalog_v1ids: typing_extensions.Annotated[ - typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") - ] = pydantic.Field(default=None) - """ - The Connect v1 IDs for this object at each location where it is present, where they - differ from the object's Connect V2 ID. The field will only be present for objects that - have been created or modified by legacy APIs. - """ - - present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) - """ - If `true`, this object is present at all locations (including future locations), except where specified in - the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), - except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. - """ - - present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is present, even if `present_at_all_locations` is `false`. - This can include locations that are deactivated. - """ - - absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of locations where the object is not present, even if `present_at_all_locations` is `true`. - This can include locations that are deactivated. - """ - - image_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Identifies the `CatalogImage` attached to this `CatalogObject`. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_pricing_rule.py b/src/square/types/catalog_pricing_rule.py index 34d67f22..6ac864f8 100644 --- a/src/square/types/catalog_pricing_rule.py +++ b/src/square/types/catalog_pricing_rule.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .exclude_strategy import ExcludeStrategy from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogPricingRule(UncheckedBaseModel): diff --git a/src/square/types/catalog_product_set.py b/src/square/types/catalog_product_set.py index a2bbe4d9..059d5b62 100644 --- a/src/square/types/catalog_product_set.py +++ b/src/square/types/catalog_product_set.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogProductSet(UncheckedBaseModel): diff --git a/src/square/types/catalog_query.py b/src/square/types/catalog_query.py index e7c8056e..7ed799a0 100644 --- a/src/square/types/catalog_query.py +++ b/src/square/types/catalog_query.py @@ -1,20 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .catalog_query_sorted_attribute import CatalogQuerySortedAttribute import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_query_exact import CatalogQueryExact -from .catalog_query_item_variations_for_item_option_values import CatalogQueryItemVariationsForItemOptionValues -from .catalog_query_items_for_item_options import CatalogQueryItemsForItemOptions -from .catalog_query_items_for_modifier_list import CatalogQueryItemsForModifierList -from .catalog_query_items_for_tax import CatalogQueryItemsForTax +from .catalog_query_set import CatalogQuerySet from .catalog_query_prefix import CatalogQueryPrefix from .catalog_query_range import CatalogQueryRange -from .catalog_query_set import CatalogQuerySet -from .catalog_query_sorted_attribute import CatalogQuerySortedAttribute from .catalog_query_text import CatalogQueryText +from .catalog_query_items_for_tax import CatalogQueryItemsForTax +from .catalog_query_items_for_modifier_list import CatalogQueryItemsForModifierList +from .catalog_query_items_for_item_options import CatalogQueryItemsForItemOptions +from .catalog_query_item_variations_for_item_option_values import CatalogQueryItemVariationsForItemOptionValues +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogQuery(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_exact.py b/src/square/types/catalog_query_exact.py index 65e5c018..e0d8eb7a 100644 --- a/src/square/types/catalog_query_exact.py +++ b/src/square/types/catalog_query_exact.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class CatalogQueryExact(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_item_variations_for_item_option_values.py b/src/square/types/catalog_query_item_variations_for_item_option_values.py index 64a6c4c6..82d0c47c 100644 --- a/src/square/types/catalog_query_item_variations_for_item_option_values.py +++ b/src/square/types/catalog_query_item_variations_for_item_option_values.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQueryItemVariationsForItemOptionValues(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_items_for_item_options.py b/src/square/types/catalog_query_items_for_item_options.py index 8d91fb60..710ac260 100644 --- a/src/square/types/catalog_query_items_for_item_options.py +++ b/src/square/types/catalog_query_items_for_item_options.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQueryItemsForItemOptions(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_items_for_modifier_list.py b/src/square/types/catalog_query_items_for_modifier_list.py index 316b120a..d9b99c99 100644 --- a/src/square/types/catalog_query_items_for_modifier_list.py +++ b/src/square/types/catalog_query_items_for_modifier_list.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQueryItemsForModifierList(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_items_for_tax.py b/src/square/types/catalog_query_items_for_tax.py index f11732a7..b64afa5e 100644 --- a/src/square/types/catalog_query_items_for_tax.py +++ b/src/square/types/catalog_query_items_for_tax.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQueryItemsForTax(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_prefix.py b/src/square/types/catalog_query_prefix.py index e899f8be..80fadb37 100644 --- a/src/square/types/catalog_query_prefix.py +++ b/src/square/types/catalog_query_prefix.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class CatalogQueryPrefix(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_range.py b/src/square/types/catalog_query_range.py index ff28a911..c267d45c 100644 --- a/src/square/types/catalog_query_range.py +++ b/src/square/types/catalog_query_range.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQueryRange(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_set.py b/src/square/types/catalog_query_set.py index cfaa0400..870f6b06 100644 --- a/src/square/types/catalog_query_set.py +++ b/src/square/types/catalog_query_set.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQuerySet(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_sorted_attribute.py b/src/square/types/catalog_query_sorted_attribute.py index e0ce6246..aff24fe7 100644 --- a/src/square/types/catalog_query_sorted_attribute.py +++ b/src/square/types/catalog_query_sorted_attribute.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogQuerySortedAttribute(UncheckedBaseModel): diff --git a/src/square/types/catalog_query_text.py b/src/square/types/catalog_query_text.py index c985a3f8..99e068e5 100644 --- a/src/square/types/catalog_query_text.py +++ b/src/square/types/catalog_query_text.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogQueryText(UncheckedBaseModel): diff --git a/src/square/types/catalog_quick_amount.py b/src/square/types/catalog_quick_amount.py index 34844197..1b2803f2 100644 --- a/src/square/types/catalog_quick_amount.py +++ b/src/square/types/catalog_quick_amount.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_quick_amount_type import CatalogQuickAmountType +import pydantic from .money import Money +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogQuickAmount(UncheckedBaseModel): diff --git a/src/square/types/catalog_quick_amounts_settings.py b/src/square/types/catalog_quick_amounts_settings.py index 4fb7af27..164a40c9 100644 --- a/src/square/types/catalog_quick_amounts_settings.py +++ b/src/square/types/catalog_quick_amounts_settings.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_quick_amount import CatalogQuickAmount from .catalog_quick_amounts_settings_option import CatalogQuickAmountsSettingsOption +import pydantic +import typing +from .catalog_quick_amount import CatalogQuickAmount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogQuickAmountsSettings(UncheckedBaseModel): diff --git a/src/square/types/catalog_stock_conversion.py b/src/square/types/catalog_stock_conversion.py index 830af230..9b89c736 100644 --- a/src/square/types/catalog_stock_conversion.py +++ b/src/square/types/catalog_stock_conversion.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class CatalogStockConversion(UncheckedBaseModel): diff --git a/src/square/types/catalog_subscription_plan.py b/src/square/types/catalog_subscription_plan.py index 833a772c..77f53682 100644 --- a/src/square/types/catalog_subscription_plan.py +++ b/src/square/types/catalog_subscription_plan.py @@ -1,13 +1,14 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_object_category import CatalogObjectCategory +import pydantic +import typing from .subscription_phase import SubscriptionPhase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs class CatalogSubscriptionPlan(UncheckedBaseModel): @@ -57,16 +58,13 @@ class Config: extra = pydantic.Extra.allow -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 +from .catalog_item import CatalogItem # noqa: E402 +from .catalog_item_option import CatalogItemOption # noqa: E402 +from .catalog_modifier_list import CatalogModifierList # noqa: E402 +from .catalog_object_item import CatalogObjectItem # noqa: E402 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402 +from .catalog_object import CatalogObject # noqa: E402 -update_forward_refs( - CatalogSubscriptionPlan, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) +update_forward_refs(CatalogSubscriptionPlan) diff --git a/src/square/types/catalog_subscription_plan_variation.py b/src/square/types/catalog_subscription_plan_variation.py index 59f262b0..dad063aa 100644 --- a/src/square/types/catalog_subscription_plan_variation.py +++ b/src/square/types/catalog_subscription_plan_variation.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .subscription_phase import SubscriptionPhase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogSubscriptionPlanVariation(UncheckedBaseModel): diff --git a/src/square/types/catalog_tax.py b/src/square/types/catalog_tax.py index 2720c96c..e01bdff8 100644 --- a/src/square/types/catalog_tax.py +++ b/src/square/types/catalog_tax.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .tax_calculation_phase import TaxCalculationPhase from .tax_inclusion_type import TaxInclusionType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogTax(UncheckedBaseModel): diff --git a/src/square/types/catalog_time_period.py b/src/square/types/catalog_time_period.py index 8029fb03..7304c082 100644 --- a/src/square/types/catalog_time_period.py +++ b/src/square/types/catalog_time_period.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogTimePeriod(UncheckedBaseModel): diff --git a/src/square/types/catalog_v1id.py b/src/square/types/catalog_v1id.py index 955ca24e..9ae9c1e4 100644 --- a/src/square/types/catalog_v1id.py +++ b/src/square/types/catalog_v1id.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing - +from ..core.serialization import FieldMetadata import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogV1Id(UncheckedBaseModel): diff --git a/src/square/types/catalog_version_updated_event.py b/src/square/types/catalog_version_updated_event.py index 7047e42c..dd6752ca 100644 --- a/src/square/types/catalog_version_updated_event.py +++ b/src/square/types/catalog_version_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_version_updated_event_data import CatalogVersionUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogVersionUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/catalog_version_updated_event_catalog_version.py b/src/square/types/catalog_version_updated_event_catalog_version.py index 61f6df96..149a74bd 100644 --- a/src/square/types/catalog_version_updated_event_catalog_version.py +++ b/src/square/types/catalog_version_updated_event_catalog_version.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CatalogVersionUpdatedEventCatalogVersion(UncheckedBaseModel): diff --git a/src/square/types/catalog_version_updated_event_data.py b/src/square/types/catalog_version_updated_event_data.py index 780a6b96..2eddcff0 100644 --- a/src/square/types/catalog_version_updated_event_data.py +++ b/src/square/types/catalog_version_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_version_updated_event_object import CatalogVersionUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CatalogVersionUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/catalog_version_updated_event_object.py b/src/square/types/catalog_version_updated_event_object.py index 65320500..db16a378 100644 --- a/src/square/types/catalog_version_updated_event_object.py +++ b/src/square/types/catalog_version_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .catalog_version_updated_event_catalog_version import CatalogVersionUpdatedEventCatalogVersion import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_version_updated_event_catalog_version import CatalogVersionUpdatedEventCatalogVersion class CatalogVersionUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/category_path_to_root_node.py b/src/square/types/category_path_to_root_node.py index 4f4833e7..881dc9a1 100644 --- a/src/square/types/category_path_to_root_node.py +++ b/src/square/types/category_path_to_root_node.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CategoryPathToRootNode(UncheckedBaseModel): diff --git a/src/square/types/change_billing_anchor_date_response.py b/src/square/types/change_billing_anchor_date_response.py index 7fb14ecb..ba439a8a 100644 --- a/src/square/types/change_billing_anchor_date_response.py +++ b/src/square/types/change_billing_anchor_date_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription from .subscription_action import SubscriptionAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ChangeBillingAnchorDateResponse(UncheckedBaseModel): diff --git a/src/square/types/channel.py b/src/square/types/channel.py deleted file mode 100644 index 4c34c585..00000000 --- a/src/square/types/channel.py +++ /dev/null @@ -1,63 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .channel_status import ChannelStatus -from .reference import Reference - - -class Channel(UncheckedBaseModel): - id: typing.Optional[str] = pydantic.Field(default=None) - """ - The channel's unique ID. - """ - - merchant_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The unique ID of the merchant this channel belongs to. - """ - - name: typing.Optional[str] = pydantic.Field(default=None) - """ - The name of the channel. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - The version number which is incremented each time an update is made to the channel. - """ - - reference: typing.Optional[Reference] = pydantic.Field(default=None) - """ - Represents an entity the channel is associated with. - """ - - status: typing.Optional[ChannelStatus] = pydantic.Field(default=None) - """ - Status of the channel. - See [Status](#type-status) for possible values - """ - - created_at: typing.Optional[str] = pydantic.Field(default=None) - """ - The timestamp for when the channel was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - The timestamp for when the channel was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/channel_status.py b/src/square/types/channel_status.py deleted file mode 100644 index b3fd439d..00000000 --- a/src/square/types/channel_status.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ChannelStatus = typing.Union[typing.Literal["ACTIVE", "INACTIVE"], typing.Any] diff --git a/src/square/types/charge_request_additional_recipient.py b/src/square/types/charge_request_additional_recipient.py index b5392aa2..a8dd257d 100644 --- a/src/square/types/charge_request_additional_recipient.py +++ b/src/square/types/charge_request_additional_recipient.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class ChargeRequestAdditionalRecipient(UncheckedBaseModel): diff --git a/src/square/types/checkout.py b/src/square/types/checkout.py index 484faea8..abd0649c 100644 --- a/src/square/types/checkout.py +++ b/src/square/types/checkout.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .additional_recipient import AdditionalRecipient from .address import Address from .order import Order +from .additional_recipient import AdditionalRecipient +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Checkout(UncheckedBaseModel): diff --git a/src/square/types/checkout_location_settings.py b/src/square/types/checkout_location_settings.py index c88d9c3f..27dff4b5 100644 --- a/src/square/types/checkout_location_settings.py +++ b/src/square/types/checkout_location_settings.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .checkout_location_settings_branding import CheckoutLocationSettingsBranding -from .checkout_location_settings_coupons import CheckoutLocationSettingsCoupons from .checkout_location_settings_policy import CheckoutLocationSettingsPolicy +from .checkout_location_settings_branding import CheckoutLocationSettingsBranding from .checkout_location_settings_tipping import CheckoutLocationSettingsTipping +from .checkout_location_settings_coupons import CheckoutLocationSettingsCoupons +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CheckoutLocationSettings(UncheckedBaseModel): diff --git a/src/square/types/checkout_location_settings_branding.py b/src/square/types/checkout_location_settings_branding.py index 50440f02..24a9c1da 100644 --- a/src/square/types/checkout_location_settings_branding.py +++ b/src/square/types/checkout_location_settings_branding.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .checkout_location_settings_branding_header_type import CheckoutLocationSettingsBrandingHeaderType import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .checkout_location_settings_branding_button_shape import CheckoutLocationSettingsBrandingButtonShape -from .checkout_location_settings_branding_header_type import CheckoutLocationSettingsBrandingHeaderType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CheckoutLocationSettingsBranding(UncheckedBaseModel): diff --git a/src/square/types/checkout_location_settings_coupons.py b/src/square/types/checkout_location_settings_coupons.py index 47a318ee..80992b8c 100644 --- a/src/square/types/checkout_location_settings_coupons.py +++ b/src/square/types/checkout_location_settings_coupons.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CheckoutLocationSettingsCoupons(UncheckedBaseModel): diff --git a/src/square/types/checkout_location_settings_policy.py b/src/square/types/checkout_location_settings_policy.py index 4b93b8aa..63c5483e 100644 --- a/src/square/types/checkout_location_settings_policy.py +++ b/src/square/types/checkout_location_settings_policy.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CheckoutLocationSettingsPolicy(UncheckedBaseModel): diff --git a/src/square/types/checkout_location_settings_tipping.py b/src/square/types/checkout_location_settings_tipping.py index 1505e8f0..86f004ec 100644 --- a/src/square/types/checkout_location_settings_tipping.py +++ b/src/square/types/checkout_location_settings_tipping.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CheckoutLocationSettingsTipping(UncheckedBaseModel): diff --git a/src/square/types/checkout_merchant_settings.py b/src/square/types/checkout_merchant_settings.py index 3bf647c7..8cdf65ea 100644 --- a/src/square/types/checkout_merchant_settings.py +++ b/src/square/types/checkout_merchant_settings.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .checkout_merchant_settings_payment_methods import CheckoutMerchantSettingsPaymentMethods import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .checkout_merchant_settings_payment_methods import CheckoutMerchantSettingsPaymentMethods class CheckoutMerchantSettings(UncheckedBaseModel): diff --git a/src/square/types/checkout_merchant_settings_payment_methods.py b/src/square/types/checkout_merchant_settings_payment_methods.py index 954e9c5d..b4508353 100644 --- a/src/square/types/checkout_merchant_settings_payment_methods.py +++ b/src/square/types/checkout_merchant_settings_payment_methods.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .checkout_merchant_settings_payment_methods_afterpay_clearpay import ( - CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay, -) +import typing from .checkout_merchant_settings_payment_methods_payment_method import ( CheckoutMerchantSettingsPaymentMethodsPaymentMethod, ) +from .checkout_merchant_settings_payment_methods_afterpay_clearpay import ( + CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic class CheckoutMerchantSettingsPaymentMethods(UncheckedBaseModel): diff --git a/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.py b/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.py index 55cc6dee..a84a4d25 100644 --- a/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.py +++ b/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range import ( CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange, ) +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay(UncheckedBaseModel): diff --git a/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.py b/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.py index e29473d4..4b3f2b01 100644 --- a/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.py +++ b/src/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic class CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange(UncheckedBaseModel): diff --git a/src/square/types/checkout_merchant_settings_payment_methods_payment_method.py b/src/square/types/checkout_merchant_settings_payment_methods_payment_method.py index 5236d208..6c644404 100644 --- a/src/square/types/checkout_merchant_settings_payment_methods_payment_method.py +++ b/src/square/types/checkout_merchant_settings_payment_methods_payment_method.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CheckoutMerchantSettingsPaymentMethodsPaymentMethod(UncheckedBaseModel): diff --git a/src/square/types/checkout_options.py b/src/square/types/checkout_options.py index 68822035..b448fe81 100644 --- a/src/square/types/checkout_options.py +++ b/src/square/types/checkout_options.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .accepted_payment_methods import AcceptedPaymentMethods from .custom_field import CustomField +from .accepted_payment_methods import AcceptedPaymentMethods from .money import Money from .shipping_fee import ShippingFee +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CheckoutOptions(UncheckedBaseModel): diff --git a/src/square/types/clearpay_details.py b/src/square/types/clearpay_details.py index e85b7e5d..30fed324 100644 --- a/src/square/types/clearpay_details.py +++ b/src/square/types/clearpay_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class ClearpayDetails(UncheckedBaseModel): diff --git a/src/square/types/clone_order_response.py b/src/square/types/clone_order_response.py index ee7c6bc6..83aaaa6d 100644 --- a/src/square/types/clone_order_response.py +++ b/src/square/types/clone_order_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CloneOrderResponse(UncheckedBaseModel): diff --git a/src/square/types/collected_data.py b/src/square/types/collected_data.py index cc00127d..28c77d19 100644 --- a/src/square/types/collected_data.py +++ b/src/square/types/collected_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CollectedData(UncheckedBaseModel): diff --git a/src/square/types/complete_payment_response.py b/src/square/types/complete_payment_response.py index 72e4db75..e74c0268 100644 --- a/src/square/types/complete_payment_response.py +++ b/src/square/types/complete_payment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment import Payment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CompletePaymentResponse(UncheckedBaseModel): diff --git a/src/square/types/component.py b/src/square/types/component.py index 7c8f6e53..bcfc42c5 100644 --- a/src/square/types/component.py +++ b/src/square/types/component.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .component_component_type import ComponentComponentType +import pydantic +import typing from .device_component_details_application_details import DeviceComponentDetailsApplicationDetails -from .device_component_details_battery_details import DeviceComponentDetailsBatteryDetails from .device_component_details_card_reader_details import DeviceComponentDetailsCardReaderDetails -from .device_component_details_ethernet_details import DeviceComponentDetailsEthernetDetails +from .device_component_details_battery_details import DeviceComponentDetailsBatteryDetails from .device_component_details_wi_fi_details import DeviceComponentDetailsWiFiDetails +from .device_component_details_ethernet_details import DeviceComponentDetailsEthernetDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Component(UncheckedBaseModel): diff --git a/src/square/types/confirmation_decision.py b/src/square/types/confirmation_decision.py index 46832250..912a2a04 100644 --- a/src/square/types/confirmation_decision.py +++ b/src/square/types/confirmation_decision.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class ConfirmationDecision(UncheckedBaseModel): diff --git a/src/square/types/confirmation_options.py b/src/square/types/confirmation_options.py index de1814ca..df53b048 100644 --- a/src/square/types/confirmation_options.py +++ b/src/square/types/confirmation_options.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .confirmation_decision import ConfirmationDecision +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ConfirmationOptions(UncheckedBaseModel): diff --git a/src/square/types/coordinates.py b/src/square/types/coordinates.py index 2c0a2162..4c140d94 100644 --- a/src/square/types/coordinates.py +++ b/src/square/types/coordinates.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Coordinates(UncheckedBaseModel): diff --git a/src/square/types/create_booking_custom_attribute_definition_response.py b/src/square/types/create_booking_custom_attribute_definition_response.py index b2f1ad24..3417bdcf 100644 --- a/src/square/types/create_booking_custom_attribute_definition_response.py +++ b/src/square/types/create_booking_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateBookingCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_booking_response.py b/src/square/types/create_booking_response.py index ff23b8e5..65281283 100644 --- a/src/square/types/create_booking_response.py +++ b/src/square/types/create_booking_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking import Booking +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateBookingResponse(UncheckedBaseModel): diff --git a/src/square/types/create_break_type_response.py b/src/square/types/create_break_type_response.py index c94f0be0..f3b50e42 100644 --- a/src/square/types/create_break_type_response.py +++ b/src/square/types/create_break_type_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .break_type import BreakType +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateBreakTypeResponse(UncheckedBaseModel): diff --git a/src/square/types/create_card_response.py b/src/square/types/create_card_response.py index df743a3c..469f2553 100644 --- a/src/square/types/create_card_response.py +++ b/src/square/types/create_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCardResponse(UncheckedBaseModel): diff --git a/src/square/types/create_catalog_image_request.py b/src/square/types/create_catalog_image_request.py index 1473315f..f653ab65 100644 --- a/src/square/types/create_catalog_image_request.py +++ b/src/square/types/create_catalog_image_request.py @@ -1,12 +1,20 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import pydantic +import typing +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCatalogImageRequest(UncheckedBaseModel): @@ -25,7 +33,7 @@ class CreateCatalogImageRequest(UncheckedBaseModel): where an image can be attached to catalog items at a later time. """ - image: "CatalogObject" = pydantic.Field() + image: CatalogObject = pydantic.Field() """ The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` object, to encapsulate the specified image file. """ @@ -47,18 +55,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - CreateCatalogImageRequest, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/create_catalog_image_response.py b/src/square/types/create_catalog_image_response.py index 7e2488f5..a203d007 100644 --- a/src/square/types/create_catalog_image_response.py +++ b/src/square/types/create_catalog_image_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCatalogImageResponse(UncheckedBaseModel): @@ -16,7 +24,7 @@ class CreateCatalogImageResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - image: typing.Optional["CatalogObject"] = pydantic.Field(default=None) + image: typing.Optional[CatalogObject] = pydantic.Field(default=None) """ The newly created `CatalogImage` including a Square-generated URL for the encapsulated image file. @@ -30,18 +38,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - CreateCatalogImageResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/create_checkout_response.py b/src/square/types/create_checkout_response.py index e7ba21a4..113a155e 100644 --- a/src/square/types/create_checkout_response.py +++ b/src/square/types/create_checkout_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .checkout import Checkout +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCheckoutResponse(UncheckedBaseModel): diff --git a/src/square/types/create_customer_card_response.py b/src/square/types/create_customer_card_response.py index cc103bea..aa0a44d2 100644 --- a/src/square/types/create_customer_card_response.py +++ b/src/square/types/create_customer_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCustomerCardResponse(UncheckedBaseModel): diff --git a/src/square/types/create_customer_custom_attribute_definition_response.py b/src/square/types/create_customer_custom_attribute_definition_response.py index a71577f1..71904724 100644 --- a/src/square/types/create_customer_custom_attribute_definition_response.py +++ b/src/square/types/create_customer_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCustomerCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_customer_group_response.py b/src/square/types/create_customer_group_response.py index cff01a58..11c8b7d5 100644 --- a/src/square/types/create_customer_group_response.py +++ b/src/square/types/create_customer_group_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_group import CustomerGroup -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCustomerGroupResponse(UncheckedBaseModel): diff --git a/src/square/types/create_customer_response.py b/src/square/types/create_customer_response.py index 6dbdda2f..df908c5b 100644 --- a/src/square/types/create_customer_response.py +++ b/src/square/types/create_customer_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer import Customer -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateCustomerResponse(UncheckedBaseModel): diff --git a/src/square/types/create_device_code_response.py b/src/square/types/create_device_code_response.py index af3e9ecd..71fd0350 100644 --- a/src/square/types/create_device_code_response.py +++ b/src/square/types/create_device_code_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_code import DeviceCode -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateDeviceCodeResponse(UncheckedBaseModel): diff --git a/src/square/types/create_dispute_evidence_file_request.py b/src/square/types/create_dispute_evidence_file_request.py index cfc343e2..d31e7cf5 100644 --- a/src/square/types/create_dispute_evidence_file_request.py +++ b/src/square/types/create_dispute_evidence_file_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .dispute_evidence_type import DisputeEvidenceType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateDisputeEvidenceFileRequest(UncheckedBaseModel): diff --git a/src/square/types/create_dispute_evidence_file_response.py b/src/square/types/create_dispute_evidence_file_response.py index 87bf0c4a..01bf03c3 100644 --- a/src/square/types/create_dispute_evidence_file_response.py +++ b/src/square/types/create_dispute_evidence_file_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence import DisputeEvidence -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateDisputeEvidenceFileResponse(UncheckedBaseModel): diff --git a/src/square/types/create_dispute_evidence_text_response.py b/src/square/types/create_dispute_evidence_text_response.py index 8aeab84e..bcc6ea29 100644 --- a/src/square/types/create_dispute_evidence_text_response.py +++ b/src/square/types/create_dispute_evidence_text_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence import DisputeEvidence -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateDisputeEvidenceTextResponse(UncheckedBaseModel): diff --git a/src/square/types/create_gift_card_activity_response.py b/src/square/types/create_gift_card_activity_response.py index 4348b663..5e10aec5 100644 --- a/src/square/types/create_gift_card_activity_response.py +++ b/src/square/types/create_gift_card_activity_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card_activity import GiftCardActivity +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateGiftCardActivityResponse(UncheckedBaseModel): diff --git a/src/square/types/create_gift_card_response.py b/src/square/types/create_gift_card_response.py index b1ddefe5..2508b464 100644 --- a/src/square/types/create_gift_card_response.py +++ b/src/square/types/create_gift_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateGiftCardResponse(UncheckedBaseModel): diff --git a/src/square/types/create_invoice_attachment_request_data.py b/src/square/types/create_invoice_attachment_request_data.py index 80c65953..28adb657 100644 --- a/src/square/types/create_invoice_attachment_request_data.py +++ b/src/square/types/create_invoice_attachment_request_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CreateInvoiceAttachmentRequestData(UncheckedBaseModel): diff --git a/src/square/types/create_invoice_attachment_response.py b/src/square/types/create_invoice_attachment_response.py index 9717b07a..3e300d24 100644 --- a/src/square/types/create_invoice_attachment_response.py +++ b/src/square/types/create_invoice_attachment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice_attachment import InvoiceAttachment import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice_attachment import InvoiceAttachment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateInvoiceAttachmentResponse(UncheckedBaseModel): diff --git a/src/square/types/create_invoice_response.py b/src/square/types/create_invoice_response.py index db58eda9..fa8da908 100644 --- a/src/square/types/create_invoice_response.py +++ b/src/square/types/create_invoice_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateInvoiceResponse(UncheckedBaseModel): diff --git a/src/square/types/create_job_response.py b/src/square/types/create_job_response.py index ad7a58da..da6c4aff 100644 --- a/src/square/types/create_job_response.py +++ b/src/square/types/create_job_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .job import Job import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .job import Job +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateJobResponse(UncheckedBaseModel): diff --git a/src/square/types/create_location_custom_attribute_definition_response.py b/src/square/types/create_location_custom_attribute_definition_response.py index ae7e3772..c5f23ced 100644 --- a/src/square/types/create_location_custom_attribute_definition_response.py +++ b/src/square/types/create_location_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateLocationCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_location_response.py b/src/square/types/create_location_response.py index ed516c6f..ebae04d7 100644 --- a/src/square/types/create_location_response.py +++ b/src/square/types/create_location_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .location import Location +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateLocationResponse(UncheckedBaseModel): diff --git a/src/square/types/create_loyalty_account_response.py b/src/square/types/create_loyalty_account_response.py index 4a2c977c..ba46cb72 100644 --- a/src/square/types/create_loyalty_account_response.py +++ b/src/square/types/create_loyalty_account_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_account import LoyaltyAccount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateLoyaltyAccountResponse(UncheckedBaseModel): diff --git a/src/square/types/create_loyalty_promotion_response.py b/src/square/types/create_loyalty_promotion_response.py index 43dc8204..71641617 100644 --- a/src/square/types/create_loyalty_promotion_response.py +++ b/src/square/types/create_loyalty_promotion_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_promotion import LoyaltyPromotion +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateLoyaltyPromotionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_loyalty_reward_response.py b/src/square/types/create_loyalty_reward_response.py index 3e778ff6..904c811c 100644 --- a/src/square/types/create_loyalty_reward_response.py +++ b/src/square/types/create_loyalty_reward_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_reward import LoyaltyReward +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateLoyaltyRewardResponse(UncheckedBaseModel): diff --git a/src/square/types/create_merchant_custom_attribute_definition_response.py b/src/square/types/create_merchant_custom_attribute_definition_response.py index 5d5ebe1c..5c40bf95 100644 --- a/src/square/types/create_merchant_custom_attribute_definition_response.py +++ b/src/square/types/create_merchant_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateMerchantCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_mobile_authorization_code_response.py b/src/square/types/create_mobile_authorization_code_response.py index 3507adae..1a53e80b 100644 --- a/src/square/types/create_mobile_authorization_code_response.py +++ b/src/square/types/create_mobile_authorization_code_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateMobileAuthorizationCodeResponse(UncheckedBaseModel): diff --git a/src/square/types/create_order_custom_attribute_definition_response.py b/src/square/types/create_order_custom_attribute_definition_response.py index 8a9eb385..d5f956b9 100644 --- a/src/square/types/create_order_custom_attribute_definition_response.py +++ b/src/square/types/create_order_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateOrderCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_order_request.py b/src/square/types/create_order_request.py index ee417de4..9dff1e8b 100644 --- a/src/square/types/create_order_request.py +++ b/src/square/types/create_order_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order import Order class CreateOrderRequest(UncheckedBaseModel): diff --git a/src/square/types/create_order_response.py b/src/square/types/create_order_response.py index 1ad91085..fcbef0ee 100644 --- a/src/square/types/create_order_response.py +++ b/src/square/types/create_order_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateOrderResponse(UncheckedBaseModel): diff --git a/src/square/types/create_payment_link_response.py b/src/square/types/create_payment_link_response.py index f2dbaca6..7320c531 100644 --- a/src/square/types/create_payment_link_response.py +++ b/src/square/types/create_payment_link_response.py @@ -1,15 +1,22 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic from .payment_link import PaymentLink from .payment_link_related_resources import PaymentLinkRelatedResources +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreatePaymentLinkResponse(UncheckedBaseModel): @@ -36,6 +43,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -update_forward_refs(CreatePaymentLinkResponse) diff --git a/src/square/types/create_payment_response.py b/src/square/types/create_payment_response.py index 2419cb95..470b7a7a 100644 --- a/src/square/types/create_payment_response.py +++ b/src/square/types/create_payment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment import Payment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreatePaymentResponse(UncheckedBaseModel): diff --git a/src/square/types/create_scheduled_shift_response.py b/src/square/types/create_scheduled_shift_response.py index 352519a6..ade68fe5 100644 --- a/src/square/types/create_scheduled_shift_response.py +++ b/src/square/types/create_scheduled_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .scheduled_shift import ScheduledShift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .scheduled_shift import ScheduledShift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateScheduledShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/create_shift_response.py b/src/square/types/create_shift_response.py index e3d90e21..d637d234 100644 --- a/src/square/types/create_shift_response.py +++ b/src/square/types/create_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .shift import Shift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .shift import Shift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/create_subscription_response.py b/src/square/types/create_subscription_response.py index 40e3039b..ee622bac 100644 --- a/src/square/types/create_subscription_response.py +++ b/src/square/types/create_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_team_member_request.py b/src/square/types/create_team_member_request.py index 90b202e7..6376fa04 100644 --- a/src/square/types/create_team_member_request.py +++ b/src/square/types/create_team_member_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member import TeamMember +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateTeamMemberRequest(UncheckedBaseModel): diff --git a/src/square/types/create_team_member_response.py b/src/square/types/create_team_member_response.py index 4caa65d4..bf395f32 100644 --- a/src/square/types/create_team_member_response.py +++ b/src/square/types/create_team_member_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member import TeamMember +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateTeamMemberResponse(UncheckedBaseModel): diff --git a/src/square/types/create_terminal_action_response.py b/src/square/types/create_terminal_action_response.py index a169832b..1bdcfbcc 100644 --- a/src/square/types/create_terminal_action_response.py +++ b/src/square/types/create_terminal_action_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_action import TerminalAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateTerminalActionResponse(UncheckedBaseModel): diff --git a/src/square/types/create_terminal_checkout_response.py b/src/square/types/create_terminal_checkout_response.py index 3fcee09a..77713948 100644 --- a/src/square/types/create_terminal_checkout_response.py +++ b/src/square/types/create_terminal_checkout_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_checkout import TerminalCheckout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateTerminalCheckoutResponse(UncheckedBaseModel): diff --git a/src/square/types/create_terminal_refund_response.py b/src/square/types/create_terminal_refund_response.py index 240d8872..46aa5487 100644 --- a/src/square/types/create_terminal_refund_response.py +++ b/src/square/types/create_terminal_refund_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_refund import TerminalRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateTerminalRefundResponse(UncheckedBaseModel): diff --git a/src/square/types/create_timecard_response.py b/src/square/types/create_timecard_response.py index f2ebe487..f7b2fb9a 100644 --- a/src/square/types/create_timecard_response.py +++ b/src/square/types/create_timecard_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard import Timecard import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .timecard import Timecard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateTimecardResponse(UncheckedBaseModel): diff --git a/src/square/types/create_transfer_order_data.py b/src/square/types/create_transfer_order_data.py deleted file mode 100644 index 4ef6be5c..00000000 --- a/src/square/types/create_transfer_order_data.py +++ /dev/null @@ -1,63 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .create_transfer_order_line_data import CreateTransferOrderLineData - - -class CreateTransferOrderData(UncheckedBaseModel): - """ - Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s - between [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder) - endpoint. - """ - - source_location_id: str = pydantic.Field() - """ - The source [Location](entity:Location) that will send the items. Must be an active location - in your Square account with sufficient inventory of the requested items. - """ - - destination_location_id: str = pydantic.Field() - """ - The destination [Location](entity:Location) that will receive the items. Must be an active location - in your Square account - """ - - expected_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). - """ - - notes: typing.Optional[str] = pydantic.Field(default=None) - """ - Optional notes about the transfer - """ - - tracking_number: typing.Optional[str] = pydantic.Field(default=None) - """ - Optional shipment tracking number - """ - - created_by_team_member_id: typing.Optional[str] = pydantic.Field(default=None) - """ - ID of the [TeamMember](entity:TeamMember) creating this transfer order. Used for tracking - and auditing purposes. - """ - - line_items: typing.Optional[typing.List[CreateTransferOrderLineData]] = pydantic.Field(default=None) - """ - List of [CatalogItemVariation](entity:CatalogItemVariation)s to transfer, including quantities - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/create_transfer_order_line_data.py b/src/square/types/create_transfer_order_line_data.py deleted file mode 100644 index 7f874371..00000000 --- a/src/square/types/create_transfer_order_line_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class CreateTransferOrderLineData(UncheckedBaseModel): - """ - Data for creating a new transfer order line item. Each line item specifies a - [CatalogItemVariation](entity:CatalogItemVariation) and quantity to transfer. - """ - - item_variation_id: str = pydantic.Field() - """ - ID of the [CatalogItemVariation](entity:CatalogItemVariation) to transfer. Must reference a valid - item variation in the [Catalog](api:Catalog). The item variation must be: - - Active and available for sale - - Enabled for inventory tracking - - Available at the source location - """ - - quantity_ordered: str = pydantic.Field() - """ - Total quantity ordered - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/create_transfer_order_response.py b/src/square/types/create_transfer_order_response.py deleted file mode 100644 index d76169c5..00000000 --- a/src/square/types/create_transfer_order_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class CreateTransferOrderResponse(UncheckedBaseModel): - """ - Response for creating a transfer order. - """ - - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The created transfer order - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/create_vendor_response.py b/src/square/types/create_vendor_response.py index 42b56a1f..804bde73 100644 --- a/src/square/types/create_vendor_response.py +++ b/src/square/types/create_vendor_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .vendor import Vendor +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateVendorResponse(UncheckedBaseModel): diff --git a/src/square/types/create_webhook_subscription_response.py b/src/square/types/create_webhook_subscription_response.py index 57e826c4..05e2c8f7 100644 --- a/src/square/types/create_webhook_subscription_response.py +++ b/src/square/types/create_webhook_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .webhook_subscription import WebhookSubscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CreateWebhookSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/custom_attribute.py b/src/square/types/custom_attribute.py index 7aa30cf7..fea224d1 100644 --- a/src/square/types/custom_attribute.py +++ b/src/square/types/custom_attribute.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .custom_attribute_definition import CustomAttributeDefinition from .custom_attribute_definition_visibility import CustomAttributeDefinitionVisibility +from .custom_attribute_definition import CustomAttributeDefinition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomAttribute(UncheckedBaseModel): @@ -30,7 +29,7 @@ class CustomAttribute(UncheckedBaseModel): underscores (_), and hyphens (-). """ - value: typing.Optional[typing.Any] = pydantic.Field(default=None) + value: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None) """ The value assigned to the custom attribute. It is validated against the custom attribute definition's schema on write operations. For more information about custom diff --git a/src/square/types/custom_attribute_definition.py b/src/square/types/custom_attribute_definition.py index 9e4687de..b0b2bdca 100644 --- a/src/square/types/custom_attribute_definition.py +++ b/src/square/types/custom_attribute_definition.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_visibility import CustomAttributeDefinitionVisibility +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomAttributeDefinition(UncheckedBaseModel): @@ -36,7 +35,7 @@ class CustomAttributeDefinition(UncheckedBaseModel): """ schema_: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="schema") + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="schema") ] = pydantic.Field(default=None) """ The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information, diff --git a/src/square/types/custom_attribute_definition_event_data.py b/src/square/types/custom_attribute_definition_event_data.py index 9bb86f37..3f7fc445 100644 --- a/src/square/types/custom_attribute_definition_event_data.py +++ b/src/square/types/custom_attribute_definition_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data_object import CustomAttributeDefinitionEventDataObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomAttributeDefinitionEventData(UncheckedBaseModel): diff --git a/src/square/types/custom_attribute_definition_event_data_object.py b/src/square/types/custom_attribute_definition_event_data_object.py index 295c2d57..ea490ac9 100644 --- a/src/square/types/custom_attribute_definition_event_data_object.py +++ b/src/square/types/custom_attribute_definition_event_data_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .custom_attribute_definition import CustomAttributeDefinition import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .custom_attribute_definition import CustomAttributeDefinition class CustomAttributeDefinitionEventDataObject(UncheckedBaseModel): diff --git a/src/square/types/custom_attribute_event_data.py b/src/square/types/custom_attribute_event_data.py index f290a54f..21580754 100644 --- a/src/square/types/custom_attribute_event_data.py +++ b/src/square/types/custom_attribute_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data_object import CustomAttributeEventDataObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomAttributeEventData(UncheckedBaseModel): diff --git a/src/square/types/custom_attribute_event_data_object.py b/src/square/types/custom_attribute_event_data_object.py index 3fe4e446..4be7b1cc 100644 --- a/src/square/types/custom_attribute_event_data_object.py +++ b/src/square/types/custom_attribute_event_data_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .custom_attribute import CustomAttribute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .custom_attribute import CustomAttribute class CustomAttributeEventDataObject(UncheckedBaseModel): diff --git a/src/square/types/custom_attribute_filter.py b/src/square/types/custom_attribute_filter.py index 22021796..f4cf8e61 100644 --- a/src/square/types/custom_attribute_filter.py +++ b/src/square/types/custom_attribute_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .range import Range +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomAttributeFilter(UncheckedBaseModel): diff --git a/src/square/types/custom_field.py b/src/square/types/custom_field.py index 90d49ad3..7e941376 100644 --- a/src/square/types/custom_field.py +++ b/src/square/types/custom_field.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class CustomField(UncheckedBaseModel): diff --git a/src/square/types/customer.py b/src/square/types/customer.py index 5f6b89c5..8f508ba3 100644 --- a/src/square/types/customer.py +++ b/src/square/types/customer.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address -from .customer_creation_source import CustomerCreationSource from .customer_preferences import CustomerPreferences +from .customer_creation_source import CustomerCreationSource from .customer_tax_ids import CustomerTaxIds +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Customer(UncheckedBaseModel): diff --git a/src/square/types/customer_address_filter.py b/src/square/types/customer_address_filter.py index 05648134..27f1ac21 100644 --- a/src/square/types/customer_address_filter.py +++ b/src/square/types/customer_address_filter.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .customer_text_filter import CustomerTextFilter import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .country import Country -from .customer_text_filter import CustomerTextFilter +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerAddressFilter(UncheckedBaseModel): diff --git a/src/square/types/customer_created_event.py b/src/square/types/customer_created_event.py index 3e5a0491..988224b0 100644 --- a/src/square/types/customer_created_event.py +++ b/src/square/types/customer_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_created_event_data import CustomerCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_created_event_data.py b/src/square/types/customer_created_event_data.py index c381c2a2..f7f54819 100644 --- a/src/square/types/customer_created_event_data.py +++ b/src/square/types/customer_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_created_event_object import CustomerCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/customer_created_event_event_context.py b/src/square/types/customer_created_event_event_context.py index 73ff66c9..9082667c 100644 --- a/src/square/types/customer_created_event_event_context.py +++ b/src/square/types/customer_created_event_event_context.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .customer_created_event_event_context_merge import CustomerCreatedEventEventContextMerge import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .customer_created_event_event_context_merge import CustomerCreatedEventEventContextMerge class CustomerCreatedEventEventContext(UncheckedBaseModel): diff --git a/src/square/types/customer_created_event_event_context_merge.py b/src/square/types/customer_created_event_event_context_merge.py index a6d14910..4ac0f0fe 100644 --- a/src/square/types/customer_created_event_event_context_merge.py +++ b/src/square/types/customer_created_event_event_context_merge.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerCreatedEventEventContextMerge(UncheckedBaseModel): diff --git a/src/square/types/customer_created_event_object.py b/src/square/types/customer_created_event_object.py index 0847af26..e9f453e4 100644 --- a/src/square/types/customer_created_event_object.py +++ b/src/square/types/customer_created_event_object.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .customer import Customer +import pydantic from .customer_created_event_event_context import CustomerCreatedEventEventContext +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/customer_creation_source_filter.py b/src/square/types/customer_creation_source_filter.py index 9f46f06b..162ccb1d 100644 --- a/src/square/types/customer_creation_source_filter.py +++ b/src/square/types/customer_creation_source_filter.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .customer_creation_source import CustomerCreationSource +import pydantic from .customer_inclusion_exclusion import CustomerInclusionExclusion +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCreationSourceFilter(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_created_event.py b/src/square/types/customer_custom_attribute_definition_created_event.py index 2a3fa28c..989816ba 100644 --- a/src/square/types/customer_custom_attribute_definition_created_event.py +++ b/src/square/types/customer_custom_attribute_definition_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_created_public_event.py b/src/square/types/customer_custom_attribute_definition_created_public_event.py index 9edae7fe..a3267097 100644 --- a/src/square/types/customer_custom_attribute_definition_created_public_event.py +++ b/src/square/types/customer_custom_attribute_definition_created_public_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionCreatedPublicEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_deleted_event.py b/src/square/types/customer_custom_attribute_definition_deleted_event.py index 3d7228c7..c0115561 100644 --- a/src/square/types/customer_custom_attribute_definition_deleted_event.py +++ b/src/square/types/customer_custom_attribute_definition_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_deleted_public_event.py b/src/square/types/customer_custom_attribute_definition_deleted_public_event.py index a320cf9a..a401008e 100644 --- a/src/square/types/customer_custom_attribute_definition_deleted_public_event.py +++ b/src/square/types/customer_custom_attribute_definition_deleted_public_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionDeletedPublicEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_owned_created_event.py b/src/square/types/customer_custom_attribute_definition_owned_created_event.py index 5edcedb4..25e32403 100644 --- a/src/square/types/customer_custom_attribute_definition_owned_created_event.py +++ b/src/square/types/customer_custom_attribute_definition_owned_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionOwnedCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_owned_deleted_event.py b/src/square/types/customer_custom_attribute_definition_owned_deleted_event.py index 4cb2c8dd..6434c496 100644 --- a/src/square/types/customer_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/types/customer_custom_attribute_definition_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_owned_updated_event.py b/src/square/types/customer_custom_attribute_definition_owned_updated_event.py index bdbfb501..3c563f9b 100644 --- a/src/square/types/customer_custom_attribute_definition_owned_updated_event.py +++ b/src/square/types/customer_custom_attribute_definition_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_updated_event.py b/src/square/types/customer_custom_attribute_definition_updated_event.py index 9fa11287..8c44db84 100644 --- a/src/square/types/customer_custom_attribute_definition_updated_event.py +++ b/src/square/types/customer_custom_attribute_definition_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_updated_public_event.py b/src/square/types/customer_custom_attribute_definition_updated_public_event.py index 72e63a22..22528640 100644 --- a/src/square/types/customer_custom_attribute_definition_updated_public_event.py +++ b/src/square/types/customer_custom_attribute_definition_updated_public_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionUpdatedPublicEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_visible_created_event.py b/src/square/types/customer_custom_attribute_definition_visible_created_event.py index 3a31af0f..ce02d793 100644 --- a/src/square/types/customer_custom_attribute_definition_visible_created_event.py +++ b/src/square/types/customer_custom_attribute_definition_visible_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionVisibleCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_visible_deleted_event.py b/src/square/types/customer_custom_attribute_definition_visible_deleted_event.py index 11dac80c..3d03175f 100644 --- a/src/square/types/customer_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/types/customer_custom_attribute_definition_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_definition_visible_updated_event.py b/src/square/types/customer_custom_attribute_definition_visible_updated_event.py index eafe63ae..9ce0d647 100644 --- a/src/square/types/customer_custom_attribute_definition_visible_updated_event.py +++ b/src/square/types/customer_custom_attribute_definition_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDefinitionVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_deleted_event.py b/src/square/types/customer_custom_attribute_deleted_event.py index 8cbea39a..9ce021a1 100644 --- a/src/square/types/customer_custom_attribute_deleted_event.py +++ b/src/square/types/customer_custom_attribute_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_deleted_public_event.py b/src/square/types/customer_custom_attribute_deleted_public_event.py index a57168ce..299d5812 100644 --- a/src/square/types/customer_custom_attribute_deleted_public_event.py +++ b/src/square/types/customer_custom_attribute_deleted_public_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeDeletedPublicEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_filter.py b/src/square/types/customer_custom_attribute_filter.py index eab42ed6..b534dffc 100644 --- a/src/square/types/customer_custom_attribute_filter.py +++ b/src/square/types/customer_custom_attribute_filter.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .customer_custom_attribute_filter_value import CustomerCustomAttributeFilterValue from .time_range import TimeRange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeFilter(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_filter_value.py b/src/square/types/customer_custom_attribute_filter_value.py index ee798673..e46592a5 100644 --- a/src/square/types/customer_custom_attribute_filter_value.py +++ b/src/square/types/customer_custom_attribute_filter_value.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .customer_address_filter import CustomerAddressFilter +import typing from .customer_text_filter import CustomerTextFilter +import pydantic from .filter_value import FilterValue -from .float_number_range import FloatNumberRange from .time_range import TimeRange +from .float_number_range import FloatNumberRange +from .customer_address_filter import CustomerAddressFilter +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeFilterValue(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_filters.py b/src/square/types/customer_custom_attribute_filters.py index ab5f0da4..1505ff62 100644 --- a/src/square/types/customer_custom_attribute_filters.py +++ b/src/square/types/customer_custom_attribute_filters.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .customer_custom_attribute_filter import CustomerCustomAttributeFilter import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .customer_custom_attribute_filter import CustomerCustomAttributeFilter class CustomerCustomAttributeFilters(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_owned_deleted_event.py b/src/square/types/customer_custom_attribute_owned_deleted_event.py index 6d79c1c4..68cf0685 100644 --- a/src/square/types/customer_custom_attribute_owned_deleted_event.py +++ b/src/square/types/customer_custom_attribute_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_owned_updated_event.py b/src/square/types/customer_custom_attribute_owned_updated_event.py index 3a3cf342..03642009 100644 --- a/src/square/types/customer_custom_attribute_owned_updated_event.py +++ b/src/square/types/customer_custom_attribute_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_updated_event.py b/src/square/types/customer_custom_attribute_updated_event.py index 12d25228..bc89ec88 100644 --- a/src/square/types/customer_custom_attribute_updated_event.py +++ b/src/square/types/customer_custom_attribute_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_updated_public_event.py b/src/square/types/customer_custom_attribute_updated_public_event.py index 830f911b..52e1ea2a 100644 --- a/src/square/types/customer_custom_attribute_updated_public_event.py +++ b/src/square/types/customer_custom_attribute_updated_public_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeUpdatedPublicEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_visible_deleted_event.py b/src/square/types/customer_custom_attribute_visible_deleted_event.py index 095b9f5a..b2d47fcf 100644 --- a/src/square/types/customer_custom_attribute_visible_deleted_event.py +++ b/src/square/types/customer_custom_attribute_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_custom_attribute_visible_updated_event.py b/src/square/types/customer_custom_attribute_visible_updated_event.py index e6d2dce8..e4d0f42c 100644 --- a/src/square/types/customer_custom_attribute_visible_updated_event.py +++ b/src/square/types/customer_custom_attribute_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerCustomAttributeVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_deleted_event.py b/src/square/types/customer_deleted_event.py index 5d4ba073..25fad357 100644 --- a/src/square/types/customer_deleted_event.py +++ b/src/square/types/customer_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_deleted_event_data import CustomerDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_deleted_event_data.py b/src/square/types/customer_deleted_event_data.py index a065be13..0dfbb086 100644 --- a/src/square/types/customer_deleted_event_data.py +++ b/src/square/types/customer_deleted_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_deleted_event_object import CustomerDeletedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/customer_deleted_event_event_context.py b/src/square/types/customer_deleted_event_event_context.py index 1ab32dba..4126f959 100644 --- a/src/square/types/customer_deleted_event_event_context.py +++ b/src/square/types/customer_deleted_event_event_context.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .customer_deleted_event_event_context_merge import CustomerDeletedEventEventContextMerge import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .customer_deleted_event_event_context_merge import CustomerDeletedEventEventContextMerge class CustomerDeletedEventEventContext(UncheckedBaseModel): diff --git a/src/square/types/customer_deleted_event_event_context_merge.py b/src/square/types/customer_deleted_event_event_context_merge.py index 8299bfd2..b0b34b4c 100644 --- a/src/square/types/customer_deleted_event_event_context_merge.py +++ b/src/square/types/customer_deleted_event_event_context_merge.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerDeletedEventEventContextMerge(UncheckedBaseModel): diff --git a/src/square/types/customer_deleted_event_object.py b/src/square/types/customer_deleted_event_object.py index efeace43..0e45bffa 100644 --- a/src/square/types/customer_deleted_event_object.py +++ b/src/square/types/customer_deleted_event_object.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .customer import Customer +import pydantic from .customer_deleted_event_event_context import CustomerDeletedEventEventContext +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerDeletedEventObject(UncheckedBaseModel): diff --git a/src/square/types/customer_details.py b/src/square/types/customer_details.py index b67c6433..d87a3d54 100644 --- a/src/square/types/customer_details.py +++ b/src/square/types/customer_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerDetails(UncheckedBaseModel): diff --git a/src/square/types/customer_filter.py b/src/square/types/customer_filter.py index 6e50ed08..659c262d 100644 --- a/src/square/types/customer_filter.py +++ b/src/square/types/customer_filter.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .customer_creation_source_filter import CustomerCreationSourceFilter -from .customer_custom_attribute_filters import CustomerCustomAttributeFilters +import pydantic +from .time_range import TimeRange from .customer_text_filter import CustomerTextFilter from .filter_value import FilterValue -from .time_range import TimeRange +from .customer_custom_attribute_filters import CustomerCustomAttributeFilters +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerFilter(UncheckedBaseModel): diff --git a/src/square/types/customer_group.py b/src/square/types/customer_group.py index 99e33f18..d8e303cd 100644 --- a/src/square/types/customer_group.py +++ b/src/square/types/customer_group.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerGroup(UncheckedBaseModel): diff --git a/src/square/types/customer_preferences.py b/src/square/types/customer_preferences.py index a41c9529..9b792c40 100644 --- a/src/square/types/customer_preferences.py +++ b/src/square/types/customer_preferences.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerPreferences(UncheckedBaseModel): diff --git a/src/square/types/customer_query.py b/src/square/types/customer_query.py index c661fbaf..c152e558 100644 --- a/src/square/types/customer_query.py +++ b/src/square/types/customer_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .customer_filter import CustomerFilter +import pydantic from .customer_sort import CustomerSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerQuery(UncheckedBaseModel): diff --git a/src/square/types/customer_segment.py b/src/square/types/customer_segment.py index 7b56625d..75d01afe 100644 --- a/src/square/types/customer_segment.py +++ b/src/square/types/customer_segment.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerSegment(UncheckedBaseModel): diff --git a/src/square/types/customer_sort.py b/src/square/types/customer_sort.py index f9ecc310..39383f39 100644 --- a/src/square/types/customer_sort.py +++ b/src/square/types/customer_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .customer_sort_field import CustomerSortField +import pydantic from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerSort(UncheckedBaseModel): diff --git a/src/square/types/customer_tax_ids.py b/src/square/types/customer_tax_ids.py index 24f26508..b8970d52 100644 --- a/src/square/types/customer_tax_ids.py +++ b/src/square/types/customer_tax_ids.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerTaxIds(UncheckedBaseModel): diff --git a/src/square/types/customer_text_filter.py b/src/square/types/customer_text_filter.py index 281a03c7..d7756a78 100644 --- a/src/square/types/customer_text_filter.py +++ b/src/square/types/customer_text_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class CustomerTextFilter(UncheckedBaseModel): diff --git a/src/square/types/customer_updated_event.py b/src/square/types/customer_updated_event.py index 04190025..50578b1b 100644 --- a/src/square/types/customer_updated_event.py +++ b/src/square/types/customer_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_updated_event_data import CustomerUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/customer_updated_event_data.py b/src/square/types/customer_updated_event_data.py index 27d91793..5a59a5d1 100644 --- a/src/square/types/customer_updated_event_data.py +++ b/src/square/types/customer_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_updated_event_object import CustomerUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CustomerUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/customer_updated_event_object.py b/src/square/types/customer_updated_event_object.py index 96efe62c..e083ee40 100644 --- a/src/square/types/customer_updated_event_object.py +++ b/src/square/types/customer_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .customer import Customer import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .customer import Customer class CustomerUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/data_collection_options.py b/src/square/types/data_collection_options.py index c1947bee..8a296090 100644 --- a/src/square/types/data_collection_options.py +++ b/src/square/types/data_collection_options.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .collected_data import CollectedData +import pydantic from .data_collection_options_input_type import DataCollectionOptionsInputType +import typing +from .collected_data import CollectedData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DataCollectionOptions(UncheckedBaseModel): diff --git a/src/square/types/date_range.py b/src/square/types/date_range.py index 9f56f1ff..68c962c5 100644 --- a/src/square/types/date_range.py +++ b/src/square/types/date_range.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DateRange(UncheckedBaseModel): diff --git a/src/square/types/delete_booking_custom_attribute_definition_response.py b/src/square/types/delete_booking_custom_attribute_definition_response.py index efb04830..dc334e77 100644 --- a/src/square/types/delete_booking_custom_attribute_definition_response.py +++ b/src/square/types/delete_booking_custom_attribute_definition_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteBookingCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_booking_custom_attribute_response.py b/src/square/types/delete_booking_custom_attribute_response.py index 93cfef6d..9c6c0fda 100644 --- a/src/square/types/delete_booking_custom_attribute_response.py +++ b/src/square/types/delete_booking_custom_attribute_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteBookingCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_break_type_response.py b/src/square/types/delete_break_type_response.py index dc138912..f7384cfd 100644 --- a/src/square/types/delete_break_type_response.py +++ b/src/square/types/delete_break_type_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteBreakTypeResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_catalog_object_response.py b/src/square/types/delete_catalog_object_response.py index e0a9a464..28ab1f99 100644 --- a/src/square/types/delete_catalog_object_response.py +++ b/src/square/types/delete_catalog_object_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteCatalogObjectResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_customer_card_response.py b/src/square/types/delete_customer_card_response.py index ad02e8e7..23e39b36 100644 --- a/src/square/types/delete_customer_card_response.py +++ b/src/square/types/delete_customer_card_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteCustomerCardResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_customer_custom_attribute_definition_response.py b/src/square/types/delete_customer_custom_attribute_definition_response.py index 5c808299..5f172807 100644 --- a/src/square/types/delete_customer_custom_attribute_definition_response.py +++ b/src/square/types/delete_customer_custom_attribute_definition_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteCustomerCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_customer_custom_attribute_response.py b/src/square/types/delete_customer_custom_attribute_response.py index 8fc2f14e..205e5ad5 100644 --- a/src/square/types/delete_customer_custom_attribute_response.py +++ b/src/square/types/delete_customer_custom_attribute_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteCustomerCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_customer_group_response.py b/src/square/types/delete_customer_group_response.py index 0dcb60a9..ea872c55 100644 --- a/src/square/types/delete_customer_group_response.py +++ b/src/square/types/delete_customer_group_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteCustomerGroupResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_customer_response.py b/src/square/types/delete_customer_response.py index 1939c491..81ba61f8 100644 --- a/src/square/types/delete_customer_response.py +++ b/src/square/types/delete_customer_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteCustomerResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_dispute_evidence_response.py b/src/square/types/delete_dispute_evidence_response.py index 97316658..eacb8d4d 100644 --- a/src/square/types/delete_dispute_evidence_response.py +++ b/src/square/types/delete_dispute_evidence_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteDisputeEvidenceResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_invoice_attachment_response.py b/src/square/types/delete_invoice_attachment_response.py index aad64e4b..8c4f264b 100644 --- a/src/square/types/delete_invoice_attachment_response.py +++ b/src/square/types/delete_invoice_attachment_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteInvoiceAttachmentResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_invoice_response.py b/src/square/types/delete_invoice_response.py index 81a83ba0..8c1e8bcc 100644 --- a/src/square/types/delete_invoice_response.py +++ b/src/square/types/delete_invoice_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteInvoiceResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_location_custom_attribute_definition_response.py b/src/square/types/delete_location_custom_attribute_definition_response.py index ecc4f370..b346939e 100644 --- a/src/square/types/delete_location_custom_attribute_definition_response.py +++ b/src/square/types/delete_location_custom_attribute_definition_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteLocationCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_location_custom_attribute_response.py b/src/square/types/delete_location_custom_attribute_response.py index a354271d..9e29d95d 100644 --- a/src/square/types/delete_location_custom_attribute_response.py +++ b/src/square/types/delete_location_custom_attribute_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteLocationCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_loyalty_reward_response.py b/src/square/types/delete_loyalty_reward_response.py index fda4898c..15942a98 100644 --- a/src/square/types/delete_loyalty_reward_response.py +++ b/src/square/types/delete_loyalty_reward_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteLoyaltyRewardResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_merchant_custom_attribute_definition_response.py b/src/square/types/delete_merchant_custom_attribute_definition_response.py index 97bcff02..3746c71a 100644 --- a/src/square/types/delete_merchant_custom_attribute_definition_response.py +++ b/src/square/types/delete_merchant_custom_attribute_definition_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteMerchantCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_merchant_custom_attribute_response.py b/src/square/types/delete_merchant_custom_attribute_response.py index 7c19340f..8d9fea73 100644 --- a/src/square/types/delete_merchant_custom_attribute_response.py +++ b/src/square/types/delete_merchant_custom_attribute_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteMerchantCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_order_custom_attribute_definition_response.py b/src/square/types/delete_order_custom_attribute_definition_response.py index 553295be..3c296d80 100644 --- a/src/square/types/delete_order_custom_attribute_definition_response.py +++ b/src/square/types/delete_order_custom_attribute_definition_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteOrderCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_order_custom_attribute_response.py b/src/square/types/delete_order_custom_attribute_response.py index a62455d7..b93d5a2f 100644 --- a/src/square/types/delete_order_custom_attribute_response.py +++ b/src/square/types/delete_order_custom_attribute_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteOrderCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_payment_link_response.py b/src/square/types/delete_payment_link_response.py index c8842937..938cc1b5 100644 --- a/src/square/types/delete_payment_link_response.py +++ b/src/square/types/delete_payment_link_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeletePaymentLinkResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_shift_response.py b/src/square/types/delete_shift_response.py index fbc6ef08..5b2b0e80 100644 --- a/src/square/types/delete_shift_response.py +++ b/src/square/types/delete_shift_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_snippet_response.py b/src/square/types/delete_snippet_response.py index c120080d..4b2579ff 100644 --- a/src/square/types/delete_snippet_response.py +++ b/src/square/types/delete_snippet_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteSnippetResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_subscription_action_response.py b/src/square/types/delete_subscription_action_response.py index 2076315c..4750bc10 100644 --- a/src/square/types/delete_subscription_action_response.py +++ b/src/square/types/delete_subscription_action_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeleteSubscriptionActionResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_timecard_response.py b/src/square/types/delete_timecard_response.py index e44b2b15..9cc10b30 100644 --- a/src/square/types/delete_timecard_response.py +++ b/src/square/types/delete_timecard_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteTimecardResponse(UncheckedBaseModel): diff --git a/src/square/types/delete_transfer_order_response.py b/src/square/types/delete_transfer_order_response.py deleted file mode 100644 index 71e147e4..00000000 --- a/src/square/types/delete_transfer_order_response.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error - - -class DeleteTransferOrderResponse(UncheckedBaseModel): - """ - Response for deleting a transfer order - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/delete_webhook_subscription_response.py b/src/square/types/delete_webhook_subscription_response.py index 7a474a72..463bc462 100644 --- a/src/square/types/delete_webhook_subscription_response.py +++ b/src/square/types/delete_webhook_subscription_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DeleteWebhookSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/destination.py b/src/square/types/destination.py index 77bf3f22..a645698b 100644 --- a/src/square/types/destination.py +++ b/src/square/types/destination.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .destination_type import DestinationType import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .destination_type import DestinationType class Destination(UncheckedBaseModel): diff --git a/src/square/types/destination_details.py b/src/square/types/destination_details.py index 5e73c64d..2415f258 100644 --- a/src/square/types/destination_details.py +++ b/src/square/types/destination_details.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .destination_details_card_refund_details import DestinationDetailsCardRefundDetails +import pydantic from .destination_details_cash_refund_details import DestinationDetailsCashRefundDetails from .destination_details_external_refund_details import DestinationDetailsExternalRefundDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DestinationDetails(UncheckedBaseModel): diff --git a/src/square/types/destination_details_card_refund_details.py b/src/square/types/destination_details_card_refund_details.py index d40edbb7..476bcc28 100644 --- a/src/square/types/destination_details_card_refund_details.py +++ b/src/square/types/destination_details_card_refund_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .card import Card import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card import Card class DestinationDetailsCardRefundDetails(UncheckedBaseModel): diff --git a/src/square/types/destination_details_cash_refund_details.py b/src/square/types/destination_details_cash_refund_details.py index e9648eeb..8287bd3b 100644 --- a/src/square/types/destination_details_cash_refund_details.py +++ b/src/square/types/destination_details_cash_refund_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DestinationDetailsCashRefundDetails(UncheckedBaseModel): diff --git a/src/square/types/destination_details_external_refund_details.py b/src/square/types/destination_details_external_refund_details.py index 7642a756..2d537661 100644 --- a/src/square/types/destination_details_external_refund_details.py +++ b/src/square/types/destination_details_external_refund_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DestinationDetailsExternalRefundDetails(UncheckedBaseModel): @@ -18,7 +17,7 @@ class DestinationDetailsExternalRefundDetails(UncheckedBaseModel): following: - CHECK - Refunded using a physical check. - BANK_TRANSFER - Refunded using external bank transfer. - - OTHER\\_GIFT\\_CARD - Refunded using a non-Square gift card. + - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. - CRYPTO - Refunded using a crypto currency. - SQUARE_CASH - Refunded using Square Cash App. - SOCIAL - Refunded using peer-to-peer payment applications. diff --git a/src/square/types/device.py b/src/square/types/device.py index ef89542f..e33d9c41 100644 --- a/src/square/types/device.py +++ b/src/square/types/device.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .component import Component from .device_attributes import DeviceAttributes +from .component import Component from .device_status import DeviceStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Device(UncheckedBaseModel): diff --git a/src/square/types/device_attributes.py b/src/square/types/device_attributes.py index 98f9d927..36eea8e1 100644 --- a/src/square/types/device_attributes.py +++ b/src/square/types/device_attributes.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .device_attributes_device_type import DeviceAttributesDeviceType +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceAttributes(UncheckedBaseModel): - type: DeviceAttributesDeviceType = pydantic.Field() + type: DeviceAttributesDeviceType = pydantic.Field(default="TERMINAL") """ The device type. See [DeviceType](#type-devicetype) for possible values diff --git a/src/square/types/device_attributes_device_type.py b/src/square/types/device_attributes_device_type.py index b1126743..d7e3a974 100644 --- a/src/square/types/device_attributes_device_type.py +++ b/src/square/types/device_attributes_device_type.py @@ -2,4 +2,4 @@ import typing -DeviceAttributesDeviceType = typing.Union[typing.Literal["TERMINAL", "HANDHELD"], typing.Any] +DeviceAttributesDeviceType = typing.Literal["TERMINAL"] diff --git a/src/square/types/device_checkout_options.py b/src/square/types/device_checkout_options.py index 3d35290d..c5992b3e 100644 --- a/src/square/types/device_checkout_options.py +++ b/src/square/types/device_checkout_options.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .tip_settings import TipSettings +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceCheckoutOptions(UncheckedBaseModel): diff --git a/src/square/types/device_code.py b/src/square/types/device_code.py index 7cecc1b7..263f71ef 100644 --- a/src/square/types/device_code.py +++ b/src/square/types/device_code.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .device_code_status import DeviceCodeStatus from .product_type import ProductType +from .device_code_status import DeviceCodeStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceCode(UncheckedBaseModel): diff --git a/src/square/types/device_code_paired_event.py b/src/square/types/device_code_paired_event.py index 248cae92..641f835f 100644 --- a/src/square/types/device_code_paired_event.py +++ b/src/square/types/device_code_paired_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_code_paired_event_data import DeviceCodePairedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceCodePairedEvent(UncheckedBaseModel): diff --git a/src/square/types/device_code_paired_event_data.py b/src/square/types/device_code_paired_event_data.py index 43d47c29..b3aba033 100644 --- a/src/square/types/device_code_paired_event_data.py +++ b/src/square/types/device_code_paired_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_code_paired_event_object import DeviceCodePairedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceCodePairedEventData(UncheckedBaseModel): diff --git a/src/square/types/device_code_paired_event_object.py b/src/square/types/device_code_paired_event_object.py index ec08ce88..443af8b7 100644 --- a/src/square/types/device_code_paired_event_object.py +++ b/src/square/types/device_code_paired_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .device_code import DeviceCode import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .device_code import DeviceCode class DeviceCodePairedEventObject(UncheckedBaseModel): diff --git a/src/square/types/device_component_details_application_details.py b/src/square/types/device_component_details_application_details.py index 5139c80b..35cb4da5 100644 --- a/src/square/types/device_component_details_application_details.py +++ b/src/square/types/device_component_details_application_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .application_type import ApplicationType import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .application_type import ApplicationType class DeviceComponentDetailsApplicationDetails(UncheckedBaseModel): diff --git a/src/square/types/device_component_details_battery_details.py b/src/square/types/device_component_details_battery_details.py index 1549f5a2..79e7e5bc 100644 --- a/src/square/types/device_component_details_battery_details.py +++ b/src/square/types/device_component_details_battery_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_component_details_external_power import DeviceComponentDetailsExternalPower +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceComponentDetailsBatteryDetails(UncheckedBaseModel): diff --git a/src/square/types/device_component_details_card_reader_details.py b/src/square/types/device_component_details_card_reader_details.py index 5aa48e58..1feba19c 100644 --- a/src/square/types/device_component_details_card_reader_details.py +++ b/src/square/types/device_component_details_card_reader_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DeviceComponentDetailsCardReaderDetails(UncheckedBaseModel): diff --git a/src/square/types/device_component_details_ethernet_details.py b/src/square/types/device_component_details_ethernet_details.py index 75157df5..2afad8e2 100644 --- a/src/square/types/device_component_details_ethernet_details.py +++ b/src/square/types/device_component_details_ethernet_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DeviceComponentDetailsEthernetDetails(UncheckedBaseModel): @@ -18,11 +17,6 @@ class DeviceComponentDetailsEthernetDetails(UncheckedBaseModel): The string representation of the device’s IPv4 address. """ - mac_address: typing.Optional[str] = pydantic.Field(default=None) - """ - The mac address of the device in this network. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/device_component_details_measurement.py b/src/square/types/device_component_details_measurement.py index c3633d70..2be5a790 100644 --- a/src/square/types/device_component_details_measurement.py +++ b/src/square/types/device_component_details_measurement.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - -import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic class DeviceComponentDetailsMeasurement(UncheckedBaseModel): @@ -12,10 +11,7 @@ class DeviceComponentDetailsMeasurement(UncheckedBaseModel): A value qualified by unit of measure. """ - value: typing.Optional[int] = pydantic.Field(default=None) - """ - Value of measure. - """ + value: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/square/types/device_component_details_wi_fi_details.py b/src/square/types/device_component_details_wi_fi_details.py index 1215c547..39ac6597 100644 --- a/src/square/types/device_component_details_wi_fi_details.py +++ b/src/square/types/device_component_details_wi_fi_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_component_details_measurement import DeviceComponentDetailsMeasurement +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceComponentDetailsWiFiDetails(UncheckedBaseModel): @@ -35,11 +34,6 @@ class DeviceComponentDetailsWiFiDetails(UncheckedBaseModel): A representation of signal strength of the WIFI network connection. """ - mac_address: typing.Optional[str] = pydantic.Field(default=None) - """ - The mac address of the device in this network. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/device_created_event.py b/src/square/types/device_created_event.py index 4606a2a6..db0ce1cb 100644 --- a/src/square/types/device_created_event.py +++ b/src/square/types/device_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_created_event_data import DeviceCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/device_created_event_data.py b/src/square/types/device_created_event_data.py index d6f841f6..eacfecac 100644 --- a/src/square/types/device_created_event_data.py +++ b/src/square/types/device_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_created_event_object import DeviceCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DeviceCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/device_created_event_object.py b/src/square/types/device_created_event_object.py index 605a2f0d..e81d69b5 100644 --- a/src/square/types/device_created_event_object.py +++ b/src/square/types/device_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .device import Device import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .device import Device class DeviceCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/device_details.py b/src/square/types/device_details.py index e2eceead..2c39eb52 100644 --- a/src/square/types/device_details.py +++ b/src/square/types/device_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DeviceDetails(UncheckedBaseModel): diff --git a/src/square/types/device_metadata.py b/src/square/types/device_metadata.py index 4feade1d..91637c71 100644 --- a/src/square/types/device_metadata.py +++ b/src/square/types/device_metadata.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DeviceMetadata(UncheckedBaseModel): diff --git a/src/square/types/device_status.py b/src/square/types/device_status.py index b7be916e..3430fb9a 100644 --- a/src/square/types/device_status.py +++ b/src/square/types/device_status.py @@ -1,17 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .device_status_category import DeviceStatusCategory import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .device_status_category import DeviceStatusCategory class DeviceStatus(UncheckedBaseModel): category: typing.Optional[DeviceStatusCategory] = pydantic.Field(default=None) """ - Category of the device status. + See [Category](#type-category) for possible values """ diff --git a/src/square/types/digital_wallet_details.py b/src/square/types/digital_wallet_details.py index 9c64d6ae..7e7c6553 100644 --- a/src/square/types/digital_wallet_details.py +++ b/src/square/types/digital_wallet_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .cash_app_details import CashAppDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DigitalWalletDetails(UncheckedBaseModel): diff --git a/src/square/types/disable_card_response.py b/src/square/types/disable_card_response.py index e079b1be..f216f61f 100644 --- a/src/square/types/disable_card_response.py +++ b/src/square/types/disable_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisableCardResponse(UncheckedBaseModel): diff --git a/src/square/types/disable_events_response.py b/src/square/types/disable_events_response.py index a89801d1..fea31385 100644 --- a/src/square/types/disable_events_response.py +++ b/src/square/types/disable_events_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class DisableEventsResponse(UncheckedBaseModel): diff --git a/src/square/types/dismiss_terminal_action_response.py b/src/square/types/dismiss_terminal_action_response.py index 7a8a757d..acbe9a02 100644 --- a/src/square/types/dismiss_terminal_action_response.py +++ b/src/square/types/dismiss_terminal_action_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_action import TerminalAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DismissTerminalActionResponse(UncheckedBaseModel): diff --git a/src/square/types/dismiss_terminal_checkout_response.py b/src/square/types/dismiss_terminal_checkout_response.py index 795b93ca..2d896121 100644 --- a/src/square/types/dismiss_terminal_checkout_response.py +++ b/src/square/types/dismiss_terminal_checkout_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_checkout import TerminalCheckout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DismissTerminalCheckoutResponse(UncheckedBaseModel): diff --git a/src/square/types/dismiss_terminal_refund_response.py b/src/square/types/dismiss_terminal_refund_response.py index ab0af9ca..d85dda21 100644 --- a/src/square/types/dismiss_terminal_refund_response.py +++ b/src/square/types/dismiss_terminal_refund_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_refund import TerminalRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DismissTerminalRefundResponse(UncheckedBaseModel): diff --git a/src/square/types/dispute.py b/src/square/types/dispute.py index 5bac4a57..90dadfe1 100644 --- a/src/square/types/dispute.py +++ b/src/square/types/dispute.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .card_brand import CardBrand +from .money import Money from .dispute_reason import DisputeReason from .dispute_state import DisputeState from .disputed_payment import DisputedPayment -from .money import Money +from .card_brand import CardBrand +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Dispute(UncheckedBaseModel): diff --git a/src/square/types/dispute_created_event.py b/src/square/types/dispute_created_event.py index 5e08797d..1a4241b6 100644 --- a/src/square/types/dispute_created_event.py +++ b/src/square/types/dispute_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_created_event_data import DisputeCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_created_event_data.py b/src/square/types/dispute_created_event_data.py index 4f0d3c6b..b273855f 100644 --- a/src/square/types/dispute_created_event_data.py +++ b/src/square/types/dispute_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_created_event_object import DisputeCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_created_event_object.py b/src/square/types/dispute_created_event_object.py index 25bbf23d..34d96d71 100644 --- a/src/square/types/dispute_created_event_object.py +++ b/src/square/types/dispute_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence.py b/src/square/types/dispute_evidence.py index 6a77a2ea..93f6eb92 100644 --- a/src/square/types/dispute_evidence.py +++ b/src/square/types/dispute_evidence.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_file import DisputeEvidenceFile from .dispute_evidence_type import DisputeEvidenceType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidence(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_added_event.py b/src/square/types/dispute_evidence_added_event.py index 98717c54..3e7c1208 100644 --- a/src/square/types/dispute_evidence_added_event.py +++ b/src/square/types/dispute_evidence_added_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_added_event_data import DisputeEvidenceAddedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceAddedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_added_event_data.py b/src/square/types/dispute_evidence_added_event_data.py index 803af88b..23a4f9a0 100644 --- a/src/square/types/dispute_evidence_added_event_data.py +++ b/src/square/types/dispute_evidence_added_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_added_event_object import DisputeEvidenceAddedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceAddedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_added_event_object.py b/src/square/types/dispute_evidence_added_event_object.py index ad5ccc25..6e69b560 100644 --- a/src/square/types/dispute_evidence_added_event_object.py +++ b/src/square/types/dispute_evidence_added_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeEvidenceAddedEventObject(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_created_event.py b/src/square/types/dispute_evidence_created_event.py index 3f80b747..b133ef50 100644 --- a/src/square/types/dispute_evidence_created_event.py +++ b/src/square/types/dispute_evidence_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_created_event_data import DisputeEvidenceCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_created_event_data.py b/src/square/types/dispute_evidence_created_event_data.py index 2db83cf3..a9960b43 100644 --- a/src/square/types/dispute_evidence_created_event_data.py +++ b/src/square/types/dispute_evidence_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_created_event_object import DisputeEvidenceCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_created_event_object.py b/src/square/types/dispute_evidence_created_event_object.py index 13b3028a..46b8a0aa 100644 --- a/src/square/types/dispute_evidence_created_event_object.py +++ b/src/square/types/dispute_evidence_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeEvidenceCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_deleted_event.py b/src/square/types/dispute_evidence_deleted_event.py index 869f4808..23bd2b1a 100644 --- a/src/square/types/dispute_evidence_deleted_event.py +++ b/src/square/types/dispute_evidence_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_deleted_event_data import DisputeEvidenceDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_deleted_event_data.py b/src/square/types/dispute_evidence_deleted_event_data.py index ac2f1932..05baa7f8 100644 --- a/src/square/types/dispute_evidence_deleted_event_data.py +++ b/src/square/types/dispute_evidence_deleted_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_deleted_event_object import DisputeEvidenceDeletedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_deleted_event_object.py b/src/square/types/dispute_evidence_deleted_event_object.py index cfb2d197..bdcdb2d9 100644 --- a/src/square/types/dispute_evidence_deleted_event_object.py +++ b/src/square/types/dispute_evidence_deleted_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeEvidenceDeletedEventObject(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_file.py b/src/square/types/dispute_evidence_file.py index d9391a16..b8380b9d 100644 --- a/src/square/types/dispute_evidence_file.py +++ b/src/square/types/dispute_evidence_file.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DisputeEvidenceFile(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_removed_event.py b/src/square/types/dispute_evidence_removed_event.py index 0783e0cc..e018b4c2 100644 --- a/src/square/types/dispute_evidence_removed_event.py +++ b/src/square/types/dispute_evidence_removed_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_removed_event_data import DisputeEvidenceRemovedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceRemovedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_removed_event_data.py b/src/square/types/dispute_evidence_removed_event_data.py index bdd0b85c..4f261f9d 100644 --- a/src/square/types/dispute_evidence_removed_event_data.py +++ b/src/square/types/dispute_evidence_removed_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence_removed_event_object import DisputeEvidenceRemovedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeEvidenceRemovedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_evidence_removed_event_object.py b/src/square/types/dispute_evidence_removed_event_object.py index 842bf9ba..e7feefaf 100644 --- a/src/square/types/dispute_evidence_removed_event_object.py +++ b/src/square/types/dispute_evidence_removed_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeEvidenceRemovedEventObject(UncheckedBaseModel): diff --git a/src/square/types/dispute_state_changed_event.py b/src/square/types/dispute_state_changed_event.py index 3f6d8a7e..39ebce6f 100644 --- a/src/square/types/dispute_state_changed_event.py +++ b/src/square/types/dispute_state_changed_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_state_changed_event_data import DisputeStateChangedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeStateChangedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_state_changed_event_data.py b/src/square/types/dispute_state_changed_event_data.py index 37c6e938..25e50f43 100644 --- a/src/square/types/dispute_state_changed_event_data.py +++ b/src/square/types/dispute_state_changed_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_state_changed_event_object import DisputeStateChangedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeStateChangedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_state_changed_event_object.py b/src/square/types/dispute_state_changed_event_object.py index 1efce6ae..fe90907a 100644 --- a/src/square/types/dispute_state_changed_event_object.py +++ b/src/square/types/dispute_state_changed_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeStateChangedEventObject(UncheckedBaseModel): diff --git a/src/square/types/dispute_state_updated_event.py b/src/square/types/dispute_state_updated_event.py index 770fa7d4..597d58f7 100644 --- a/src/square/types/dispute_state_updated_event.py +++ b/src/square/types/dispute_state_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_state_updated_event_data import DisputeStateUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeStateUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/dispute_state_updated_event_data.py b/src/square/types/dispute_state_updated_event_data.py index d409dac7..0929a97e 100644 --- a/src/square/types/dispute_state_updated_event_data.py +++ b/src/square/types/dispute_state_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_state_updated_event_object import DisputeStateUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class DisputeStateUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/dispute_state_updated_event_object.py b/src/square/types/dispute_state_updated_event_object.py index 713a16cf..2d5f8d2d 100644 --- a/src/square/types/dispute_state_updated_event_object.py +++ b/src/square/types/dispute_state_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .dispute import Dispute import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .dispute import Dispute class DisputeStateUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/disputed_payment.py b/src/square/types/disputed_payment.py index 180513d8..e2ae3dd2 100644 --- a/src/square/types/disputed_payment.py +++ b/src/square/types/disputed_payment.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class DisputedPayment(UncheckedBaseModel): diff --git a/src/square/types/employee.py b/src/square/types/employee.py index edf17f94..c2e39775 100644 --- a/src/square/types/employee.py +++ b/src/square/types/employee.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .employee_status import EmployeeStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Employee(UncheckedBaseModel): diff --git a/src/square/types/employee_wage.py b/src/square/types/employee_wage.py index 6e57c69e..cc0d0f35 100644 --- a/src/square/types/employee_wage.py +++ b/src/square/types/employee_wage.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class EmployeeWage(UncheckedBaseModel): diff --git a/src/square/types/enable_events_response.py b/src/square/types/enable_events_response.py index bcb4d43c..d7387ac6 100644 --- a/src/square/types/enable_events_response.py +++ b/src/square/types/enable_events_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class EnableEventsResponse(UncheckedBaseModel): diff --git a/src/square/types/error.py b/src/square/types/error.py index dc72150a..8842ebfc 100644 --- a/src/square/types/error.py +++ b/src/square/types/error.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .error_category import ErrorCategory +import pydantic from .error_code import ErrorCode +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Error(UncheckedBaseModel): diff --git a/src/square/types/event.py b/src/square/types/event.py index e4938454..3b7d602d 100644 --- a/src/square/types/event.py +++ b/src/square/types/event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .event_data import EventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Event(UncheckedBaseModel): diff --git a/src/square/types/event_data.py b/src/square/types/event_data.py index f552902c..3b895e0b 100644 --- a/src/square/types/event_data.py +++ b/src/square/types/event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class EventData(UncheckedBaseModel): @@ -23,7 +22,7 @@ class EventData(UncheckedBaseModel): This is true if the affected object has been deleted; otherwise, it's absent. """ - object: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + object: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) """ An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. """ diff --git a/src/square/types/event_metadata.py b/src/square/types/event_metadata.py index d102f5e2..310b6c94 100644 --- a/src/square/types/event_metadata.py +++ b/src/square/types/event_metadata.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class EventMetadata(UncheckedBaseModel): diff --git a/src/square/types/event_type_metadata.py b/src/square/types/event_type_metadata.py index b1bbcbc6..2712d3c6 100644 --- a/src/square/types/event_type_metadata.py +++ b/src/square/types/event_type_metadata.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class EventTypeMetadata(UncheckedBaseModel): diff --git a/src/square/types/external_payment_details.py b/src/square/types/external_payment_details.py index 1eff2b2f..7de9754e 100644 --- a/src/square/types/external_payment_details.py +++ b/src/square/types/external_payment_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ExternalPaymentDetails(UncheckedBaseModel): @@ -20,7 +19,7 @@ class ExternalPaymentDetails(UncheckedBaseModel): The type of external payment the seller received. It can be one of the following: - CHECK - Paid using a physical check. - BANK_TRANSFER - Paid using external bank transfer. - - OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card. + - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. - CRYPTO - Paid using a crypto currency. - SQUARE_CASH - Paid using Square Cash App. - SOCIAL - Paid using peer-to-peer payment applications. diff --git a/src/square/types/filter_value.py b/src/square/types/filter_value.py index c54867cb..4f6577a4 100644 --- a/src/square/types/filter_value.py +++ b/src/square/types/filter_value.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing - +from ..core.serialization import FieldMetadata import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel class FilterValue(UncheckedBaseModel): diff --git a/src/square/types/float_number_range.py b/src/square/types/float_number_range.py index 26822706..29319f67 100644 --- a/src/square/types/float_number_range.py +++ b/src/square/types/float_number_range.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class FloatNumberRange(UncheckedBaseModel): diff --git a/src/square/types/fulfillment.py b/src/square/types/fulfillment.py index 5ba2478e..b8b992c1 100644 --- a/src/square/types/fulfillment.py +++ b/src/square/types/fulfillment.py @@ -1,17 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .fulfillment_delivery_details import FulfillmentDeliveryDetails -from .fulfillment_fulfillment_entry import FulfillmentFulfillmentEntry +from .fulfillment_type import FulfillmentType +from .fulfillment_state import FulfillmentState from .fulfillment_fulfillment_line_item_application import FulfillmentFulfillmentLineItemApplication +from .fulfillment_fulfillment_entry import FulfillmentFulfillmentEntry from .fulfillment_pickup_details import FulfillmentPickupDetails from .fulfillment_shipment_details import FulfillmentShipmentDetails -from .fulfillment_state import FulfillmentState -from .fulfillment_type import FulfillmentType +from .fulfillment_delivery_details import FulfillmentDeliveryDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Fulfillment(UncheckedBaseModel): diff --git a/src/square/types/fulfillment_delivery_details.py b/src/square/types/fulfillment_delivery_details.py index f30c51eb..9d132927 100644 --- a/src/square/types/fulfillment_delivery_details.py +++ b/src/square/types/fulfillment_delivery_details.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .fulfillment_recipient import FulfillmentRecipient import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type import ( FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType, ) -from .fulfillment_recipient import FulfillmentRecipient +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class FulfillmentDeliveryDetails(UncheckedBaseModel): diff --git a/src/square/types/fulfillment_fulfillment_entry.py b/src/square/types/fulfillment_fulfillment_entry.py index 43dc3c08..09fa1b4e 100644 --- a/src/square/types/fulfillment_fulfillment_entry.py +++ b/src/square/types/fulfillment_fulfillment_entry.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class FulfillmentFulfillmentEntry(UncheckedBaseModel): diff --git a/src/square/types/fulfillment_pickup_details.py b/src/square/types/fulfillment_pickup_details.py index 4a9eaa38..70a61559 100644 --- a/src/square/types/fulfillment_pickup_details.py +++ b/src/square/types/fulfillment_pickup_details.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .fulfillment_recipient import FulfillmentRecipient import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .fulfillment_pickup_details_curbside_pickup_details import FulfillmentPickupDetailsCurbsidePickupDetails from .fulfillment_pickup_details_schedule_type import FulfillmentPickupDetailsScheduleType -from .fulfillment_recipient import FulfillmentRecipient +from .fulfillment_pickup_details_curbside_pickup_details import FulfillmentPickupDetailsCurbsidePickupDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class FulfillmentPickupDetails(UncheckedBaseModel): diff --git a/src/square/types/fulfillment_pickup_details_curbside_pickup_details.py b/src/square/types/fulfillment_pickup_details_curbside_pickup_details.py index 7e13579c..c7564c75 100644 --- a/src/square/types/fulfillment_pickup_details_curbside_pickup_details.py +++ b/src/square/types/fulfillment_pickup_details_curbside_pickup_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class FulfillmentPickupDetailsCurbsidePickupDetails(UncheckedBaseModel): diff --git a/src/square/types/fulfillment_recipient.py b/src/square/types/fulfillment_recipient.py index 63f773bf..024fa566 100644 --- a/src/square/types/fulfillment_recipient.py +++ b/src/square/types/fulfillment_recipient.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class FulfillmentRecipient(UncheckedBaseModel): diff --git a/src/square/types/fulfillment_shipment_details.py b/src/square/types/fulfillment_shipment_details.py index 781c03d5..7b9abee3 100644 --- a/src/square/types/fulfillment_shipment_details.py +++ b/src/square/types/fulfillment_shipment_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .fulfillment_recipient import FulfillmentRecipient import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .fulfillment_recipient import FulfillmentRecipient class FulfillmentShipmentDetails(UncheckedBaseModel): diff --git a/src/square/types/get_bank_account_by_v1id_response.py b/src/square/types/get_bank_account_by_v1id_response.py index 425a958d..7cc96a4e 100644 --- a/src/square/types/get_bank_account_by_v1id_response.py +++ b/src/square/types/get_bank_account_by_v1id_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account import BankAccount -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetBankAccountByV1IdResponse(UncheckedBaseModel): diff --git a/src/square/types/get_bank_account_response.py b/src/square/types/get_bank_account_response.py index f6392365..8d99e410 100644 --- a/src/square/types/get_bank_account_response.py +++ b/src/square/types/get_bank_account_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account import BankAccount -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetBankAccountResponse(UncheckedBaseModel): diff --git a/src/square/types/get_booking_request.py b/src/square/types/get_booking_request.py index bbdd6929..903d1cee 100644 --- a/src/square/types/get_booking_request.py +++ b/src/square/types/get_booking_request.py @@ -2,4 +2,4 @@ import typing -GetBookingRequest = typing.Any +GetBookingRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_booking_response.py b/src/square/types/get_booking_response.py index ff400562..e17c1e1f 100644 --- a/src/square/types/get_booking_response.py +++ b/src/square/types/get_booking_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking import Booking +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetBookingResponse(UncheckedBaseModel): diff --git a/src/square/types/get_break_type_response.py b/src/square/types/get_break_type_response.py index d2e6be67..a65ef24d 100644 --- a/src/square/types/get_break_type_response.py +++ b/src/square/types/get_break_type_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .break_type import BreakType +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetBreakTypeResponse(UncheckedBaseModel): diff --git a/src/square/types/get_business_booking_profile_request.py b/src/square/types/get_business_booking_profile_request.py index 54cc04a8..2e99a602 100644 --- a/src/square/types/get_business_booking_profile_request.py +++ b/src/square/types/get_business_booking_profile_request.py @@ -2,4 +2,4 @@ import typing -GetBusinessBookingProfileRequest = typing.Any +GetBusinessBookingProfileRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_business_booking_profile_response.py b/src/square/types/get_business_booking_profile_response.py index 07b1b002..74187d92 100644 --- a/src/square/types/get_business_booking_profile_response.py +++ b/src/square/types/get_business_booking_profile_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .business_booking_profile import BusinessBookingProfile +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetBusinessBookingProfileResponse(UncheckedBaseModel): diff --git a/src/square/types/get_card_request.py b/src/square/types/get_card_request.py index edf428d3..ce8ce851 100644 --- a/src/square/types/get_card_request.py +++ b/src/square/types/get_card_request.py @@ -2,4 +2,4 @@ import typing -GetCardRequest = typing.Any +GetCardRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_card_response.py b/src/square/types/get_card_response.py index e0db0941..eaaf4d6b 100644 --- a/src/square/types/get_card_response.py +++ b/src/square/types/get_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCardResponse(UncheckedBaseModel): diff --git a/src/square/types/get_cash_drawer_shift_response.py b/src/square/types/get_cash_drawer_shift_response.py index fbc923aa..183deda1 100644 --- a/src/square/types/get_cash_drawer_shift_response.py +++ b/src/square/types/get_cash_drawer_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .cash_drawer_shift import CashDrawerShift +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCashDrawerShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/get_catalog_object_response.py b/src/square/types/get_catalog_object_response.py index db646d15..4d3885d2 100644 --- a/src/square/types/get_catalog_object_response.py +++ b/src/square/types/get_catalog_object_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCatalogObjectResponse(UncheckedBaseModel): @@ -16,12 +24,12 @@ class GetCatalogObjectResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - object: typing.Optional["CatalogObject"] = pydantic.Field(default=None) + object: typing.Optional[CatalogObject] = pydantic.Field(default=None) """ The `CatalogObject`s returned. """ - related_objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + related_objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ A list of `CatalogObject`s referenced by the object in the `object` field. """ @@ -34,18 +42,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - GetCatalogObjectResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/get_customer_custom_attribute_definition_response.py b/src/square/types/get_customer_custom_attribute_definition_response.py index 6694089a..5d7aed80 100644 --- a/src/square/types/get_customer_custom_attribute_definition_response.py +++ b/src/square/types/get_customer_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCustomerCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/get_customer_custom_attribute_response.py b/src/square/types/get_customer_custom_attribute_response.py index 767a1e9d..05695f58 100644 --- a/src/square/types/get_customer_custom_attribute_response.py +++ b/src/square/types/get_customer_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCustomerCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/get_customer_group_request.py b/src/square/types/get_customer_group_request.py index e720526f..bd9d92ae 100644 --- a/src/square/types/get_customer_group_request.py +++ b/src/square/types/get_customer_group_request.py @@ -2,4 +2,4 @@ import typing -GetCustomerGroupRequest = typing.Any +GetCustomerGroupRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_customer_group_response.py b/src/square/types/get_customer_group_response.py index 761f6a00..0c5c82da 100644 --- a/src/square/types/get_customer_group_response.py +++ b/src/square/types/get_customer_group_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_group import CustomerGroup -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCustomerGroupResponse(UncheckedBaseModel): diff --git a/src/square/types/get_customer_request.py b/src/square/types/get_customer_request.py index a0295d25..f4fe772a 100644 --- a/src/square/types/get_customer_request.py +++ b/src/square/types/get_customer_request.py @@ -2,4 +2,4 @@ import typing -GetCustomerRequest = typing.Any +GetCustomerRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_customer_response.py b/src/square/types/get_customer_response.py index fc85b0e2..e4b40eeb 100644 --- a/src/square/types/get_customer_response.py +++ b/src/square/types/get_customer_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer import Customer -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCustomerResponse(UncheckedBaseModel): diff --git a/src/square/types/get_customer_segment_request.py b/src/square/types/get_customer_segment_request.py index 94551e4b..21608589 100644 --- a/src/square/types/get_customer_segment_request.py +++ b/src/square/types/get_customer_segment_request.py @@ -2,4 +2,4 @@ import typing -GetCustomerSegmentRequest = typing.Any +GetCustomerSegmentRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_customer_segment_response.py b/src/square/types/get_customer_segment_response.py index 15fa22b6..66b1211c 100644 --- a/src/square/types/get_customer_segment_response.py +++ b/src/square/types/get_customer_segment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_segment import CustomerSegment -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetCustomerSegmentResponse(UncheckedBaseModel): diff --git a/src/square/types/get_device_code_response.py b/src/square/types/get_device_code_response.py index 3ead359e..ecf5bafb 100644 --- a/src/square/types/get_device_code_response.py +++ b/src/square/types/get_device_code_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_code import DeviceCode -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetDeviceCodeResponse(UncheckedBaseModel): diff --git a/src/square/types/get_device_response.py b/src/square/types/get_device_response.py index 6f1b1b27..5386b201 100644 --- a/src/square/types/get_device_response.py +++ b/src/square/types/get_device_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device import Device -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetDeviceResponse(UncheckedBaseModel): diff --git a/src/square/types/get_dispute_evidence_request.py b/src/square/types/get_dispute_evidence_request.py index dc44679c..9979e123 100644 --- a/src/square/types/get_dispute_evidence_request.py +++ b/src/square/types/get_dispute_evidence_request.py @@ -2,4 +2,4 @@ import typing -GetDisputeEvidenceRequest = typing.Any +GetDisputeEvidenceRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_dispute_evidence_response.py b/src/square/types/get_dispute_evidence_response.py index 32d0ecad..9d5aac44 100644 --- a/src/square/types/get_dispute_evidence_response.py +++ b/src/square/types/get_dispute_evidence_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute_evidence import DisputeEvidence -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetDisputeEvidenceResponse(UncheckedBaseModel): diff --git a/src/square/types/get_dispute_request.py b/src/square/types/get_dispute_request.py index cf91a4c3..eb8bec70 100644 --- a/src/square/types/get_dispute_request.py +++ b/src/square/types/get_dispute_request.py @@ -2,4 +2,4 @@ import typing -GetDisputeRequest = typing.Any +GetDisputeRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_dispute_response.py b/src/square/types/get_dispute_response.py index 19446348..a82d9a0b 100644 --- a/src/square/types/get_dispute_response.py +++ b/src/square/types/get_dispute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute import Dispute -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetDisputeResponse(UncheckedBaseModel): diff --git a/src/square/types/get_employee_request.py b/src/square/types/get_employee_request.py index 8b9ca75c..62bb6fa3 100644 --- a/src/square/types/get_employee_request.py +++ b/src/square/types/get_employee_request.py @@ -2,4 +2,4 @@ import typing -GetEmployeeRequest = typing.Any +GetEmployeeRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_employee_response.py b/src/square/types/get_employee_response.py index b77ac9ac..bc8fb7b2 100644 --- a/src/square/types/get_employee_response.py +++ b/src/square/types/get_employee_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .employee import Employee from .error import Error +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetEmployeeResponse(UncheckedBaseModel): diff --git a/src/square/types/get_employee_wage_response.py b/src/square/types/get_employee_wage_response.py index 27ecb32d..064787e0 100644 --- a/src/square/types/get_employee_wage_response.py +++ b/src/square/types/get_employee_wage_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .employee_wage import EmployeeWage +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetEmployeeWageResponse(UncheckedBaseModel): diff --git a/src/square/types/get_gift_card_from_gan_response.py b/src/square/types/get_gift_card_from_gan_response.py index d216a685..e7894d30 100644 --- a/src/square/types/get_gift_card_from_gan_response.py +++ b/src/square/types/get_gift_card_from_gan_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetGiftCardFromGanResponse(UncheckedBaseModel): diff --git a/src/square/types/get_gift_card_from_nonce_response.py b/src/square/types/get_gift_card_from_nonce_response.py index a6d8c783..cd55c226 100644 --- a/src/square/types/get_gift_card_from_nonce_response.py +++ b/src/square/types/get_gift_card_from_nonce_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetGiftCardFromNonceResponse(UncheckedBaseModel): diff --git a/src/square/types/get_gift_card_request.py b/src/square/types/get_gift_card_request.py index 5e378b06..4cdd3be9 100644 --- a/src/square/types/get_gift_card_request.py +++ b/src/square/types/get_gift_card_request.py @@ -2,4 +2,4 @@ import typing -GetGiftCardRequest = typing.Any +GetGiftCardRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_gift_card_response.py b/src/square/types/get_gift_card_response.py index 65b0cd3e..5c383d79 100644 --- a/src/square/types/get_gift_card_response.py +++ b/src/square/types/get_gift_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetGiftCardResponse(UncheckedBaseModel): diff --git a/src/square/types/get_inventory_adjustment_request.py b/src/square/types/get_inventory_adjustment_request.py index 58d4e171..f1258352 100644 --- a/src/square/types/get_inventory_adjustment_request.py +++ b/src/square/types/get_inventory_adjustment_request.py @@ -2,4 +2,4 @@ import typing -GetInventoryAdjustmentRequest = typing.Any +GetInventoryAdjustmentRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_inventory_adjustment_response.py b/src/square/types/get_inventory_adjustment_response.py index d593f6d2..54d8322e 100644 --- a/src/square/types/get_inventory_adjustment_response.py +++ b/src/square/types/get_inventory_adjustment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_adjustment import InventoryAdjustment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetInventoryAdjustmentResponse(UncheckedBaseModel): diff --git a/src/square/types/get_inventory_changes_response.py b/src/square/types/get_inventory_changes_response.py index 56302240..a0ee68d0 100644 --- a/src/square/types/get_inventory_changes_response.py +++ b/src/square/types/get_inventory_changes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_change import InventoryChange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetInventoryChangesResponse(UncheckedBaseModel): diff --git a/src/square/types/get_inventory_count_response.py b/src/square/types/get_inventory_count_response.py index 1e14ebb2..6618be90 100644 --- a/src/square/types/get_inventory_count_response.py +++ b/src/square/types/get_inventory_count_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_count import InventoryCount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetInventoryCountResponse(UncheckedBaseModel): diff --git a/src/square/types/get_inventory_physical_count_request.py b/src/square/types/get_inventory_physical_count_request.py index 57760a05..5da8479e 100644 --- a/src/square/types/get_inventory_physical_count_request.py +++ b/src/square/types/get_inventory_physical_count_request.py @@ -2,4 +2,4 @@ import typing -GetInventoryPhysicalCountRequest = typing.Any +GetInventoryPhysicalCountRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_inventory_physical_count_response.py b/src/square/types/get_inventory_physical_count_response.py index 33df9926..4b7dbc2f 100644 --- a/src/square/types/get_inventory_physical_count_response.py +++ b/src/square/types/get_inventory_physical_count_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_physical_count import InventoryPhysicalCount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetInventoryPhysicalCountResponse(UncheckedBaseModel): diff --git a/src/square/types/get_inventory_transfer_request.py b/src/square/types/get_inventory_transfer_request.py index ffb0d737..1b7b324e 100644 --- a/src/square/types/get_inventory_transfer_request.py +++ b/src/square/types/get_inventory_transfer_request.py @@ -2,4 +2,4 @@ import typing -GetInventoryTransferRequest = typing.Any +GetInventoryTransferRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_inventory_transfer_response.py b/src/square/types/get_inventory_transfer_response.py index d37d1b43..baa94733 100644 --- a/src/square/types/get_inventory_transfer_response.py +++ b/src/square/types/get_inventory_transfer_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .inventory_transfer import InventoryTransfer +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetInventoryTransferResponse(UncheckedBaseModel): diff --git a/src/square/types/get_invoice_response.py b/src/square/types/get_invoice_response.py index 21ca0730..2718de0e 100644 --- a/src/square/types/get_invoice_response.py +++ b/src/square/types/get_invoice_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetInvoiceResponse(UncheckedBaseModel): diff --git a/src/square/types/get_location_request.py b/src/square/types/get_location_request.py index d42756c0..652d8200 100644 --- a/src/square/types/get_location_request.py +++ b/src/square/types/get_location_request.py @@ -2,4 +2,4 @@ import typing -GetLocationRequest = typing.Any +GetLocationRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_location_response.py b/src/square/types/get_location_response.py index 30bcf202..777a9480 100644 --- a/src/square/types/get_location_response.py +++ b/src/square/types/get_location_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .location import Location +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetLocationResponse(UncheckedBaseModel): diff --git a/src/square/types/get_loyalty_account_request.py b/src/square/types/get_loyalty_account_request.py index 91099540..e55abe95 100644 --- a/src/square/types/get_loyalty_account_request.py +++ b/src/square/types/get_loyalty_account_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyAccountRequest = typing.Any +GetLoyaltyAccountRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_loyalty_account_response.py b/src/square/types/get_loyalty_account_response.py index a491a413..8bc83fc5 100644 --- a/src/square/types/get_loyalty_account_response.py +++ b/src/square/types/get_loyalty_account_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_account import LoyaltyAccount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetLoyaltyAccountResponse(UncheckedBaseModel): diff --git a/src/square/types/get_loyalty_program_request.py b/src/square/types/get_loyalty_program_request.py index d079e21a..49a2688c 100644 --- a/src/square/types/get_loyalty_program_request.py +++ b/src/square/types/get_loyalty_program_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyProgramRequest = typing.Any +GetLoyaltyProgramRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_loyalty_program_response.py b/src/square/types/get_loyalty_program_response.py index d900be87..22187a73 100644 --- a/src/square/types/get_loyalty_program_response.py +++ b/src/square/types/get_loyalty_program_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_program import LoyaltyProgram +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetLoyaltyProgramResponse(UncheckedBaseModel): diff --git a/src/square/types/get_loyalty_promotion_request.py b/src/square/types/get_loyalty_promotion_request.py index 520df014..943f01b2 100644 --- a/src/square/types/get_loyalty_promotion_request.py +++ b/src/square/types/get_loyalty_promotion_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyPromotionRequest = typing.Any +GetLoyaltyPromotionRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_loyalty_promotion_response.py b/src/square/types/get_loyalty_promotion_response.py index 96205394..b24b273b 100644 --- a/src/square/types/get_loyalty_promotion_response.py +++ b/src/square/types/get_loyalty_promotion_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_promotion import LoyaltyPromotion +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetLoyaltyPromotionResponse(UncheckedBaseModel): diff --git a/src/square/types/get_loyalty_reward_request.py b/src/square/types/get_loyalty_reward_request.py index af544cf5..7bd0591c 100644 --- a/src/square/types/get_loyalty_reward_request.py +++ b/src/square/types/get_loyalty_reward_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyRewardRequest = typing.Any +GetLoyaltyRewardRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_loyalty_reward_response.py b/src/square/types/get_loyalty_reward_response.py index 8da7c923..3ab1bffa 100644 --- a/src/square/types/get_loyalty_reward_response.py +++ b/src/square/types/get_loyalty_reward_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_reward import LoyaltyReward +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetLoyaltyRewardResponse(UncheckedBaseModel): diff --git a/src/square/types/get_merchant_request.py b/src/square/types/get_merchant_request.py index 31660385..1dd24b56 100644 --- a/src/square/types/get_merchant_request.py +++ b/src/square/types/get_merchant_request.py @@ -2,4 +2,4 @@ import typing -GetMerchantRequest = typing.Any +GetMerchantRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_merchant_response.py b/src/square/types/get_merchant_response.py index 31bf69a4..eb46f13c 100644 --- a/src/square/types/get_merchant_response.py +++ b/src/square/types/get_merchant_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .merchant import Merchant +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetMerchantResponse(UncheckedBaseModel): diff --git a/src/square/types/get_order_request.py b/src/square/types/get_order_request.py index 68e52624..5bcbdf84 100644 --- a/src/square/types/get_order_request.py +++ b/src/square/types/get_order_request.py @@ -2,4 +2,4 @@ import typing -GetOrderRequest = typing.Any +GetOrderRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_order_response.py b/src/square/types/get_order_response.py index d1c77c66..4da063c0 100644 --- a/src/square/types/get_order_response.py +++ b/src/square/types/get_order_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetOrderResponse(UncheckedBaseModel): diff --git a/src/square/types/get_payment_link_request.py b/src/square/types/get_payment_link_request.py index c0a0874a..384b63a5 100644 --- a/src/square/types/get_payment_link_request.py +++ b/src/square/types/get_payment_link_request.py @@ -2,4 +2,4 @@ import typing -GetPaymentLinkRequest = typing.Any +GetPaymentLinkRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_payment_link_response.py b/src/square/types/get_payment_link_response.py index 16683513..08ca81dd 100644 --- a/src/square/types/get_payment_link_response.py +++ b/src/square/types/get_payment_link_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment_link import PaymentLink +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetPaymentLinkResponse(UncheckedBaseModel): diff --git a/src/square/types/get_payment_refund_response.py b/src/square/types/get_payment_refund_response.py index 19e44c62..16da4096 100644 --- a/src/square/types/get_payment_refund_response.py +++ b/src/square/types/get_payment_refund_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment_refund import PaymentRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetPaymentRefundResponse(UncheckedBaseModel): diff --git a/src/square/types/get_payment_response.py b/src/square/types/get_payment_response.py index fddbd224..44b4b70c 100644 --- a/src/square/types/get_payment_response.py +++ b/src/square/types/get_payment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment import Payment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetPaymentResponse(UncheckedBaseModel): diff --git a/src/square/types/get_payout_response.py b/src/square/types/get_payout_response.py index 737b8bdf..a02a5c09 100644 --- a/src/square/types/get_payout_response.py +++ b/src/square/types/get_payout_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payout import Payout import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .payout import Payout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetPayoutResponse(UncheckedBaseModel): diff --git a/src/square/types/get_shift_response.py b/src/square/types/get_shift_response.py index f593773e..64af8439 100644 --- a/src/square/types/get_shift_response.py +++ b/src/square/types/get_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .shift import Shift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .shift import Shift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/get_snippet_request.py b/src/square/types/get_snippet_request.py index b7771d81..65afb268 100644 --- a/src/square/types/get_snippet_request.py +++ b/src/square/types/get_snippet_request.py @@ -2,4 +2,4 @@ import typing -GetSnippetRequest = typing.Any +GetSnippetRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_snippet_response.py b/src/square/types/get_snippet_response.py index f5811cae..9f5fcd3c 100644 --- a/src/square/types/get_snippet_response.py +++ b/src/square/types/get_snippet_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .snippet import Snippet +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetSnippetResponse(UncheckedBaseModel): diff --git a/src/square/types/get_subscription_response.py b/src/square/types/get_subscription_response.py index 5ecc82a0..f75bcdc1 100644 --- a/src/square/types/get_subscription_response.py +++ b/src/square/types/get_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/get_team_member_booking_profile_request.py b/src/square/types/get_team_member_booking_profile_request.py index fa1fe13f..3a11ecb5 100644 --- a/src/square/types/get_team_member_booking_profile_request.py +++ b/src/square/types/get_team_member_booking_profile_request.py @@ -2,4 +2,4 @@ import typing -GetTeamMemberBookingProfileRequest = typing.Any +GetTeamMemberBookingProfileRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_team_member_booking_profile_response.py b/src/square/types/get_team_member_booking_profile_response.py index 7dde96a1..969c72aa 100644 --- a/src/square/types/get_team_member_booking_profile_response.py +++ b/src/square/types/get_team_member_booking_profile_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member_booking_profile import TeamMemberBookingProfile import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member_booking_profile import TeamMemberBookingProfile +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTeamMemberBookingProfileResponse(UncheckedBaseModel): diff --git a/src/square/types/get_team_member_request.py b/src/square/types/get_team_member_request.py index 41b8fcf1..0735139b 100644 --- a/src/square/types/get_team_member_request.py +++ b/src/square/types/get_team_member_request.py @@ -2,4 +2,4 @@ import typing -GetTeamMemberRequest = typing.Any +GetTeamMemberRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_team_member_response.py b/src/square/types/get_team_member_response.py index 72958031..e9b8609c 100644 --- a/src/square/types/get_team_member_response.py +++ b/src/square/types/get_team_member_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member import TeamMember +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTeamMemberResponse(UncheckedBaseModel): diff --git a/src/square/types/get_team_member_wage_response.py b/src/square/types/get_team_member_wage_response.py index 885da26b..295ab058 100644 --- a/src/square/types/get_team_member_wage_response.py +++ b/src/square/types/get_team_member_wage_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member_wage import TeamMemberWage import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member_wage import TeamMemberWage +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTeamMemberWageResponse(UncheckedBaseModel): diff --git a/src/square/types/get_terminal_action_response.py b/src/square/types/get_terminal_action_response.py index 89438e58..d7a18e74 100644 --- a/src/square/types/get_terminal_action_response.py +++ b/src/square/types/get_terminal_action_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_action import TerminalAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTerminalActionResponse(UncheckedBaseModel): diff --git a/src/square/types/get_terminal_checkout_response.py b/src/square/types/get_terminal_checkout_response.py index 8f490965..636c923d 100644 --- a/src/square/types/get_terminal_checkout_response.py +++ b/src/square/types/get_terminal_checkout_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_checkout import TerminalCheckout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTerminalCheckoutResponse(UncheckedBaseModel): diff --git a/src/square/types/get_terminal_refund_response.py b/src/square/types/get_terminal_refund_response.py index b32b5d0d..5f3d0bc7 100644 --- a/src/square/types/get_terminal_refund_response.py +++ b/src/square/types/get_terminal_refund_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_refund import TerminalRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTerminalRefundResponse(UncheckedBaseModel): diff --git a/src/square/types/get_transaction_request.py b/src/square/types/get_transaction_request.py index 06c29bef..ae881606 100644 --- a/src/square/types/get_transaction_request.py +++ b/src/square/types/get_transaction_request.py @@ -2,4 +2,4 @@ import typing -GetTransactionRequest = typing.Any +GetTransactionRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_transaction_response.py b/src/square/types/get_transaction_response.py index fef6cd76..88e1dd3b 100644 --- a/src/square/types/get_transaction_response.py +++ b/src/square/types/get_transaction_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .transaction import Transaction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetTransactionResponse(UncheckedBaseModel): diff --git a/src/square/types/get_vendor_request.py b/src/square/types/get_vendor_request.py index e6864ab9..fb1e92df 100644 --- a/src/square/types/get_vendor_request.py +++ b/src/square/types/get_vendor_request.py @@ -2,4 +2,4 @@ import typing -GetVendorRequest = typing.Any +GetVendorRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_vendor_response.py b/src/square/types/get_vendor_response.py index 2bbad87c..96219b9c 100644 --- a/src/square/types/get_vendor_response.py +++ b/src/square/types/get_vendor_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .vendor import Vendor +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetVendorResponse(UncheckedBaseModel): diff --git a/src/square/types/get_wage_setting_request.py b/src/square/types/get_wage_setting_request.py index 32607311..c3fe3429 100644 --- a/src/square/types/get_wage_setting_request.py +++ b/src/square/types/get_wage_setting_request.py @@ -2,4 +2,4 @@ import typing -GetWageSettingRequest = typing.Any +GetWageSettingRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_wage_setting_response.py b/src/square/types/get_wage_setting_response.py index ee7ac012..4ad8e5bc 100644 --- a/src/square/types/get_wage_setting_response.py +++ b/src/square/types/get_wage_setting_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .wage_setting import WageSetting import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .wage_setting import WageSetting +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetWageSettingResponse(UncheckedBaseModel): diff --git a/src/square/types/get_webhook_subscription_request.py b/src/square/types/get_webhook_subscription_request.py index b5a574d8..f36ccd35 100644 --- a/src/square/types/get_webhook_subscription_request.py +++ b/src/square/types/get_webhook_subscription_request.py @@ -2,4 +2,4 @@ import typing -GetWebhookSubscriptionRequest = typing.Any +GetWebhookSubscriptionRequest = typing.Optional[typing.Any] diff --git a/src/square/types/get_webhook_subscription_response.py b/src/square/types/get_webhook_subscription_response.py index c05d9cf5..c390b7e3 100644 --- a/src/square/types/get_webhook_subscription_response.py +++ b/src/square/types/get_webhook_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .webhook_subscription import WebhookSubscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GetWebhookSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/gift_card.py b/src/square/types/gift_card.py index 1b19a2e8..3d72e7b8 100644 --- a/src/square/types/gift_card.py +++ b/src/square/types/gift_card.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .gift_card_type import GiftCardType from .gift_card_gan_source import GiftCardGanSource from .gift_card_status import GiftCardStatus -from .gift_card_type import GiftCardType from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCard(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity.py b/src/square/types/gift_card_activity.py index 48e89983..38045f4a 100644 --- a/src/square/types/gift_card_activity.py +++ b/src/square/types/gift_card_activity.py @@ -1,27 +1,26 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .gift_card_activity_type import GiftCardActivityType +from .money import Money +from .gift_card_activity_load import GiftCardActivityLoad from .gift_card_activity_activate import GiftCardActivityActivate -from .gift_card_activity_adjust_decrement import GiftCardActivityAdjustDecrement -from .gift_card_activity_adjust_increment import GiftCardActivityAdjustIncrement -from .gift_card_activity_block import GiftCardActivityBlock +from .gift_card_activity_redeem import GiftCardActivityRedeem from .gift_card_activity_clear_balance import GiftCardActivityClearBalance from .gift_card_activity_deactivate import GiftCardActivityDeactivate +from .gift_card_activity_adjust_increment import GiftCardActivityAdjustIncrement +from .gift_card_activity_adjust_decrement import GiftCardActivityAdjustDecrement +from .gift_card_activity_refund import GiftCardActivityRefund +from .gift_card_activity_unlinked_activity_refund import GiftCardActivityUnlinkedActivityRefund from .gift_card_activity_import import GiftCardActivityImport +from .gift_card_activity_block import GiftCardActivityBlock +from .gift_card_activity_unblock import GiftCardActivityUnblock from .gift_card_activity_import_reversal import GiftCardActivityImportReversal -from .gift_card_activity_load import GiftCardActivityLoad -from .gift_card_activity_redeem import GiftCardActivityRedeem -from .gift_card_activity_refund import GiftCardActivityRefund -from .gift_card_activity_transfer_balance_from import GiftCardActivityTransferBalanceFrom from .gift_card_activity_transfer_balance_to import GiftCardActivityTransferBalanceTo -from .gift_card_activity_type import GiftCardActivityType -from .gift_card_activity_unblock import GiftCardActivityUnblock -from .gift_card_activity_unlinked_activity_refund import GiftCardActivityUnlinkedActivityRefund -from .money import Money +from .gift_card_activity_transfer_balance_from import GiftCardActivityTransferBalanceFrom +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivity(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_activate.py b/src/square/types/gift_card_activity_activate.py index 17eb514e..d147daf0 100644 --- a/src/square/types/gift_card_activity_activate.py +++ b/src/square/types/gift_card_activity_activate.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .money import Money import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money class GiftCardActivityActivate(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_adjust_decrement.py b/src/square/types/gift_card_activity_adjust_decrement.py index 64b2891d..340baee2 100644 --- a/src/square/types/gift_card_activity_adjust_decrement.py +++ b/src/square/types/gift_card_activity_adjust_decrement.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card_activity_adjust_decrement_reason import GiftCardActivityAdjustDecrementReason from .money import Money +import pydantic +from .gift_card_activity_adjust_decrement_reason import GiftCardActivityAdjustDecrementReason +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityAdjustDecrement(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_adjust_increment.py b/src/square/types/gift_card_activity_adjust_increment.py index 6b3468c0..e24b7ecd 100644 --- a/src/square/types/gift_card_activity_adjust_increment.py +++ b/src/square/types/gift_card_activity_adjust_increment.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card_activity_adjust_increment_reason import GiftCardActivityAdjustIncrementReason from .money import Money +import pydantic +from .gift_card_activity_adjust_increment_reason import GiftCardActivityAdjustIncrementReason +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityAdjustIncrement(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_block.py b/src/square/types/gift_card_activity_block.py index e392e569..6e737f9a 100644 --- a/src/square/types/gift_card_activity_block.py +++ b/src/square/types/gift_card_activity_block.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_block_reason import GiftCardActivityBlockReason +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityBlock(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_clear_balance.py b/src/square/types/gift_card_activity_clear_balance.py index ec7c63bf..a833872e 100644 --- a/src/square/types/gift_card_activity_clear_balance.py +++ b/src/square/types/gift_card_activity_clear_balance.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_clear_balance_reason import GiftCardActivityClearBalanceReason +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityClearBalance(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_created_event.py b/src/square/types/gift_card_activity_created_event.py index 68bca0ae..6dbda1cb 100644 --- a/src/square/types/gift_card_activity_created_event.py +++ b/src/square/types/gift_card_activity_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_created_event_data import GiftCardActivityCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_created_event_data.py b/src/square/types/gift_card_activity_created_event_data.py index 35e23e07..30065635 100644 --- a/src/square/types/gift_card_activity_created_event_data.py +++ b/src/square/types/gift_card_activity_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_created_event_object import GiftCardActivityCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_created_event_object.py b/src/square/types/gift_card_activity_created_event_object.py index 8de1921c..aeabd68d 100644 --- a/src/square/types/gift_card_activity_created_event_object.py +++ b/src/square/types/gift_card_activity_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .gift_card_activity import GiftCardActivity import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card_activity import GiftCardActivity class GiftCardActivityCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_deactivate.py b/src/square/types/gift_card_activity_deactivate.py index bc290906..230aed4c 100644 --- a/src/square/types/gift_card_activity_deactivate.py +++ b/src/square/types/gift_card_activity_deactivate.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_deactivate_reason import GiftCardActivityDeactivateReason +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityDeactivate(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_import.py b/src/square/types/gift_card_activity_import.py index 1f144cd3..9b543d4e 100644 --- a/src/square/types/gift_card_activity_import.py +++ b/src/square/types/gift_card_activity_import.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityImport(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_import_reversal.py b/src/square/types/gift_card_activity_import_reversal.py index 59e7a9b2..ed8311f7 100644 --- a/src/square/types/gift_card_activity_import_reversal.py +++ b/src/square/types/gift_card_activity_import_reversal.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityImportReversal(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_load.py b/src/square/types/gift_card_activity_load.py index aaf1ed1b..e6411661 100644 --- a/src/square/types/gift_card_activity_load.py +++ b/src/square/types/gift_card_activity_load.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .money import Money import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money class GiftCardActivityLoad(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_redeem.py b/src/square/types/gift_card_activity_redeem.py index 47f1019f..b73653f6 100644 --- a/src/square/types/gift_card_activity_redeem.py +++ b/src/square/types/gift_card_activity_redeem.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card_activity_redeem_status import GiftCardActivityRedeemStatus from .money import Money +import pydantic +import typing +from .gift_card_activity_redeem_status import GiftCardActivityRedeemStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityRedeem(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_refund.py b/src/square/types/gift_card_activity_refund.py index 1a251cd6..c7a30d54 100644 --- a/src/square/types/gift_card_activity_refund.py +++ b/src/square/types/gift_card_activity_refund.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityRefund(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_transfer_balance_from.py b/src/square/types/gift_card_activity_transfer_balance_from.py index 9ee41f35..2afe4379 100644 --- a/src/square/types/gift_card_activity_transfer_balance_from.py +++ b/src/square/types/gift_card_activity_transfer_balance_from.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityTransferBalanceFrom(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_transfer_balance_to.py b/src/square/types/gift_card_activity_transfer_balance_to.py index 36eba2c1..63b061a5 100644 --- a/src/square/types/gift_card_activity_transfer_balance_to.py +++ b/src/square/types/gift_card_activity_transfer_balance_to.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityTransferBalanceTo(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_unblock.py b/src/square/types/gift_card_activity_unblock.py index 7656c4bc..84c0ed0a 100644 --- a/src/square/types/gift_card_activity_unblock.py +++ b/src/square/types/gift_card_activity_unblock.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_unblock_reason import GiftCardActivityUnblockReason +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class GiftCardActivityUnblock(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_unlinked_activity_refund.py b/src/square/types/gift_card_activity_unlinked_activity_refund.py index 9ae68f5a..c7a6c5fa 100644 --- a/src/square/types/gift_card_activity_unlinked_activity_refund.py +++ b/src/square/types/gift_card_activity_unlinked_activity_refund.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityUnlinkedActivityRefund(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_updated_event.py b/src/square/types/gift_card_activity_updated_event.py index 166cd4d4..16ffbb0a 100644 --- a/src/square/types/gift_card_activity_updated_event.py +++ b/src/square/types/gift_card_activity_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_updated_event_data import GiftCardActivityUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_updated_event_data.py b/src/square/types/gift_card_activity_updated_event_data.py index d513e19c..510b10ed 100644 --- a/src/square/types/gift_card_activity_updated_event_data.py +++ b/src/square/types/gift_card_activity_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_activity_updated_event_object import GiftCardActivityUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardActivityUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/gift_card_activity_updated_event_object.py b/src/square/types/gift_card_activity_updated_event_object.py index cab7586f..9f4c6edf 100644 --- a/src/square/types/gift_card_activity_updated_event_object.py +++ b/src/square/types/gift_card_activity_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .gift_card_activity import GiftCardActivity import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card_activity import GiftCardActivity class GiftCardActivityUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/gift_card_created_event.py b/src/square/types/gift_card_created_event.py index 983c92a7..728d2e96 100644 --- a/src/square/types/gift_card_created_event.py +++ b/src/square/types/gift_card_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_created_event_data import GiftCardCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/gift_card_created_event_data.py b/src/square/types/gift_card_created_event_data.py index 56dfb7df..0472e556 100644 --- a/src/square/types/gift_card_created_event_data.py +++ b/src/square/types/gift_card_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_created_event_object import GiftCardCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/gift_card_created_event_object.py b/src/square/types/gift_card_created_event_object.py index d86dfc11..508e5e40 100644 --- a/src/square/types/gift_card_created_event_object.py +++ b/src/square/types/gift_card_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .gift_card import GiftCard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card import GiftCard class GiftCardCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/gift_card_customer_linked_event.py b/src/square/types/gift_card_customer_linked_event.py index 4cb250e8..5e34ebd6 100644 --- a/src/square/types/gift_card_customer_linked_event.py +++ b/src/square/types/gift_card_customer_linked_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_customer_linked_event_data import GiftCardCustomerLinkedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardCustomerLinkedEvent(UncheckedBaseModel): diff --git a/src/square/types/gift_card_customer_linked_event_data.py b/src/square/types/gift_card_customer_linked_event_data.py index 0427fe4f..9a095b76 100644 --- a/src/square/types/gift_card_customer_linked_event_data.py +++ b/src/square/types/gift_card_customer_linked_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_customer_linked_event_object import GiftCardCustomerLinkedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardCustomerLinkedEventData(UncheckedBaseModel): diff --git a/src/square/types/gift_card_customer_linked_event_object.py b/src/square/types/gift_card_customer_linked_event_object.py index dfbe7480..ee408d51 100644 --- a/src/square/types/gift_card_customer_linked_event_object.py +++ b/src/square/types/gift_card_customer_linked_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .gift_card import GiftCard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card import GiftCard class GiftCardCustomerLinkedEventObject(UncheckedBaseModel): diff --git a/src/square/types/gift_card_customer_unlinked_event.py b/src/square/types/gift_card_customer_unlinked_event.py index 16e5bf57..228641ba 100644 --- a/src/square/types/gift_card_customer_unlinked_event.py +++ b/src/square/types/gift_card_customer_unlinked_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_customer_unlinked_event_data import GiftCardCustomerUnlinkedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardCustomerUnlinkedEvent(UncheckedBaseModel): diff --git a/src/square/types/gift_card_customer_unlinked_event_data.py b/src/square/types/gift_card_customer_unlinked_event_data.py index 02a0fe06..fc7a0dc0 100644 --- a/src/square/types/gift_card_customer_unlinked_event_data.py +++ b/src/square/types/gift_card_customer_unlinked_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_customer_unlinked_event_object import GiftCardCustomerUnlinkedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardCustomerUnlinkedEventData(UncheckedBaseModel): diff --git a/src/square/types/gift_card_customer_unlinked_event_object.py b/src/square/types/gift_card_customer_unlinked_event_object.py index 579f99b0..02938d65 100644 --- a/src/square/types/gift_card_customer_unlinked_event_object.py +++ b/src/square/types/gift_card_customer_unlinked_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .gift_card import GiftCard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card import GiftCard class GiftCardCustomerUnlinkedEventObject(UncheckedBaseModel): diff --git a/src/square/types/gift_card_updated_event.py b/src/square/types/gift_card_updated_event.py index ff62ab28..3b694535 100644 --- a/src/square/types/gift_card_updated_event.py +++ b/src/square/types/gift_card_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_updated_event_data import GiftCardUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/gift_card_updated_event_data.py b/src/square/types/gift_card_updated_event_data.py index a3d45414..8fe0befb 100644 --- a/src/square/types/gift_card_updated_event_data.py +++ b/src/square/types/gift_card_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .gift_card_updated_event_object import GiftCardUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class GiftCardUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/gift_card_updated_event_object.py b/src/square/types/gift_card_updated_event_object.py index a2d90ee3..12bd3a2b 100644 --- a/src/square/types/gift_card_updated_event_object.py +++ b/src/square/types/gift_card_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .gift_card import GiftCard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .gift_card import GiftCard class GiftCardUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/inventory_adjustment.py b/src/square/types/inventory_adjustment.py index 971d171d..5ae6f905 100644 --- a/src/square/types/inventory_adjustment.py +++ b/src/square/types/inventory_adjustment.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .inventory_adjustment_group import InventoryAdjustmentGroup from .inventory_state import InventoryState from .money import Money from .source_application import SourceApplication +from .inventory_adjustment_group import InventoryAdjustmentGroup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryAdjustment(UncheckedBaseModel): diff --git a/src/square/types/inventory_adjustment_group.py b/src/square/types/inventory_adjustment_group.py index a78346fe..802d1e99 100644 --- a/src/square/types/inventory_adjustment_group.py +++ b/src/square/types/inventory_adjustment_group.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_state import InventoryState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryAdjustmentGroup(UncheckedBaseModel): diff --git a/src/square/types/inventory_change.py b/src/square/types/inventory_change.py index 4a66c495..4094263b 100644 --- a/src/square/types/inventory_change.py +++ b/src/square/types/inventory_change.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .catalog_measurement_unit import CatalogMeasurementUnit -from .inventory_adjustment import InventoryAdjustment +import typing from .inventory_change_type import InventoryChangeType +import pydantic from .inventory_physical_count import InventoryPhysicalCount +from .inventory_adjustment import InventoryAdjustment from .inventory_transfer import InventoryTransfer +from .catalog_measurement_unit import CatalogMeasurementUnit +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryChange(UncheckedBaseModel): diff --git a/src/square/types/inventory_count.py b/src/square/types/inventory_count.py index f7f48859..64787e4f 100644 --- a/src/square/types/inventory_count.py +++ b/src/square/types/inventory_count.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_state import InventoryState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryCount(UncheckedBaseModel): diff --git a/src/square/types/inventory_count_updated_event.py b/src/square/types/inventory_count_updated_event.py index b086f1aa..719b2ead 100644 --- a/src/square/types/inventory_count_updated_event.py +++ b/src/square/types/inventory_count_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_count_updated_event_data import InventoryCountUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryCountUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/inventory_count_updated_event_data.py b/src/square/types/inventory_count_updated_event_data.py index 9f82e78f..33a0fc31 100644 --- a/src/square/types/inventory_count_updated_event_data.py +++ b/src/square/types/inventory_count_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_count_updated_event_object import InventoryCountUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryCountUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/inventory_count_updated_event_object.py b/src/square/types/inventory_count_updated_event_object.py index 6037dd71..26e138f1 100644 --- a/src/square/types/inventory_count_updated_event_object.py +++ b/src/square/types/inventory_count_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .inventory_count import InventoryCount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .inventory_count import InventoryCount class InventoryCountUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/inventory_physical_count.py b/src/square/types/inventory_physical_count.py index 20bb2cf7..652e6032 100644 --- a/src/square/types/inventory_physical_count.py +++ b/src/square/types/inventory_physical_count.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_state import InventoryState from .source_application import SourceApplication +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryPhysicalCount(UncheckedBaseModel): diff --git a/src/square/types/inventory_transfer.py b/src/square/types/inventory_transfer.py index 6dd5c25f..a3940e59 100644 --- a/src/square/types/inventory_transfer.py +++ b/src/square/types/inventory_transfer.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .inventory_state import InventoryState from .source_application import SourceApplication +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InventoryTransfer(UncheckedBaseModel): diff --git a/src/square/types/invoice.py b/src/square/types/invoice.py index 0d58ca08..63c27a58 100644 --- a/src/square/types/invoice.py +++ b/src/square/types/invoice.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice_accepted_payment_methods import InvoiceAcceptedPaymentMethods -from .invoice_attachment import InvoiceAttachment -from .invoice_custom_field import InvoiceCustomField -from .invoice_delivery_method import InvoiceDeliveryMethod -from .invoice_payment_request import InvoicePaymentRequest from .invoice_recipient import InvoiceRecipient -from .invoice_status import InvoiceStatus +from .invoice_payment_request import InvoicePaymentRequest +from .invoice_delivery_method import InvoiceDeliveryMethod from .money import Money +from .invoice_status import InvoiceStatus +from .invoice_accepted_payment_methods import InvoiceAcceptedPaymentMethods +from .invoice_custom_field import InvoiceCustomField +from .invoice_attachment import InvoiceAttachment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Invoice(UncheckedBaseModel): @@ -142,8 +141,8 @@ class Invoice(UncheckedBaseModel): When an invoice is created, this field is set to the `timezone` specified for the seller location. The value cannot be changed. - For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\\_Angeles - becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp + For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles + becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/types/invoice_accepted_payment_methods.py b/src/square/types/invoice_accepted_payment_methods.py index a4ffed06..70f802cc 100644 --- a/src/square/types/invoice_accepted_payment_methods.py +++ b/src/square/types/invoice_accepted_payment_methods.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class InvoiceAcceptedPaymentMethods(UncheckedBaseModel): diff --git a/src/square/types/invoice_attachment.py b/src/square/types/invoice_attachment.py index 5bb640ad..4c713cdc 100644 --- a/src/square/types/invoice_attachment.py +++ b/src/square/types/invoice_attachment.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class InvoiceAttachment(UncheckedBaseModel): diff --git a/src/square/types/invoice_canceled_event.py b/src/square/types/invoice_canceled_event.py index 2db2953f..1f9aa0e0 100644 --- a/src/square/types/invoice_canceled_event.py +++ b/src/square/types/invoice_canceled_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_canceled_event_data import InvoiceCanceledEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceCanceledEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_canceled_event_data.py b/src/square/types/invoice_canceled_event_data.py index 9eb1b406..2e5164a3 100644 --- a/src/square/types/invoice_canceled_event_data.py +++ b/src/square/types/invoice_canceled_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_canceled_event_object import InvoiceCanceledEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceCanceledEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_canceled_event_object.py b/src/square/types/invoice_canceled_event_object.py index 79a6bca3..962e4350 100644 --- a/src/square/types/invoice_canceled_event_object.py +++ b/src/square/types/invoice_canceled_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoiceCanceledEventObject(UncheckedBaseModel): diff --git a/src/square/types/invoice_created_event.py b/src/square/types/invoice_created_event.py index 172f9afa..afb5ff95 100644 --- a/src/square/types/invoice_created_event.py +++ b/src/square/types/invoice_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_created_event_data import InvoiceCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_created_event_data.py b/src/square/types/invoice_created_event_data.py index e0dfdce8..616949e3 100644 --- a/src/square/types/invoice_created_event_data.py +++ b/src/square/types/invoice_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_created_event_object import InvoiceCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_created_event_object.py b/src/square/types/invoice_created_event_object.py index 3de4a95c..c7512ba9 100644 --- a/src/square/types/invoice_created_event_object.py +++ b/src/square/types/invoice_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoiceCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/invoice_custom_field.py b/src/square/types/invoice_custom_field.py index 32f89302..bd6c7f1f 100644 --- a/src/square/types/invoice_custom_field.py +++ b/src/square/types/invoice_custom_field.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_custom_field_placement import InvoiceCustomFieldPlacement +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceCustomField(UncheckedBaseModel): diff --git a/src/square/types/invoice_deleted_event.py b/src/square/types/invoice_deleted_event.py index 8339b17e..e553d8ae 100644 --- a/src/square/types/invoice_deleted_event.py +++ b/src/square/types/invoice_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_deleted_event_data import InvoiceDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_deleted_event_data.py b/src/square/types/invoice_deleted_event_data.py index 12eaf07b..f7ef3f07 100644 --- a/src/square/types/invoice_deleted_event_data.py +++ b/src/square/types/invoice_deleted_event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class InvoiceDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_filter.py b/src/square/types/invoice_filter.py index fdce9087..2af926a7 100644 --- a/src/square/types/invoice_filter.py +++ b/src/square/types/invoice_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class InvoiceFilter(UncheckedBaseModel): diff --git a/src/square/types/invoice_payment_made_event.py b/src/square/types/invoice_payment_made_event.py index bdadbc1b..52a3ae96 100644 --- a/src/square/types/invoice_payment_made_event.py +++ b/src/square/types/invoice_payment_made_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_payment_made_event_data import InvoicePaymentMadeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoicePaymentMadeEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_payment_made_event_data.py b/src/square/types/invoice_payment_made_event_data.py index ebe4737c..c638c291 100644 --- a/src/square/types/invoice_payment_made_event_data.py +++ b/src/square/types/invoice_payment_made_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_payment_made_event_object import InvoicePaymentMadeEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoicePaymentMadeEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_payment_made_event_object.py b/src/square/types/invoice_payment_made_event_object.py index a66c63c8..7dba859e 100644 --- a/src/square/types/invoice_payment_made_event_object.py +++ b/src/square/types/invoice_payment_made_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoicePaymentMadeEventObject(UncheckedBaseModel): diff --git a/src/square/types/invoice_payment_reminder.py b/src/square/types/invoice_payment_reminder.py index 94a7b4aa..202923da 100644 --- a/src/square/types/invoice_payment_reminder.py +++ b/src/square/types/invoice_payment_reminder.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_payment_reminder_status import InvoicePaymentReminderStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoicePaymentReminder(UncheckedBaseModel): diff --git a/src/square/types/invoice_payment_request.py b/src/square/types/invoice_payment_request.py index 4008b50a..d22ef8a2 100644 --- a/src/square/types/invoice_payment_request.py +++ b/src/square/types/invoice_payment_request.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice_automatic_payment_source import InvoiceAutomaticPaymentSource -from .invoice_payment_reminder import InvoicePaymentReminder from .invoice_request_method import InvoiceRequestMethod from .invoice_request_type import InvoiceRequestType from .money import Money +from .invoice_automatic_payment_source import InvoiceAutomaticPaymentSource +from .invoice_payment_reminder import InvoicePaymentReminder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoicePaymentRequest(UncheckedBaseModel): @@ -53,7 +52,7 @@ class InvoicePaymentRequest(UncheckedBaseModel): charges the payment source on this date. After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone` - of America/Los\\_Angeles becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC + of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/types/invoice_published_event.py b/src/square/types/invoice_published_event.py index 8b98d5b9..0b0f5f09 100644 --- a/src/square/types/invoice_published_event.py +++ b/src/square/types/invoice_published_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_published_event_data import InvoicePublishedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoicePublishedEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_published_event_data.py b/src/square/types/invoice_published_event_data.py index 63aa5d1d..780eabf5 100644 --- a/src/square/types/invoice_published_event_data.py +++ b/src/square/types/invoice_published_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_published_event_object import InvoicePublishedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoicePublishedEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_published_event_object.py b/src/square/types/invoice_published_event_object.py index bd45b970..a5e8a19b 100644 --- a/src/square/types/invoice_published_event_object.py +++ b/src/square/types/invoice_published_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoicePublishedEventObject(UncheckedBaseModel): diff --git a/src/square/types/invoice_query.py b/src/square/types/invoice_query.py index f155922d..66991301 100644 --- a/src/square/types/invoice_query.py +++ b/src/square/types/invoice_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_filter import InvoiceFilter +import pydantic +import typing from .invoice_sort import InvoiceSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceQuery(UncheckedBaseModel): diff --git a/src/square/types/invoice_recipient.py b/src/square/types/invoice_recipient.py index 00c71f7d..3a72894b 100644 --- a/src/square/types/invoice_recipient.py +++ b/src/square/types/invoice_recipient.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address from .invoice_recipient_tax_ids import InvoiceRecipientTaxIds +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceRecipient(UncheckedBaseModel): diff --git a/src/square/types/invoice_recipient_tax_ids.py b/src/square/types/invoice_recipient_tax_ids.py index 1c9d5943..3ea5eb44 100644 --- a/src/square/types/invoice_recipient_tax_ids.py +++ b/src/square/types/invoice_recipient_tax_ids.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class InvoiceRecipientTaxIds(UncheckedBaseModel): diff --git a/src/square/types/invoice_refunded_event.py b/src/square/types/invoice_refunded_event.py index 71a415e6..e37cc9ad 100644 --- a/src/square/types/invoice_refunded_event.py +++ b/src/square/types/invoice_refunded_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_refunded_event_data import InvoiceRefundedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceRefundedEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_refunded_event_data.py b/src/square/types/invoice_refunded_event_data.py index 3d649954..3c442b5d 100644 --- a/src/square/types/invoice_refunded_event_data.py +++ b/src/square/types/invoice_refunded_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_refunded_event_object import InvoiceRefundedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceRefundedEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_refunded_event_object.py b/src/square/types/invoice_refunded_event_object.py index 6070ba6a..181f8eb5 100644 --- a/src/square/types/invoice_refunded_event_object.py +++ b/src/square/types/invoice_refunded_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoiceRefundedEventObject(UncheckedBaseModel): diff --git a/src/square/types/invoice_scheduled_charge_failed_event.py b/src/square/types/invoice_scheduled_charge_failed_event.py index 47f6987e..046fc104 100644 --- a/src/square/types/invoice_scheduled_charge_failed_event.py +++ b/src/square/types/invoice_scheduled_charge_failed_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_scheduled_charge_failed_event_data import InvoiceScheduledChargeFailedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceScheduledChargeFailedEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_scheduled_charge_failed_event_data.py b/src/square/types/invoice_scheduled_charge_failed_event_data.py index ff0132e0..816907d4 100644 --- a/src/square/types/invoice_scheduled_charge_failed_event_data.py +++ b/src/square/types/invoice_scheduled_charge_failed_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_scheduled_charge_failed_event_object import InvoiceScheduledChargeFailedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceScheduledChargeFailedEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_scheduled_charge_failed_event_object.py b/src/square/types/invoice_scheduled_charge_failed_event_object.py index 75965e89..15b8067a 100644 --- a/src/square/types/invoice_scheduled_charge_failed_event_object.py +++ b/src/square/types/invoice_scheduled_charge_failed_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoiceScheduledChargeFailedEventObject(UncheckedBaseModel): diff --git a/src/square/types/invoice_sort.py b/src/square/types/invoice_sort.py index 34dcb583..3277f29b 100644 --- a/src/square/types/invoice_sort.py +++ b/src/square/types/invoice_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_sort_field import InvoiceSortField +import pydantic +import typing from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceSort(UncheckedBaseModel): diff --git a/src/square/types/invoice_updated_event.py b/src/square/types/invoice_updated_event.py index 1a8ec55a..e7e7a535 100644 --- a/src/square/types/invoice_updated_event.py +++ b/src/square/types/invoice_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_updated_event_data import InvoiceUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/invoice_updated_event_data.py b/src/square/types/invoice_updated_event_data.py index 8e59a4a4..2a3a08bb 100644 --- a/src/square/types/invoice_updated_event_data.py +++ b/src/square/types/invoice_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .invoice_updated_event_object import InvoiceUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class InvoiceUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/invoice_updated_event_object.py b/src/square/types/invoice_updated_event_object.py index a956adc3..615c1feb 100644 --- a/src/square/types/invoice_updated_event_object.py +++ b/src/square/types/invoice_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .invoice import Invoice class InvoiceUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/item_variation_location_overrides.py b/src/square/types/item_variation_location_overrides.py index 24d01cde..d2769aa2 100644 --- a/src/square/types/item_variation_location_overrides.py +++ b/src/square/types/item_variation_location_overrides.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .money import Money from .catalog_pricing_type import CatalogPricingType from .inventory_alert_type import InventoryAlertType -from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ItemVariationLocationOverrides(UncheckedBaseModel): diff --git a/src/square/types/job.py b/src/square/types/job.py index c82bc4a7..44daea28 100644 --- a/src/square/types/job.py +++ b/src/square/types/job.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Job(UncheckedBaseModel): diff --git a/src/square/types/job_assignment.py b/src/square/types/job_assignment.py index c822c688..2e7d5c55 100644 --- a/src/square/types/job_assignment.py +++ b/src/square/types/job_assignment.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .job_assignment_pay_type import JobAssignmentPayType from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class JobAssignment(UncheckedBaseModel): diff --git a/src/square/types/job_created_event.py b/src/square/types/job_created_event.py index c5274053..3aa6d7e8 100644 --- a/src/square/types/job_created_event.py +++ b/src/square/types/job_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .job_created_event_data import JobCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class JobCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/job_created_event_data.py b/src/square/types/job_created_event_data.py index b007b211..e396b6b4 100644 --- a/src/square/types/job_created_event_data.py +++ b/src/square/types/job_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .job_created_event_object import JobCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class JobCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/job_created_event_object.py b/src/square/types/job_created_event_object.py index a735b4d9..6214b7af 100644 --- a/src/square/types/job_created_event_object.py +++ b/src/square/types/job_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .job import Job import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .job import Job class JobCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/job_updated_event.py b/src/square/types/job_updated_event.py index f48c5763..e597f78f 100644 --- a/src/square/types/job_updated_event.py +++ b/src/square/types/job_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .job_updated_event_data import JobUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class JobUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/job_updated_event_data.py b/src/square/types/job_updated_event_data.py index c6ae68c0..c5fd543c 100644 --- a/src/square/types/job_updated_event_data.py +++ b/src/square/types/job_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .job_updated_event_object import JobUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class JobUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/job_updated_event_object.py b/src/square/types/job_updated_event_object.py index d6f5725b..5a7355ee 100644 --- a/src/square/types/job_updated_event_object.py +++ b/src/square/types/job_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .job import Job import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .job import Job class JobUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_created_event.py b/src/square/types/labor_scheduled_shift_created_event.py index 70cf8998..55bf3e9a 100644 --- a/src/square/types/labor_scheduled_shift_created_event.py +++ b/src/square/types/labor_scheduled_shift_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_created_event_data import LaborScheduledShiftCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_created_event_data.py b/src/square/types/labor_scheduled_shift_created_event_data.py index 8064b29c..14c52ae0 100644 --- a/src/square/types/labor_scheduled_shift_created_event_data.py +++ b/src/square/types/labor_scheduled_shift_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_created_event_object import LaborScheduledShiftCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_created_event_object.py b/src/square/types/labor_scheduled_shift_created_event_object.py index 4e77f28c..92b7fa82 100644 --- a/src/square/types/labor_scheduled_shift_created_event_object.py +++ b/src/square/types/labor_scheduled_shift_created_event_object.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing - +from .scheduled_shift import ScheduledShift +from ..core.serialization import FieldMetadata import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .scheduled_shift import ScheduledShift class LaborScheduledShiftCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_deleted_event.py b/src/square/types/labor_scheduled_shift_deleted_event.py index 5d4a71a2..6c3519aa 100644 --- a/src/square/types/labor_scheduled_shift_deleted_event.py +++ b/src/square/types/labor_scheduled_shift_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_deleted_event_data import LaborScheduledShiftDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_deleted_event_data.py b/src/square/types/labor_scheduled_shift_deleted_event_data.py index 47b86951..07fcce72 100644 --- a/src/square/types/labor_scheduled_shift_deleted_event_data.py +++ b/src/square/types/labor_scheduled_shift_deleted_event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LaborScheduledShiftDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_published_event.py b/src/square/types/labor_scheduled_shift_published_event.py index d222966b..f6778219 100644 --- a/src/square/types/labor_scheduled_shift_published_event.py +++ b/src/square/types/labor_scheduled_shift_published_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_published_event_data import LaborScheduledShiftPublishedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftPublishedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_published_event_data.py b/src/square/types/labor_scheduled_shift_published_event_data.py index f4e15fea..0a3de8b5 100644 --- a/src/square/types/labor_scheduled_shift_published_event_data.py +++ b/src/square/types/labor_scheduled_shift_published_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_published_event_object import LaborScheduledShiftPublishedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftPublishedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_published_event_object.py b/src/square/types/labor_scheduled_shift_published_event_object.py index 7937baac..f5ae3c17 100644 --- a/src/square/types/labor_scheduled_shift_published_event_object.py +++ b/src/square/types/labor_scheduled_shift_published_event_object.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing - +from .scheduled_shift import ScheduledShift +from ..core.serialization import FieldMetadata import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .scheduled_shift import ScheduledShift class LaborScheduledShiftPublishedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_updated_event.py b/src/square/types/labor_scheduled_shift_updated_event.py index 1a67cdbb..852a11b3 100644 --- a/src/square/types/labor_scheduled_shift_updated_event.py +++ b/src/square/types/labor_scheduled_shift_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_updated_event_data import LaborScheduledShiftUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_updated_event_data.py b/src/square/types/labor_scheduled_shift_updated_event_data.py index 330b3cc2..4c2bfc5a 100644 --- a/src/square/types/labor_scheduled_shift_updated_event_data.py +++ b/src/square/types/labor_scheduled_shift_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_scheduled_shift_updated_event_object import LaborScheduledShiftUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborScheduledShiftUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_scheduled_shift_updated_event_object.py b/src/square/types/labor_scheduled_shift_updated_event_object.py index ff8b712a..81001c48 100644 --- a/src/square/types/labor_scheduled_shift_updated_event_object.py +++ b/src/square/types/labor_scheduled_shift_updated_event_object.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing - +from .scheduled_shift import ScheduledShift +from ..core.serialization import FieldMetadata import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .scheduled_shift import ScheduledShift class LaborScheduledShiftUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_created_event.py b/src/square/types/labor_shift_created_event.py index 726af24d..a5e11a86 100644 --- a/src/square/types/labor_shift_created_event.py +++ b/src/square/types/labor_shift_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_shift_created_event_data import LaborShiftCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborShiftCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_created_event_data.py b/src/square/types/labor_shift_created_event_data.py index 8e8db533..712946ca 100644 --- a/src/square/types/labor_shift_created_event_data.py +++ b/src/square/types/labor_shift_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_shift_created_event_object import LaborShiftCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborShiftCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_created_event_object.py b/src/square/types/labor_shift_created_event_object.py index e3d5fc80..0701593b 100644 --- a/src/square/types/labor_shift_created_event_object.py +++ b/src/square/types/labor_shift_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .shift import Shift import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .shift import Shift class LaborShiftCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_deleted_event.py b/src/square/types/labor_shift_deleted_event.py index fa94d134..fa43bb67 100644 --- a/src/square/types/labor_shift_deleted_event.py +++ b/src/square/types/labor_shift_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_shift_deleted_event_data import LaborShiftDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborShiftDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_deleted_event_data.py b/src/square/types/labor_shift_deleted_event_data.py index fb5dfc8e..96ef3c97 100644 --- a/src/square/types/labor_shift_deleted_event_data.py +++ b/src/square/types/labor_shift_deleted_event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LaborShiftDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_updated_event.py b/src/square/types/labor_shift_updated_event.py index 088cce6f..b00fcdf8 100644 --- a/src/square/types/labor_shift_updated_event.py +++ b/src/square/types/labor_shift_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_shift_updated_event_data import LaborShiftUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborShiftUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_updated_event_data.py b/src/square/types/labor_shift_updated_event_data.py index 7897aced..8ed052c6 100644 --- a/src/square/types/labor_shift_updated_event_data.py +++ b/src/square/types/labor_shift_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_shift_updated_event_object import LaborShiftUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborShiftUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_shift_updated_event_object.py b/src/square/types/labor_shift_updated_event_object.py index 9b0cbfb8..4ec08819 100644 --- a/src/square/types/labor_shift_updated_event_object.py +++ b/src/square/types/labor_shift_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .shift import Shift import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .shift import Shift class LaborShiftUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_created_event.py b/src/square/types/labor_timecard_created_event.py index 7676aa0e..732cb859 100644 --- a/src/square/types/labor_timecard_created_event.py +++ b/src/square/types/labor_timecard_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_timecard_created_event_data import LaborTimecardCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborTimecardCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_created_event_data.py b/src/square/types/labor_timecard_created_event_data.py index 29055d57..420585ea 100644 --- a/src/square/types/labor_timecard_created_event_data.py +++ b/src/square/types/labor_timecard_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_timecard_created_event_object import LaborTimecardCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborTimecardCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_created_event_object.py b/src/square/types/labor_timecard_created_event_object.py index 262e0b92..80af7577 100644 --- a/src/square/types/labor_timecard_created_event_object.py +++ b/src/square/types/labor_timecard_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard import Timecard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .timecard import Timecard class LaborTimecardCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_deleted_event.py b/src/square/types/labor_timecard_deleted_event.py index 248417bd..6b5d3c80 100644 --- a/src/square/types/labor_timecard_deleted_event.py +++ b/src/square/types/labor_timecard_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_timecard_deleted_event_data import LaborTimecardDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborTimecardDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_deleted_event_data.py b/src/square/types/labor_timecard_deleted_event_data.py index 990c9718..48a91eba 100644 --- a/src/square/types/labor_timecard_deleted_event_data.py +++ b/src/square/types/labor_timecard_deleted_event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LaborTimecardDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_updated_event.py b/src/square/types/labor_timecard_updated_event.py index 5fb15041..8d8682c6 100644 --- a/src/square/types/labor_timecard_updated_event.py +++ b/src/square/types/labor_timecard_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_timecard_updated_event_data import LaborTimecardUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborTimecardUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_updated_event_data.py b/src/square/types/labor_timecard_updated_event_data.py index e9e1e48d..f23dd64a 100644 --- a/src/square/types/labor_timecard_updated_event_data.py +++ b/src/square/types/labor_timecard_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .labor_timecard_updated_event_object import LaborTimecardUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LaborTimecardUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/labor_timecard_updated_event_object.py b/src/square/types/labor_timecard_updated_event_object.py index f83ea634..e3384001 100644 --- a/src/square/types/labor_timecard_updated_event_object.py +++ b/src/square/types/labor_timecard_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard import Timecard import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .timecard import Timecard class LaborTimecardUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/link_customer_to_gift_card_response.py b/src/square/types/link_customer_to_gift_card_response.py index 5fa2dd67..8127e820 100644 --- a/src/square/types/link_customer_to_gift_card_response.py +++ b/src/square/types/link_customer_to_gift_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LinkCustomerToGiftCardResponse(UncheckedBaseModel): diff --git a/src/square/types/list_bank_accounts_response.py b/src/square/types/list_bank_accounts_response.py index 50e22a50..ca196109 100644 --- a/src/square/types/list_bank_accounts_response.py +++ b/src/square/types/list_bank_accounts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .bank_account import BankAccount -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListBankAccountsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_booking_custom_attribute_definitions_response.py b/src/square/types/list_booking_custom_attribute_definitions_response.py index 66e594f0..45061a9b 100644 --- a/src/square/types/list_booking_custom_attribute_definitions_response.py +++ b/src/square/types/list_booking_custom_attribute_definitions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListBookingCustomAttributeDefinitionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_booking_custom_attributes_response.py b/src/square/types/list_booking_custom_attributes_response.py index 0260598c..98137b11 100644 --- a/src/square/types/list_booking_custom_attributes_response.py +++ b/src/square/types/list_booking_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListBookingCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_bookings_response.py b/src/square/types/list_bookings_response.py index 54d4e916..8eac83c5 100644 --- a/src/square/types/list_bookings_response.py +++ b/src/square/types/list_bookings_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking import Booking +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListBookingsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_break_types_response.py b/src/square/types/list_break_types_response.py index 2758a748..cba654fc 100644 --- a/src/square/types/list_break_types_response.py +++ b/src/square/types/list_break_types_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .break_type import BreakType +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListBreakTypesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_cards_response.py b/src/square/types/list_cards_response.py index 7e397daa..fa29ffa8 100644 --- a/src/square/types/list_cards_response.py +++ b/src/square/types/list_cards_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCardsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_cash_drawer_shift_events_response.py b/src/square/types/list_cash_drawer_shift_events_response.py index 8c262e52..f8cf6951 100644 --- a/src/square/types/list_cash_drawer_shift_events_response.py +++ b/src/square/types/list_cash_drawer_shift_events_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .cash_drawer_shift_event import CashDrawerShiftEvent from .error import Error +from .cash_drawer_shift_event import CashDrawerShiftEvent +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCashDrawerShiftEventsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_cash_drawer_shifts_response.py b/src/square/types/list_cash_drawer_shifts_response.py index 1eb4dac2..aeff136d 100644 --- a/src/square/types/list_cash_drawer_shifts_response.py +++ b/src/square/types/list_cash_drawer_shifts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .cash_drawer_shift_summary import CashDrawerShiftSummary from .error import Error +from .cash_drawer_shift_summary import CashDrawerShiftSummary +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCashDrawerShiftsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_catalog_response.py b/src/square/types/list_catalog_response.py index c9c9e898..371ebc3a 100644 --- a/src/square/types/list_catalog_response.py +++ b/src/square/types/list_catalog_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCatalogResponse(UncheckedBaseModel): @@ -22,7 +30,7 @@ class ListCatalogResponse(UncheckedBaseModel): See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. """ - objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ The CatalogObjects returned. """ @@ -35,18 +43,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - ListCatalogResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/list_channels_request_constants.py b/src/square/types/list_channels_request_constants.py deleted file mode 100644 index c63482b5..00000000 --- a/src/square/types/list_channels_request_constants.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ListChannelsRequestConstants = typing.Literal["MAX_PAGE_SIZE"] diff --git a/src/square/types/list_channels_response.py b/src/square/types/list_channels_response.py deleted file mode 100644 index 939cd62e..00000000 --- a/src/square/types/list_channels_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .channel import Channel -from .error import Error - - -class ListChannelsResponse(UncheckedBaseModel): - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Information about errors encountered during the request. - """ - - channels: typing.Optional[typing.List[Channel]] = pydantic.Field(default=None) - """ - List of requested Channel. - """ - - cursor: typing.Optional[str] = pydantic.Field(default=None) - """ - The token required to retrieve the next page of results. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/list_customer_custom_attribute_definitions_response.py b/src/square/types/list_customer_custom_attribute_definitions_response.py index c7b0d478..33e91745 100644 --- a/src/square/types/list_customer_custom_attribute_definitions_response.py +++ b/src/square/types/list_customer_custom_attribute_definitions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCustomerCustomAttributeDefinitionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_customer_custom_attributes_response.py b/src/square/types/list_customer_custom_attributes_response.py index 51f6c5c8..143cccbf 100644 --- a/src/square/types/list_customer_custom_attributes_response.py +++ b/src/square/types/list_customer_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCustomerCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_customer_groups_response.py b/src/square/types/list_customer_groups_response.py index 7bc5b0e4..8cdf18c1 100644 --- a/src/square/types/list_customer_groups_response.py +++ b/src/square/types/list_customer_groups_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_group import CustomerGroup -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCustomerGroupsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_customer_segments_response.py b/src/square/types/list_customer_segments_response.py index 5cf2b649..bbc8ac4f 100644 --- a/src/square/types/list_customer_segments_response.py +++ b/src/square/types/list_customer_segments_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_segment import CustomerSegment -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCustomerSegmentsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_customers_response.py b/src/square/types/list_customers_response.py index ff3a9569..92855991 100644 --- a/src/square/types/list_customers_response.py +++ b/src/square/types/list_customers_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer import Customer -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListCustomersResponse(UncheckedBaseModel): diff --git a/src/square/types/list_device_codes_response.py b/src/square/types/list_device_codes_response.py index 44612897..efdabea3 100644 --- a/src/square/types/list_device_codes_response.py +++ b/src/square/types/list_device_codes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device_code import DeviceCode -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListDeviceCodesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_devices_response.py b/src/square/types/list_devices_response.py index f909335b..efcce551 100644 --- a/src/square/types/list_devices_response.py +++ b/src/square/types/list_devices_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .device import Device -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListDevicesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_dispute_evidence_response.py b/src/square/types/list_dispute_evidence_response.py index 96d3f49b..3e20fb05 100644 --- a/src/square/types/list_dispute_evidence_response.py +++ b/src/square/types/list_dispute_evidence_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .dispute_evidence import DisputeEvidence +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListDisputeEvidenceResponse(UncheckedBaseModel): diff --git a/src/square/types/list_disputes_response.py b/src/square/types/list_disputes_response.py index 76dd4b97..db71a6af 100644 --- a/src/square/types/list_disputes_response.py +++ b/src/square/types/list_disputes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute import Dispute -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListDisputesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_employee_wages_response.py b/src/square/types/list_employee_wages_response.py index 14398743..cf8b1631 100644 --- a/src/square/types/list_employee_wages_response.py +++ b/src/square/types/list_employee_wages_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .employee_wage import EmployeeWage +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListEmployeeWagesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_employees_response.py b/src/square/types/list_employees_response.py index 0449f868..569a01b9 100644 --- a/src/square/types/list_employees_response.py +++ b/src/square/types/list_employees_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .employee import Employee +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListEmployeesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_event_types_response.py b/src/square/types/list_event_types_response.py index 02feffeb..f68e8020 100644 --- a/src/square/types/list_event_types_response.py +++ b/src/square/types/list_event_types_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .event_type_metadata import EventTypeMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListEventTypesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_gift_card_activities_response.py b/src/square/types/list_gift_card_activities_response.py index 7ec16d16..5c197cb7 100644 --- a/src/square/types/list_gift_card_activities_response.py +++ b/src/square/types/list_gift_card_activities_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card_activity import GiftCardActivity +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListGiftCardActivitiesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_gift_cards_response.py b/src/square/types/list_gift_cards_response.py index 21f527ef..5c7f14a2 100644 --- a/src/square/types/list_gift_cards_response.py +++ b/src/square/types/list_gift_cards_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListGiftCardsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_invoices_response.py b/src/square/types/list_invoices_response.py index ebbc7eca..68c74056 100644 --- a/src/square/types/list_invoices_response.py +++ b/src/square/types/list_invoices_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListInvoicesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_jobs_response.py b/src/square/types/list_jobs_response.py index 0d8c0326..6b49008f 100644 --- a/src/square/types/list_jobs_response.py +++ b/src/square/types/list_jobs_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .job import Job import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .job import Job +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListJobsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_location_booking_profiles_response.py b/src/square/types/list_location_booking_profiles_response.py index e0376d9f..a4bf3699 100644 --- a/src/square/types/list_location_booking_profiles_response.py +++ b/src/square/types/list_location_booking_profiles_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .location_booking_profile import LocationBookingProfile import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .location_booking_profile import LocationBookingProfile +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListLocationBookingProfilesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_location_custom_attribute_definitions_response.py b/src/square/types/list_location_custom_attribute_definitions_response.py index a4689bf4..a9cc9b4c 100644 --- a/src/square/types/list_location_custom_attribute_definitions_response.py +++ b/src/square/types/list_location_custom_attribute_definitions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListLocationCustomAttributeDefinitionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_location_custom_attributes_response.py b/src/square/types/list_location_custom_attributes_response.py index 9488e279..7a6c978c 100644 --- a/src/square/types/list_location_custom_attributes_response.py +++ b/src/square/types/list_location_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListLocationCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_locations_response.py b/src/square/types/list_locations_response.py index 29bae41a..437f64c6 100644 --- a/src/square/types/list_locations_response.py +++ b/src/square/types/list_locations_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .location import Location +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListLocationsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_loyalty_programs_response.py b/src/square/types/list_loyalty_programs_response.py index 65c73d5d..0108c0c5 100644 --- a/src/square/types/list_loyalty_programs_response.py +++ b/src/square/types/list_loyalty_programs_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_program import LoyaltyProgram +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListLoyaltyProgramsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_loyalty_promotions_response.py b/src/square/types/list_loyalty_promotions_response.py index 35b6d57f..950c541a 100644 --- a/src/square/types/list_loyalty_promotions_response.py +++ b/src/square/types/list_loyalty_promotions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_promotion import LoyaltyPromotion +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListLoyaltyPromotionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_merchant_custom_attribute_definitions_response.py b/src/square/types/list_merchant_custom_attribute_definitions_response.py index 6092d89b..9fe14fae 100644 --- a/src/square/types/list_merchant_custom_attribute_definitions_response.py +++ b/src/square/types/list_merchant_custom_attribute_definitions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListMerchantCustomAttributeDefinitionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_merchant_custom_attributes_response.py b/src/square/types/list_merchant_custom_attributes_response.py index 79090adc..b37508da 100644 --- a/src/square/types/list_merchant_custom_attributes_response.py +++ b/src/square/types/list_merchant_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListMerchantCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_merchants_response.py b/src/square/types/list_merchants_response.py index cbcaa0de..f74453d8 100644 --- a/src/square/types/list_merchants_response.py +++ b/src/square/types/list_merchants_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .merchant import Merchant +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListMerchantsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_order_custom_attribute_definitions_response.py b/src/square/types/list_order_custom_attribute_definitions_response.py index f41608c1..53080db9 100644 --- a/src/square/types/list_order_custom_attribute_definitions_response.py +++ b/src/square/types/list_order_custom_attribute_definitions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListOrderCustomAttributeDefinitionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_order_custom_attributes_response.py b/src/square/types/list_order_custom_attributes_response.py index 0e8bc2c4..bc22397f 100644 --- a/src/square/types/list_order_custom_attributes_response.py +++ b/src/square/types/list_order_custom_attributes_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListOrderCustomAttributesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_payment_links_response.py b/src/square/types/list_payment_links_response.py index 1bd87723..05e5f0b1 100644 --- a/src/square/types/list_payment_links_response.py +++ b/src/square/types/list_payment_links_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment_link import PaymentLink +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListPaymentLinksResponse(UncheckedBaseModel): diff --git a/src/square/types/list_payment_refunds_response.py b/src/square/types/list_payment_refunds_response.py index 149c463f..5c906038 100644 --- a/src/square/types/list_payment_refunds_response.py +++ b/src/square/types/list_payment_refunds_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment_refund import PaymentRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListPaymentRefundsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_payments_response.py b/src/square/types/list_payments_response.py index 207a7890..8257aa59 100644 --- a/src/square/types/list_payments_response.py +++ b/src/square/types/list_payments_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment import Payment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListPaymentsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_payout_entries_response.py b/src/square/types/list_payout_entries_response.py index f21917b4..3481e727 100644 --- a/src/square/types/list_payout_entries_response.py +++ b/src/square/types/list_payout_entries_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payout_entry import PayoutEntry import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .payout_entry import PayoutEntry +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListPayoutEntriesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_payouts_response.py b/src/square/types/list_payouts_response.py index 1e17438b..faeda293 100644 --- a/src/square/types/list_payouts_response.py +++ b/src/square/types/list_payouts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payout import Payout import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .payout import Payout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListPayoutsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_sites_response.py b/src/square/types/list_sites_response.py index a650e812..3833c8f5 100644 --- a/src/square/types/list_sites_response.py +++ b/src/square/types/list_sites_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .site import Site +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListSitesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_subscription_events_response.py b/src/square/types/list_subscription_events_response.py index fafd022b..94e21f3d 100644 --- a/src/square/types/list_subscription_events_response.py +++ b/src/square/types/list_subscription_events_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription_event import SubscriptionEvent +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListSubscriptionEventsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_team_member_booking_profiles_response.py b/src/square/types/list_team_member_booking_profiles_response.py index a17abce5..71455e0c 100644 --- a/src/square/types/list_team_member_booking_profiles_response.py +++ b/src/square/types/list_team_member_booking_profiles_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member_booking_profile import TeamMemberBookingProfile import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member_booking_profile import TeamMemberBookingProfile +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListTeamMemberBookingProfilesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_team_member_wages_response.py b/src/square/types/list_team_member_wages_response.py index bf9ffbef..03861b55 100644 --- a/src/square/types/list_team_member_wages_response.py +++ b/src/square/types/list_team_member_wages_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member_wage import TeamMemberWage import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member_wage import TeamMemberWage +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListTeamMemberWagesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_transactions_response.py b/src/square/types/list_transactions_response.py index 3d28b6d4..a34f0d9f 100644 --- a/src/square/types/list_transactions_response.py +++ b/src/square/types/list_transactions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .transaction import Transaction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListTransactionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_webhook_event_types_response.py b/src/square/types/list_webhook_event_types_response.py index 65068085..43038d7c 100644 --- a/src/square/types/list_webhook_event_types_response.py +++ b/src/square/types/list_webhook_event_types_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .event_type_metadata import EventTypeMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListWebhookEventTypesResponse(UncheckedBaseModel): diff --git a/src/square/types/list_webhook_subscriptions_response.py b/src/square/types/list_webhook_subscriptions_response.py index 61506afb..ccf2bddb 100644 --- a/src/square/types/list_webhook_subscriptions_response.py +++ b/src/square/types/list_webhook_subscriptions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .webhook_subscription import WebhookSubscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListWebhookSubscriptionsResponse(UncheckedBaseModel): diff --git a/src/square/types/list_workweek_configs_response.py b/src/square/types/list_workweek_configs_response.py index ce4c2f96..af5759a6 100644 --- a/src/square/types/list_workweek_configs_response.py +++ b/src/square/types/list_workweek_configs_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .workweek_config import WorkweekConfig import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .workweek_config import WorkweekConfig +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ListWorkweekConfigsResponse(UncheckedBaseModel): diff --git a/src/square/types/location.py b/src/square/types/location.py index 798685f3..5c3367f7 100644 --- a/src/square/types/location.py +++ b/src/square/types/location.py @@ -1,19 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address -from .business_hours import BusinessHours -from .coordinates import Coordinates -from .country import Country -from .currency import Currency from .location_capability import LocationCapability from .location_status import LocationStatus +from .country import Country +from .currency import Currency from .location_type import LocationType +from .business_hours import BusinessHours +from .coordinates import Coordinates from .tax_ids import TaxIds +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Location(UncheckedBaseModel): diff --git a/src/square/types/location_booking_profile.py b/src/square/types/location_booking_profile.py index ffa6d681..a07fd497 100644 --- a/src/square/types/location_booking_profile.py +++ b/src/square/types/location_booking_profile.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LocationBookingProfile(UncheckedBaseModel): diff --git a/src/square/types/location_created_event.py b/src/square/types/location_created_event.py index 6f2c6126..05ee11a9 100644 --- a/src/square/types/location_created_event.py +++ b/src/square/types/location_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .location_created_event_data import LocationCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_created_event_data.py b/src/square/types/location_created_event_data.py index a380c975..7ad2984b 100644 --- a/src/square/types/location_created_event_data.py +++ b/src/square/types/location_created_event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LocationCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_definition_owned_created_event.py b/src/square/types/location_custom_attribute_definition_owned_created_event.py index 4134b51b..30638905 100644 --- a/src/square/types/location_custom_attribute_definition_owned_created_event.py +++ b/src/square/types/location_custom_attribute_definition_owned_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeDefinitionOwnedCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_definition_owned_deleted_event.py b/src/square/types/location_custom_attribute_definition_owned_deleted_event.py index 63b01705..31d521df 100644 --- a/src/square/types/location_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/types/location_custom_attribute_definition_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeDefinitionOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_definition_owned_updated_event.py b/src/square/types/location_custom_attribute_definition_owned_updated_event.py index d436e165..104cd97b 100644 --- a/src/square/types/location_custom_attribute_definition_owned_updated_event.py +++ b/src/square/types/location_custom_attribute_definition_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeDefinitionOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_definition_visible_created_event.py b/src/square/types/location_custom_attribute_definition_visible_created_event.py index 4ccec0a7..08286860 100644 --- a/src/square/types/location_custom_attribute_definition_visible_created_event.py +++ b/src/square/types/location_custom_attribute_definition_visible_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeDefinitionVisibleCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_definition_visible_deleted_event.py b/src/square/types/location_custom_attribute_definition_visible_deleted_event.py index 26b9ac52..b8c452d0 100644 --- a/src/square/types/location_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/types/location_custom_attribute_definition_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeDefinitionVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_definition_visible_updated_event.py b/src/square/types/location_custom_attribute_definition_visible_updated_event.py index e9602f17..6390c607 100644 --- a/src/square/types/location_custom_attribute_definition_visible_updated_event.py +++ b/src/square/types/location_custom_attribute_definition_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeDefinitionVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_owned_deleted_event.py b/src/square/types/location_custom_attribute_owned_deleted_event.py index 5592d4d7..59dc0435 100644 --- a/src/square/types/location_custom_attribute_owned_deleted_event.py +++ b/src/square/types/location_custom_attribute_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_owned_updated_event.py b/src/square/types/location_custom_attribute_owned_updated_event.py index 955bd8d5..adb0e0ac 100644 --- a/src/square/types/location_custom_attribute_owned_updated_event.py +++ b/src/square/types/location_custom_attribute_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_visible_deleted_event.py b/src/square/types/location_custom_attribute_visible_deleted_event.py index b11f878e..20f7c272 100644 --- a/src/square/types/location_custom_attribute_visible_deleted_event.py +++ b/src/square/types/location_custom_attribute_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_custom_attribute_visible_updated_event.py b/src/square/types/location_custom_attribute_visible_updated_event.py index 02935ecf..5a838511 100644 --- a/src/square/types/location_custom_attribute_visible_updated_event.py +++ b/src/square/types/location_custom_attribute_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationCustomAttributeVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_settings_updated_event.py b/src/square/types/location_settings_updated_event.py index 2e1add06..fff0d6fd 100644 --- a/src/square/types/location_settings_updated_event.py +++ b/src/square/types/location_settings_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .location_settings_updated_event_data import LocationSettingsUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationSettingsUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_settings_updated_event_data.py b/src/square/types/location_settings_updated_event_data.py index 1928a727..a19af8ce 100644 --- a/src/square/types/location_settings_updated_event_data.py +++ b/src/square/types/location_settings_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .location_settings_updated_event_object import LocationSettingsUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationSettingsUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/location_settings_updated_event_object.py b/src/square/types/location_settings_updated_event_object.py index af761c07..762e5223 100644 --- a/src/square/types/location_settings_updated_event_object.py +++ b/src/square/types/location_settings_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .checkout_location_settings import CheckoutLocationSettings import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .checkout_location_settings import CheckoutLocationSettings class LocationSettingsUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/location_updated_event.py b/src/square/types/location_updated_event.py index e83ec88b..42e68198 100644 --- a/src/square/types/location_updated_event.py +++ b/src/square/types/location_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .location_updated_event_data import LocationUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LocationUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/location_updated_event_data.py b/src/square/types/location_updated_event_data.py index 3a40ad7e..a037178a 100644 --- a/src/square/types/location_updated_event_data.py +++ b/src/square/types/location_updated_event_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LocationUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account.py b/src/square/types/loyalty_account.py index 90acfbd7..d3ffb8f1 100644 --- a/src/square/types/loyalty_account.py +++ b/src/square/types/loyalty_account.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_account_expiring_point_deadline import LoyaltyAccountExpiringPointDeadline from .loyalty_account_mapping import LoyaltyAccountMapping +from .loyalty_account_expiring_point_deadline import LoyaltyAccountExpiringPointDeadline +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccount(UncheckedBaseModel): @@ -47,11 +46,10 @@ class LoyaltyAccount(UncheckedBaseModel): The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the **Enrolled On** or **Member Since** date in first-party Square products. If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's first action on their account - (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale. + (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale. - If this field is set in a `CreateLoyaltyAccount` request, it is meant to be used when there is a loyalty migration from another system and into Square. - In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. - Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale. + This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty account for a buyer who already interacted with their account. + For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future. """ created_at: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/square/types/loyalty_account_created_event.py b/src/square/types/loyalty_account_created_event.py index f68055a6..75e866d2 100644 --- a/src/square/types/loyalty_account_created_event.py +++ b/src/square/types/loyalty_account_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_account_created_event_data import LoyaltyAccountCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccountCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_created_event_data.py b/src/square/types/loyalty_account_created_event_data.py index 58896dd1..9d78acf9 100644 --- a/src/square/types/loyalty_account_created_event_data.py +++ b/src/square/types/loyalty_account_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_account_created_event_object import LoyaltyAccountCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccountCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_created_event_object.py b/src/square/types/loyalty_account_created_event_object.py index 82722fe8..8dfcb85e 100644 --- a/src/square/types/loyalty_account_created_event_object.py +++ b/src/square/types/loyalty_account_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_account import LoyaltyAccount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_account import LoyaltyAccount class LoyaltyAccountCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_deleted_event.py b/src/square/types/loyalty_account_deleted_event.py index 215a9c40..29378981 100644 --- a/src/square/types/loyalty_account_deleted_event.py +++ b/src/square/types/loyalty_account_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_account_deleted_event_data import LoyaltyAccountDeletedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccountDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_deleted_event_data.py b/src/square/types/loyalty_account_deleted_event_data.py index 7a790709..3ca91c2d 100644 --- a/src/square/types/loyalty_account_deleted_event_data.py +++ b/src/square/types/loyalty_account_deleted_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_account_deleted_event_object import LoyaltyAccountDeletedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccountDeletedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_deleted_event_object.py b/src/square/types/loyalty_account_deleted_event_object.py index 69bfc3e7..1ec972de 100644 --- a/src/square/types/loyalty_account_deleted_event_object.py +++ b/src/square/types/loyalty_account_deleted_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_account import LoyaltyAccount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_account import LoyaltyAccount class LoyaltyAccountDeletedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_expiring_point_deadline.py b/src/square/types/loyalty_account_expiring_point_deadline.py index 7675d429..da82c37d 100644 --- a/src/square/types/loyalty_account_expiring_point_deadline.py +++ b/src/square/types/loyalty_account_expiring_point_deadline.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyAccountExpiringPointDeadline(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_mapping.py b/src/square/types/loyalty_account_mapping.py index 60bc057c..2283f289 100644 --- a/src/square/types/loyalty_account_mapping.py +++ b/src/square/types/loyalty_account_mapping.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyAccountMapping(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_updated_event.py b/src/square/types/loyalty_account_updated_event.py index d260bddd..a0879765 100644 --- a/src/square/types/loyalty_account_updated_event.py +++ b/src/square/types/loyalty_account_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_account_updated_event_data import LoyaltyAccountUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccountUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_updated_event_data.py b/src/square/types/loyalty_account_updated_event_data.py index 26984a37..28196e5b 100644 --- a/src/square/types/loyalty_account_updated_event_data.py +++ b/src/square/types/loyalty_account_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_account_updated_event_object import LoyaltyAccountUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyAccountUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_account_updated_event_object.py b/src/square/types/loyalty_account_updated_event_object.py index 2c4960da..e1fdb46b 100644 --- a/src/square/types/loyalty_account_updated_event_object.py +++ b/src/square/types/loyalty_account_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_account import LoyaltyAccount import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_account import LoyaltyAccount class LoyaltyAccountUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event.py b/src/square/types/loyalty_event.py index 3838ffba..89740350 100644 --- a/src/square/types/loyalty_event.py +++ b/src/square/types/loyalty_event.py @@ -1,20 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .loyalty_event_type import LoyaltyEventType from .loyalty_event_accumulate_points import LoyaltyEventAccumulatePoints -from .loyalty_event_accumulate_promotion_points import LoyaltyEventAccumulatePromotionPoints -from .loyalty_event_adjust_points import LoyaltyEventAdjustPoints from .loyalty_event_create_reward import LoyaltyEventCreateReward +from .loyalty_event_redeem_reward import LoyaltyEventRedeemReward from .loyalty_event_delete_reward import LoyaltyEventDeleteReward +from .loyalty_event_adjust_points import LoyaltyEventAdjustPoints +from .loyalty_event_source import LoyaltyEventSource from .loyalty_event_expire_points import LoyaltyEventExpirePoints from .loyalty_event_other import LoyaltyEventOther -from .loyalty_event_redeem_reward import LoyaltyEventRedeemReward -from .loyalty_event_source import LoyaltyEventSource -from .loyalty_event_type import LoyaltyEventType +from .loyalty_event_accumulate_promotion_points import LoyaltyEventAccumulatePromotionPoints +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_accumulate_points.py b/src/square/types/loyalty_event_accumulate_points.py index c6e9c1a3..7d4c4cfe 100644 --- a/src/square/types/loyalty_event_accumulate_points.py +++ b/src/square/types/loyalty_event_accumulate_points.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventAccumulatePoints(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_accumulate_promotion_points.py b/src/square/types/loyalty_event_accumulate_promotion_points.py index a6e9e84d..c1db9a63 100644 --- a/src/square/types/loyalty_event_accumulate_promotion_points.py +++ b/src/square/types/loyalty_event_accumulate_promotion_points.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventAccumulatePromotionPoints(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_adjust_points.py b/src/square/types/loyalty_event_adjust_points.py index 91da2947..64ca6c83 100644 --- a/src/square/types/loyalty_event_adjust_points.py +++ b/src/square/types/loyalty_event_adjust_points.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventAdjustPoints(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_create_reward.py b/src/square/types/loyalty_event_create_reward.py index 9c2bdfa7..79018482 100644 --- a/src/square/types/loyalty_event_create_reward.py +++ b/src/square/types/loyalty_event_create_reward.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventCreateReward(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_created_event.py b/src/square/types/loyalty_event_created_event.py index 2e98c2e5..8e8104f6 100644 --- a/src/square/types/loyalty_event_created_event.py +++ b/src/square/types/loyalty_event_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_event_created_event_data import LoyaltyEventCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyEventCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_created_event_data.py b/src/square/types/loyalty_event_created_event_data.py index dd04fbdd..2aee8891 100644 --- a/src/square/types/loyalty_event_created_event_data.py +++ b/src/square/types/loyalty_event_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_event_created_event_object import LoyaltyEventCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyEventCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_created_event_object.py b/src/square/types/loyalty_event_created_event_object.py index 12e8560b..02f49ff9 100644 --- a/src/square/types/loyalty_event_created_event_object.py +++ b/src/square/types/loyalty_event_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_event import LoyaltyEvent import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_event import LoyaltyEvent class LoyaltyEventCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_date_time_filter.py b/src/square/types/loyalty_event_date_time_filter.py index 45abf17b..f8f3f112 100644 --- a/src/square/types/loyalty_event_date_time_filter.py +++ b/src/square/types/loyalty_event_date_time_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .time_range import TimeRange +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class LoyaltyEventDateTimeFilter(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_delete_reward.py b/src/square/types/loyalty_event_delete_reward.py index d7701988..1afebbb4 100644 --- a/src/square/types/loyalty_event_delete_reward.py +++ b/src/square/types/loyalty_event_delete_reward.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventDeleteReward(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_expire_points.py b/src/square/types/loyalty_event_expire_points.py index 53be60eb..57992517 100644 --- a/src/square/types/loyalty_event_expire_points.py +++ b/src/square/types/loyalty_event_expire_points.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventExpirePoints(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_filter.py b/src/square/types/loyalty_event_filter.py index f668cbbd..3aeaead8 100644 --- a/src/square/types/loyalty_event_filter.py +++ b/src/square/types/loyalty_event_filter.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_event_loyalty_account_filter import LoyaltyEventLoyaltyAccountFilter import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .loyalty_event_type_filter import LoyaltyEventTypeFilter from .loyalty_event_date_time_filter import LoyaltyEventDateTimeFilter from .loyalty_event_location_filter import LoyaltyEventLocationFilter -from .loyalty_event_loyalty_account_filter import LoyaltyEventLoyaltyAccountFilter from .loyalty_event_order_filter import LoyaltyEventOrderFilter -from .loyalty_event_type_filter import LoyaltyEventTypeFilter +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyEventFilter(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_location_filter.py b/src/square/types/loyalty_event_location_filter.py index 5d6dc72c..f5545f17 100644 --- a/src/square/types/loyalty_event_location_filter.py +++ b/src/square/types/loyalty_event_location_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventLocationFilter(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_loyalty_account_filter.py b/src/square/types/loyalty_event_loyalty_account_filter.py index 3b189d8e..e1ce788f 100644 --- a/src/square/types/loyalty_event_loyalty_account_filter.py +++ b/src/square/types/loyalty_event_loyalty_account_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyEventLoyaltyAccountFilter(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_order_filter.py b/src/square/types/loyalty_event_order_filter.py index 09a6b2b5..7814ca6b 100644 --- a/src/square/types/loyalty_event_order_filter.py +++ b/src/square/types/loyalty_event_order_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyEventOrderFilter(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_other.py b/src/square/types/loyalty_event_other.py index fc6f113c..9e5604cc 100644 --- a/src/square/types/loyalty_event_other.py +++ b/src/square/types/loyalty_event_other.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventOther(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_query.py b/src/square/types/loyalty_event_query.py index 02dde1d5..ff74534b 100644 --- a/src/square/types/loyalty_event_query.py +++ b/src/square/types/loyalty_event_query.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_event_filter import LoyaltyEventFilter import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_event_filter import LoyaltyEventFilter class LoyaltyEventQuery(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_redeem_reward.py b/src/square/types/loyalty_event_redeem_reward.py index 76f49f79..d2df8a9b 100644 --- a/src/square/types/loyalty_event_redeem_reward.py +++ b/src/square/types/loyalty_event_redeem_reward.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyEventRedeemReward(UncheckedBaseModel): diff --git a/src/square/types/loyalty_event_type_filter.py b/src/square/types/loyalty_event_type_filter.py index 7ae82722..dbbf6e17 100644 --- a/src/square/types/loyalty_event_type_filter.py +++ b/src/square/types/loyalty_event_type_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_event_type import LoyaltyEventType import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_event_type import LoyaltyEventType class LoyaltyEventTypeFilter(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program.py b/src/square/types/loyalty_program.py index 7326e2e9..284d156b 100644 --- a/src/square/types/loyalty_program.py +++ b/src/square/types/loyalty_program.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_program_accrual_rule import LoyaltyProgramAccrualRule -from .loyalty_program_expiration_policy import LoyaltyProgramExpirationPolicy -from .loyalty_program_reward_tier import LoyaltyProgramRewardTier from .loyalty_program_status import LoyaltyProgramStatus +from .loyalty_program_reward_tier import LoyaltyProgramRewardTier +from .loyalty_program_expiration_policy import LoyaltyProgramExpirationPolicy from .loyalty_program_terminology import LoyaltyProgramTerminology +from .loyalty_program_accrual_rule import LoyaltyProgramAccrualRule +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgram(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_accrual_rule.py b/src/square/types/loyalty_program_accrual_rule.py index b22c0acc..f45da956 100644 --- a/src/square/types/loyalty_program_accrual_rule.py +++ b/src/square/types/loyalty_program_accrual_rule.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_program_accrual_rule_category_data import LoyaltyProgramAccrualRuleCategoryData -from .loyalty_program_accrual_rule_item_variation_data import LoyaltyProgramAccrualRuleItemVariationData -from .loyalty_program_accrual_rule_spend_data import LoyaltyProgramAccrualRuleSpendData from .loyalty_program_accrual_rule_type import LoyaltyProgramAccrualRuleType +import pydantic +import typing from .loyalty_program_accrual_rule_visit_data import LoyaltyProgramAccrualRuleVisitData +from .loyalty_program_accrual_rule_spend_data import LoyaltyProgramAccrualRuleSpendData +from .loyalty_program_accrual_rule_item_variation_data import LoyaltyProgramAccrualRuleItemVariationData +from .loyalty_program_accrual_rule_category_data import LoyaltyProgramAccrualRuleCategoryData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramAccrualRule(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_accrual_rule_category_data.py b/src/square/types/loyalty_program_accrual_rule_category_data.py index c0d8ff5f..b9b742bc 100644 --- a/src/square/types/loyalty_program_accrual_rule_category_data.py +++ b/src/square/types/loyalty_program_accrual_rule_category_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyProgramAccrualRuleCategoryData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_accrual_rule_item_variation_data.py b/src/square/types/loyalty_program_accrual_rule_item_variation_data.py index dd1a5d78..4696196c 100644 --- a/src/square/types/loyalty_program_accrual_rule_item_variation_data.py +++ b/src/square/types/loyalty_program_accrual_rule_item_variation_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyProgramAccrualRuleItemVariationData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_accrual_rule_spend_data.py b/src/square/types/loyalty_program_accrual_rule_spend_data.py index 1391307a..8cc69e40 100644 --- a/src/square/types/loyalty_program_accrual_rule_spend_data.py +++ b/src/square/types/loyalty_program_accrual_rule_spend_data.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode from .money import Money +import pydantic +import typing +from .loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramAccrualRuleSpendData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_accrual_rule_visit_data.py b/src/square/types/loyalty_program_accrual_rule_visit_data.py index e0de3753..8ead23e3 100644 --- a/src/square/types/loyalty_program_accrual_rule_visit_data.py +++ b/src/square/types/loyalty_program_accrual_rule_visit_data.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .money import Money import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode -from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramAccrualRuleVisitData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_created_event.py b/src/square/types/loyalty_program_created_event.py index 9d87a26d..281b9ff3 100644 --- a/src/square/types/loyalty_program_created_event.py +++ b/src/square/types/loyalty_program_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_program_created_event_data import LoyaltyProgramCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_created_event_data.py b/src/square/types/loyalty_program_created_event_data.py index 38b70b56..93ffbac9 100644 --- a/src/square/types/loyalty_program_created_event_data.py +++ b/src/square/types/loyalty_program_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_program_created_event_object import LoyaltyProgramCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_created_event_object.py b/src/square/types/loyalty_program_created_event_object.py index c6b80a05..15f8c805 100644 --- a/src/square/types/loyalty_program_created_event_object.py +++ b/src/square/types/loyalty_program_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_program import LoyaltyProgram import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_program import LoyaltyProgram class LoyaltyProgramCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_expiration_policy.py b/src/square/types/loyalty_program_expiration_policy.py index 77cd976a..659e8838 100644 --- a/src/square/types/loyalty_program_expiration_policy.py +++ b/src/square/types/loyalty_program_expiration_policy.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyProgramExpirationPolicy(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_reward_tier.py b/src/square/types/loyalty_program_reward_tier.py index fd999fb1..03e489c6 100644 --- a/src/square/types/loyalty_program_reward_tier.py +++ b/src/square/types/loyalty_program_reward_tier.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_object_reference import CatalogObjectReference +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramRewardTier(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_terminology.py b/src/square/types/loyalty_program_terminology.py index 39d9a2f7..3724bad1 100644 --- a/src/square/types/loyalty_program_terminology.py +++ b/src/square/types/loyalty_program_terminology.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyProgramTerminology(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_updated_event.py b/src/square/types/loyalty_program_updated_event.py index 0923aca8..4ec574e3 100644 --- a/src/square/types/loyalty_program_updated_event.py +++ b/src/square/types/loyalty_program_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_program_updated_event_data import LoyaltyProgramUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_updated_event_data.py b/src/square/types/loyalty_program_updated_event_data.py index 4f502605..e8bf1c99 100644 --- a/src/square/types/loyalty_program_updated_event_data.py +++ b/src/square/types/loyalty_program_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_program_updated_event_object import LoyaltyProgramUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyProgramUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_program_updated_event_object.py b/src/square/types/loyalty_program_updated_event_object.py index 7193887d..ca0b1fe5 100644 --- a/src/square/types/loyalty_program_updated_event_object.py +++ b/src/square/types/loyalty_program_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_program import LoyaltyProgram import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_program import LoyaltyProgram class LoyaltyProgramUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion.py b/src/square/types/loyalty_promotion.py index 9bf1b319..08130727 100644 --- a/src/square/types/loyalty_promotion.py +++ b/src/square/types/loyalty_promotion.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_promotion_available_time_data import LoyaltyPromotionAvailableTimeData from .loyalty_promotion_incentive import LoyaltyPromotionIncentive -from .loyalty_promotion_status import LoyaltyPromotionStatus +from .loyalty_promotion_available_time_data import LoyaltyPromotionAvailableTimeData from .loyalty_promotion_trigger_limit import LoyaltyPromotionTriggerLimit +from .loyalty_promotion_status import LoyaltyPromotionStatus from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotion(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_available_time_data.py b/src/square/types/loyalty_promotion_available_time_data.py index 2b859ab7..3d8d93ae 100644 --- a/src/square/types/loyalty_promotion_available_time_data.py +++ b/src/square/types/loyalty_promotion_available_time_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyPromotionAvailableTimeData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_created_event.py b/src/square/types/loyalty_promotion_created_event.py index 76eb923f..9f5bb9d6 100644 --- a/src/square/types/loyalty_promotion_created_event.py +++ b/src/square/types/loyalty_promotion_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_promotion_created_event_data import LoyaltyPromotionCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotionCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_created_event_data.py b/src/square/types/loyalty_promotion_created_event_data.py index 5c73e5d3..c71895a7 100644 --- a/src/square/types/loyalty_promotion_created_event_data.py +++ b/src/square/types/loyalty_promotion_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_promotion_created_event_object import LoyaltyPromotionCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotionCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_created_event_object.py b/src/square/types/loyalty_promotion_created_event_object.py index 209c014f..d60bf8f4 100644 --- a/src/square/types/loyalty_promotion_created_event_object.py +++ b/src/square/types/loyalty_promotion_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_promotion import LoyaltyPromotion import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_promotion import LoyaltyPromotion class LoyaltyPromotionCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_incentive.py b/src/square/types/loyalty_promotion_incentive.py index c286c978..f2f5cd9c 100644 --- a/src/square/types/loyalty_promotion_incentive.py +++ b/src/square/types/loyalty_promotion_incentive.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_promotion_incentive_points_addition_data import LoyaltyPromotionIncentivePointsAdditionData -from .loyalty_promotion_incentive_points_multiplier_data import LoyaltyPromotionIncentivePointsMultiplierData from .loyalty_promotion_incentive_type import LoyaltyPromotionIncentiveType +import pydantic +import typing +from .loyalty_promotion_incentive_points_multiplier_data import LoyaltyPromotionIncentivePointsMultiplierData +from .loyalty_promotion_incentive_points_addition_data import LoyaltyPromotionIncentivePointsAdditionData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotionIncentive(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_incentive_points_addition_data.py b/src/square/types/loyalty_promotion_incentive_points_addition_data.py index 6a2ba3bc..75eae361 100644 --- a/src/square/types/loyalty_promotion_incentive_points_addition_data.py +++ b/src/square/types/loyalty_promotion_incentive_points_addition_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class LoyaltyPromotionIncentivePointsAdditionData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_incentive_points_multiplier_data.py b/src/square/types/loyalty_promotion_incentive_points_multiplier_data.py index a589600d..c94fb815 100644 --- a/src/square/types/loyalty_promotion_incentive_points_multiplier_data.py +++ b/src/square/types/loyalty_promotion_incentive_points_multiplier_data.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class LoyaltyPromotionIncentivePointsMultiplierData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_trigger_limit.py b/src/square/types/loyalty_promotion_trigger_limit.py index 13735b18..87cc37fe 100644 --- a/src/square/types/loyalty_promotion_trigger_limit.py +++ b/src/square/types/loyalty_promotion_trigger_limit.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .loyalty_promotion_trigger_limit_interval import LoyaltyPromotionTriggerLimitInterval +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotionTriggerLimit(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_updated_event.py b/src/square/types/loyalty_promotion_updated_event.py index 68ec4fbe..719cad96 100644 --- a/src/square/types/loyalty_promotion_updated_event.py +++ b/src/square/types/loyalty_promotion_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_promotion_updated_event_data import LoyaltyPromotionUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotionUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_updated_event_data.py b/src/square/types/loyalty_promotion_updated_event_data.py index f973d703..c7158b99 100644 --- a/src/square/types/loyalty_promotion_updated_event_data.py +++ b/src/square/types/loyalty_promotion_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_promotion_updated_event_object import LoyaltyPromotionUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyPromotionUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/loyalty_promotion_updated_event_object.py b/src/square/types/loyalty_promotion_updated_event_object.py index aea1755d..f1bb78f7 100644 --- a/src/square/types/loyalty_promotion_updated_event_object.py +++ b/src/square/types/loyalty_promotion_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_promotion import LoyaltyPromotion import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_promotion import LoyaltyPromotion class LoyaltyPromotionUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/loyalty_reward.py b/src/square/types/loyalty_reward.py index 326e6f88..1005227c 100644 --- a/src/square/types/loyalty_reward.py +++ b/src/square/types/loyalty_reward.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .loyalty_reward_status import LoyaltyRewardStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class LoyaltyReward(UncheckedBaseModel): diff --git a/src/square/types/measurement_unit.py b/src/square/types/measurement_unit.py index 839d9016..300d11ce 100644 --- a/src/square/types/measurement_unit.py +++ b/src/square/types/measurement_unit.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .measurement_unit_custom import MeasurementUnitCustom import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .measurement_unit_area import MeasurementUnitArea -from .measurement_unit_custom import MeasurementUnitCustom -from .measurement_unit_generic import MeasurementUnitGeneric from .measurement_unit_length import MeasurementUnitLength -from .measurement_unit_time import MeasurementUnitTime -from .measurement_unit_unit_type import MeasurementUnitUnitType from .measurement_unit_volume import MeasurementUnitVolume from .measurement_unit_weight import MeasurementUnitWeight +from .measurement_unit_generic import MeasurementUnitGeneric +from .measurement_unit_time import MeasurementUnitTime +from .measurement_unit_unit_type import MeasurementUnitUnitType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MeasurementUnit(UncheckedBaseModel): diff --git a/src/square/types/measurement_unit_custom.py b/src/square/types/measurement_unit_custom.py index 6892943a..b13aaa11 100644 --- a/src/square/types/measurement_unit_custom.py +++ b/src/square/types/measurement_unit_custom.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class MeasurementUnitCustom(UncheckedBaseModel): diff --git a/src/square/types/merchant.py b/src/square/types/merchant.py index 4f85dec0..785b1f1e 100644 --- a/src/square/types/merchant.py +++ b/src/square/types/merchant.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .country import Country from .currency import Currency from .merchant_status import MerchantStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Merchant(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_definition_owned_created_event.py b/src/square/types/merchant_custom_attribute_definition_owned_created_event.py index 3436e9bf..240e826d 100644 --- a/src/square/types/merchant_custom_attribute_definition_owned_created_event.py +++ b/src/square/types/merchant_custom_attribute_definition_owned_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeDefinitionOwnedCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_definition_owned_deleted_event.py b/src/square/types/merchant_custom_attribute_definition_owned_deleted_event.py index 2007d716..82b8e4c6 100644 --- a/src/square/types/merchant_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/types/merchant_custom_attribute_definition_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeDefinitionOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_definition_owned_updated_event.py b/src/square/types/merchant_custom_attribute_definition_owned_updated_event.py index cb50de16..7bcb1d64 100644 --- a/src/square/types/merchant_custom_attribute_definition_owned_updated_event.py +++ b/src/square/types/merchant_custom_attribute_definition_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeDefinitionOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_definition_visible_created_event.py b/src/square/types/merchant_custom_attribute_definition_visible_created_event.py index 67a36675..b1918d8b 100644 --- a/src/square/types/merchant_custom_attribute_definition_visible_created_event.py +++ b/src/square/types/merchant_custom_attribute_definition_visible_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeDefinitionVisibleCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_definition_visible_deleted_event.py b/src/square/types/merchant_custom_attribute_definition_visible_deleted_event.py index 1cc0e4e3..4d35c646 100644 --- a/src/square/types/merchant_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/types/merchant_custom_attribute_definition_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeDefinitionVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_definition_visible_updated_event.py b/src/square/types/merchant_custom_attribute_definition_visible_updated_event.py index 7e893a40..1a3d5836 100644 --- a/src/square/types/merchant_custom_attribute_definition_visible_updated_event.py +++ b/src/square/types/merchant_custom_attribute_definition_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeDefinitionVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_owned_deleted_event.py b/src/square/types/merchant_custom_attribute_owned_deleted_event.py index 0c1f6720..3c6558da 100644 --- a/src/square/types/merchant_custom_attribute_owned_deleted_event.py +++ b/src/square/types/merchant_custom_attribute_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_owned_updated_event.py b/src/square/types/merchant_custom_attribute_owned_updated_event.py index b0e319bb..93131483 100644 --- a/src/square/types/merchant_custom_attribute_owned_updated_event.py +++ b/src/square/types/merchant_custom_attribute_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_visible_deleted_event.py b/src/square/types/merchant_custom_attribute_visible_deleted_event.py index 2b6870b7..0ddd3bad 100644 --- a/src/square/types/merchant_custom_attribute_visible_deleted_event.py +++ b/src/square/types/merchant_custom_attribute_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_custom_attribute_visible_updated_event.py b/src/square/types/merchant_custom_attribute_visible_updated_event.py index 9b96b0e4..8d85ae73 100644 --- a/src/square/types/merchant_custom_attribute_visible_updated_event.py +++ b/src/square/types/merchant_custom_attribute_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantCustomAttributeVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_settings_updated_event.py b/src/square/types/merchant_settings_updated_event.py index deee1351..ce718297 100644 --- a/src/square/types/merchant_settings_updated_event.py +++ b/src/square/types/merchant_settings_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .merchant_settings_updated_event_data import MerchantSettingsUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantSettingsUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/merchant_settings_updated_event_data.py b/src/square/types/merchant_settings_updated_event_data.py index 7df67e63..41ae17bb 100644 --- a/src/square/types/merchant_settings_updated_event_data.py +++ b/src/square/types/merchant_settings_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .merchant_settings_updated_event_object import MerchantSettingsUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class MerchantSettingsUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/merchant_settings_updated_event_object.py b/src/square/types/merchant_settings_updated_event_object.py index 52c00f7b..bf386820 100644 --- a/src/square/types/merchant_settings_updated_event_object.py +++ b/src/square/types/merchant_settings_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .checkout_merchant_settings import CheckoutMerchantSettings import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .checkout_merchant_settings import CheckoutMerchantSettings class MerchantSettingsUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/modifier_location_overrides.py b/src/square/types/modifier_location_overrides.py index 113f32a3..69ebe6ee 100644 --- a/src/square/types/modifier_location_overrides.py +++ b/src/square/types/modifier_location_overrides.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ModifierLocationOverrides(UncheckedBaseModel): diff --git a/src/square/types/money.py b/src/square/types/money.py index b26b593b..b3a6ae8e 100644 --- a/src/square/types/money.py +++ b/src/square/types/money.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .currency import Currency +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Money(UncheckedBaseModel): diff --git a/src/square/types/oauth_authorization_revoked_event.py b/src/square/types/oauth_authorization_revoked_event.py index b4ee7d83..998589d0 100644 --- a/src/square/types/oauth_authorization_revoked_event.py +++ b/src/square/types/oauth_authorization_revoked_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .oauth_authorization_revoked_event_data import OauthAuthorizationRevokedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OauthAuthorizationRevokedEvent(UncheckedBaseModel): diff --git a/src/square/types/oauth_authorization_revoked_event_data.py b/src/square/types/oauth_authorization_revoked_event_data.py index 2bbb1f19..9343d7e2 100644 --- a/src/square/types/oauth_authorization_revoked_event_data.py +++ b/src/square/types/oauth_authorization_revoked_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .oauth_authorization_revoked_event_object import OauthAuthorizationRevokedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OauthAuthorizationRevokedEventData(UncheckedBaseModel): diff --git a/src/square/types/oauth_authorization_revoked_event_object.py b/src/square/types/oauth_authorization_revoked_event_object.py index 887453f9..69f26815 100644 --- a/src/square/types/oauth_authorization_revoked_event_object.py +++ b/src/square/types/oauth_authorization_revoked_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .oauth_authorization_revoked_event_revocation_object import OauthAuthorizationRevokedEventRevocationObject import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .oauth_authorization_revoked_event_revocation_object import OauthAuthorizationRevokedEventRevocationObject class OauthAuthorizationRevokedEventObject(UncheckedBaseModel): diff --git a/src/square/types/oauth_authorization_revoked_event_revocation_object.py b/src/square/types/oauth_authorization_revoked_event_revocation_object.py index 708ebeab..ea7fd43f 100644 --- a/src/square/types/oauth_authorization_revoked_event_revocation_object.py +++ b/src/square/types/oauth_authorization_revoked_event_revocation_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .oauth_authorization_revoked_event_revoker_type import OauthAuthorizationRevokedEventRevokerType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OauthAuthorizationRevokedEventRevocationObject(UncheckedBaseModel): diff --git a/src/square/types/obtain_token_response.py b/src/square/types/obtain_token_response.py index 0e40ba2f..ad9c37c9 100644 --- a/src/square/types/obtain_token_response.py +++ b/src/square/types/obtain_token_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ObtainTokenResponse(UncheckedBaseModel): diff --git a/src/square/types/offline_payment_details.py b/src/square/types/offline_payment_details.py index d540efc2..1e79d704 100644 --- a/src/square/types/offline_payment_details.py +++ b/src/square/types/offline_payment_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class OfflinePaymentDetails(UncheckedBaseModel): diff --git a/src/square/types/order.py b/src/square/types/order.py index 695e15e7..09dc549e 100644 --- a/src/square/types/order.py +++ b/src/square/types/order.py @@ -1,25 +1,24 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .fulfillment import Fulfillment -from .money import Money +from .order_source import OrderSource from .order_line_item import OrderLineItem -from .order_line_item_discount import OrderLineItemDiscount from .order_line_item_tax import OrderLineItemTax -from .order_money_amounts import OrderMoneyAmounts -from .order_pricing_options import OrderPricingOptions +from .order_line_item_discount import OrderLineItemDiscount +from .order_service_charge import OrderServiceCharge +from .fulfillment import Fulfillment from .order_return import OrderReturn -from .order_reward import OrderReward +from .order_money_amounts import OrderMoneyAmounts from .order_rounding_adjustment import OrderRoundingAdjustment -from .order_service_charge import OrderServiceCharge -from .order_source import OrderSource -from .order_state import OrderState -from .refund import Refund from .tender import Tender +from .refund import Refund +from .order_state import OrderState +from .money import Money +from .order_pricing_options import OrderPricingOptions +from .order_reward import OrderReward +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Order(UncheckedBaseModel): diff --git a/src/square/types/order_created.py b/src/square/types/order_created.py index b2f150da..af2a89d9 100644 --- a/src/square/types/order_created.py +++ b/src/square/types/order_created.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_state import OrderState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCreated(UncheckedBaseModel): diff --git a/src/square/types/order_created_event.py b/src/square/types/order_created_event.py index 91f90902..81f78bc3 100644 --- a/src/square/types/order_created_event.py +++ b/src/square/types/order_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_created_event_data import OrderCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_created_event_data.py b/src/square/types/order_created_event_data.py index 8cb8f95d..cdae81eb 100644 --- a/src/square/types/order_created_event_data.py +++ b/src/square/types/order_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_created_object import OrderCreatedObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/order_created_object.py b/src/square/types/order_created_object.py index 9000d583..4ba791cc 100644 --- a/src/square/types/order_created_object.py +++ b/src/square/types/order_created_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order_created import OrderCreated import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order_created import OrderCreated class OrderCreatedObject(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_definition_owned_created_event.py b/src/square/types/order_custom_attribute_definition_owned_created_event.py index 70629c40..890a3896 100644 --- a/src/square/types/order_custom_attribute_definition_owned_created_event.py +++ b/src/square/types/order_custom_attribute_definition_owned_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeDefinitionOwnedCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_definition_owned_deleted_event.py b/src/square/types/order_custom_attribute_definition_owned_deleted_event.py index 4a74d2bf..0429b838 100644 --- a/src/square/types/order_custom_attribute_definition_owned_deleted_event.py +++ b/src/square/types/order_custom_attribute_definition_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeDefinitionOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_definition_owned_updated_event.py b/src/square/types/order_custom_attribute_definition_owned_updated_event.py index b7fd94a8..ebd0290c 100644 --- a/src/square/types/order_custom_attribute_definition_owned_updated_event.py +++ b/src/square/types/order_custom_attribute_definition_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeDefinitionOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_definition_visible_created_event.py b/src/square/types/order_custom_attribute_definition_visible_created_event.py index 9b04e378..5efbfcee 100644 --- a/src/square/types/order_custom_attribute_definition_visible_created_event.py +++ b/src/square/types/order_custom_attribute_definition_visible_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeDefinitionVisibleCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_definition_visible_deleted_event.py b/src/square/types/order_custom_attribute_definition_visible_deleted_event.py index 36802ea7..dc9adc7c 100644 --- a/src/square/types/order_custom_attribute_definition_visible_deleted_event.py +++ b/src/square/types/order_custom_attribute_definition_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeDefinitionVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_definition_visible_updated_event.py b/src/square/types/order_custom_attribute_definition_visible_updated_event.py index d0a80f0c..850ffa7d 100644 --- a/src/square/types/order_custom_attribute_definition_visible_updated_event.py +++ b/src/square/types/order_custom_attribute_definition_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_definition_event_data import CustomAttributeDefinitionEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeDefinitionVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_owned_deleted_event.py b/src/square/types/order_custom_attribute_owned_deleted_event.py index f6e9dcb4..7645e338 100644 --- a/src/square/types/order_custom_attribute_owned_deleted_event.py +++ b/src/square/types/order_custom_attribute_owned_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeOwnedDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_owned_updated_event.py b/src/square/types/order_custom_attribute_owned_updated_event.py index 395947fe..a91ebaf4 100644 --- a/src/square/types/order_custom_attribute_owned_updated_event.py +++ b/src/square/types/order_custom_attribute_owned_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeOwnedUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_visible_deleted_event.py b/src/square/types/order_custom_attribute_visible_deleted_event.py index a2b550d7..656e20cb 100644 --- a/src/square/types/order_custom_attribute_visible_deleted_event.py +++ b/src/square/types/order_custom_attribute_visible_deleted_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeVisibleDeletedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_custom_attribute_visible_updated_event.py b/src/square/types/order_custom_attribute_visible_updated_event.py index 2156d81f..10cd9085 100644 --- a/src/square/types/order_custom_attribute_visible_updated_event.py +++ b/src/square/types/order_custom_attribute_visible_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .custom_attribute_event_data import CustomAttributeEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderCustomAttributeVisibleUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_entry.py b/src/square/types/order_entry.py index 019e3fbf..c3e297b2 100644 --- a/src/square/types/order_entry.py +++ b/src/square/types/order_entry.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class OrderEntry(UncheckedBaseModel): diff --git a/src/square/types/order_fulfillment_updated.py b/src/square/types/order_fulfillment_updated.py index 3b5baa71..ba807721 100644 --- a/src/square/types/order_fulfillment_updated.py +++ b/src/square/types/order_fulfillment_updated.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order_fulfillment_updated_update import OrderFulfillmentUpdatedUpdate from .order_state import OrderState +from .order_fulfillment_updated_update import OrderFulfillmentUpdatedUpdate +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderFulfillmentUpdated(UncheckedBaseModel): diff --git a/src/square/types/order_fulfillment_updated_event.py b/src/square/types/order_fulfillment_updated_event.py index 91f06f17..c6b07472 100644 --- a/src/square/types/order_fulfillment_updated_event.py +++ b/src/square/types/order_fulfillment_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_fulfillment_updated_event_data import OrderFulfillmentUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderFulfillmentUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_fulfillment_updated_event_data.py b/src/square/types/order_fulfillment_updated_event_data.py index 74c41418..e88b0e22 100644 --- a/src/square/types/order_fulfillment_updated_event_data.py +++ b/src/square/types/order_fulfillment_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_fulfillment_updated_object import OrderFulfillmentUpdatedObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderFulfillmentUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/order_fulfillment_updated_object.py b/src/square/types/order_fulfillment_updated_object.py index 741b9060..6058e4dd 100644 --- a/src/square/types/order_fulfillment_updated_object.py +++ b/src/square/types/order_fulfillment_updated_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order_fulfillment_updated import OrderFulfillmentUpdated import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order_fulfillment_updated import OrderFulfillmentUpdated class OrderFulfillmentUpdatedObject(UncheckedBaseModel): diff --git a/src/square/types/order_fulfillment_updated_update.py b/src/square/types/order_fulfillment_updated_update.py index 275b0642..899d1c5b 100644 --- a/src/square/types/order_fulfillment_updated_update.py +++ b/src/square/types/order_fulfillment_updated_update.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .fulfillment_state import FulfillmentState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderFulfillmentUpdatedUpdate(UncheckedBaseModel): diff --git a/src/square/types/order_line_item.py b/src/square/types/order_line_item.py index 050df018..59a4c4a5 100644 --- a/src/square/types/order_line_item.py +++ b/src/square/types/order_line_item.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money -from .order_line_item_applied_discount import OrderLineItemAppliedDiscount -from .order_line_item_applied_service_charge import OrderLineItemAppliedServiceCharge -from .order_line_item_applied_tax import OrderLineItemAppliedTax +from .order_quantity_unit import OrderQuantityUnit from .order_line_item_item_type import OrderLineItemItemType from .order_line_item_modifier import OrderLineItemModifier +from .order_line_item_applied_tax import OrderLineItemAppliedTax +from .order_line_item_applied_discount import OrderLineItemAppliedDiscount +from .order_line_item_applied_service_charge import OrderLineItemAppliedServiceCharge +from .money import Money from .order_line_item_pricing_blocklists import OrderLineItemPricingBlocklists -from .order_quantity_unit import OrderQuantityUnit +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItem(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_applied_discount.py b/src/square/types/order_line_item_applied_discount.py index 62e88bfa..8c6707d6 100644 --- a/src/square/types/order_line_item_applied_discount.py +++ b/src/square/types/order_line_item_applied_discount.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemAppliedDiscount(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_applied_service_charge.py b/src/square/types/order_line_item_applied_service_charge.py index bd263b31..5617baa7 100644 --- a/src/square/types/order_line_item_applied_service_charge.py +++ b/src/square/types/order_line_item_applied_service_charge.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemAppliedServiceCharge(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_applied_tax.py b/src/square/types/order_line_item_applied_tax.py index 1db03f60..f43559f2 100644 --- a/src/square/types/order_line_item_applied_tax.py +++ b/src/square/types/order_line_item_applied_tax.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemAppliedTax(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_discount.py b/src/square/types/order_line_item_discount.py index 44379f12..d4bf409b 100644 --- a/src/square/types/order_line_item_discount.py +++ b/src/square/types/order_line_item_discount.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .order_line_item_discount_type import OrderLineItemDiscountType from .money import Money from .order_line_item_discount_scope import OrderLineItemDiscountScope -from .order_line_item_discount_type import OrderLineItemDiscountType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemDiscount(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_modifier.py b/src/square/types/order_line_item_modifier.py index 50888a8d..72b8cd97 100644 --- a/src/square/types/order_line_item_modifier.py +++ b/src/square/types/order_line_item_modifier.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemModifier(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_pricing_blocklists.py b/src/square/types/order_line_item_pricing_blocklists.py index e978da0f..9bdcb770 100644 --- a/src/square/types/order_line_item_pricing_blocklists.py +++ b/src/square/types/order_line_item_pricing_blocklists.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .order_line_item_pricing_blocklists_blocked_discount import OrderLineItemPricingBlocklistsBlockedDiscount +import pydantic from .order_line_item_pricing_blocklists_blocked_tax import OrderLineItemPricingBlocklistsBlockedTax +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemPricingBlocklists(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_pricing_blocklists_blocked_discount.py b/src/square/types/order_line_item_pricing_blocklists_blocked_discount.py index 7bb099e7..64767cba 100644 --- a/src/square/types/order_line_item_pricing_blocklists_blocked_discount.py +++ b/src/square/types/order_line_item_pricing_blocklists_blocked_discount.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class OrderLineItemPricingBlocklistsBlockedDiscount(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_pricing_blocklists_blocked_tax.py b/src/square/types/order_line_item_pricing_blocklists_blocked_tax.py index 8426582d..95047515 100644 --- a/src/square/types/order_line_item_pricing_blocklists_blocked_tax.py +++ b/src/square/types/order_line_item_pricing_blocklists_blocked_tax.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class OrderLineItemPricingBlocklistsBlockedTax(UncheckedBaseModel): diff --git a/src/square/types/order_line_item_tax.py b/src/square/types/order_line_item_tax.py index 3ded4046..1c30f056 100644 --- a/src/square/types/order_line_item_tax.py +++ b/src/square/types/order_line_item_tax.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .order_line_item_tax_type import OrderLineItemTaxType from .money import Money from .order_line_item_tax_scope import OrderLineItemTaxScope -from .order_line_item_tax_type import OrderLineItemTaxType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderLineItemTax(UncheckedBaseModel): diff --git a/src/square/types/order_money_amounts.py b/src/square/types/order_money_amounts.py index dfc6ef72..0e7e73de 100644 --- a/src/square/types/order_money_amounts.py +++ b/src/square/types/order_money_amounts.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .money import Money import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money class OrderMoneyAmounts(UncheckedBaseModel): diff --git a/src/square/types/order_pricing_options.py b/src/square/types/order_pricing_options.py index 358a8acb..47f2ee39 100644 --- a/src/square/types/order_pricing_options.py +++ b/src/square/types/order_pricing_options.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class OrderPricingOptions(UncheckedBaseModel): diff --git a/src/square/types/order_quantity_unit.py b/src/square/types/order_quantity_unit.py index 55918d8b..ae97717a 100644 --- a/src/square/types/order_quantity_unit.py +++ b/src/square/types/order_quantity_unit.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .measurement_unit import MeasurementUnit import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .measurement_unit import MeasurementUnit class OrderQuantityUnit(UncheckedBaseModel): diff --git a/src/square/types/order_return.py b/src/square/types/order_return.py index 2a62a7d1..3c6cc02b 100644 --- a/src/square/types/order_return.py +++ b/src/square/types/order_return.py @@ -1,17 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order_money_amounts import OrderMoneyAmounts -from .order_return_discount import OrderReturnDiscount from .order_return_line_item import OrderReturnLineItem from .order_return_service_charge import OrderReturnServiceCharge from .order_return_tax import OrderReturnTax +from .order_return_discount import OrderReturnDiscount from .order_return_tip import OrderReturnTip from .order_rounding_adjustment import OrderRoundingAdjustment +from .order_money_amounts import OrderMoneyAmounts +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturn(UncheckedBaseModel): diff --git a/src/square/types/order_return_discount.py b/src/square/types/order_return_discount.py index f2d1f703..22725a69 100644 --- a/src/square/types/order_return_discount.py +++ b/src/square/types/order_return_discount.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .order_line_item_discount_type import OrderLineItemDiscountType from .money import Money from .order_line_item_discount_scope import OrderLineItemDiscountScope -from .order_line_item_discount_type import OrderLineItemDiscountType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturnDiscount(UncheckedBaseModel): diff --git a/src/square/types/order_return_line_item.py b/src/square/types/order_return_line_item.py index d29033ba..168473c5 100644 --- a/src/square/types/order_return_line_item.py +++ b/src/square/types/order_return_line_item.py @@ -1,17 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money -from .order_line_item_applied_discount import OrderLineItemAppliedDiscount -from .order_line_item_applied_service_charge import OrderLineItemAppliedServiceCharge -from .order_line_item_applied_tax import OrderLineItemAppliedTax -from .order_line_item_item_type import OrderLineItemItemType from .order_quantity_unit import OrderQuantityUnit +from .order_line_item_item_type import OrderLineItemItemType from .order_return_line_item_modifier import OrderReturnLineItemModifier +from .order_line_item_applied_tax import OrderLineItemAppliedTax +from .order_line_item_applied_discount import OrderLineItemAppliedDiscount +from .money import Money +from .order_line_item_applied_service_charge import OrderLineItemAppliedServiceCharge +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturnLineItem(UncheckedBaseModel): diff --git a/src/square/types/order_return_line_item_modifier.py b/src/square/types/order_return_line_item_modifier.py index e2c8d1ae..f7b63131 100644 --- a/src/square/types/order_return_line_item_modifier.py +++ b/src/square/types/order_return_line_item_modifier.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturnLineItemModifier(UncheckedBaseModel): diff --git a/src/square/types/order_return_service_charge.py b/src/square/types/order_return_service_charge.py index 05897ff3..d5f1ac60 100644 --- a/src/square/types/order_return_service_charge.py +++ b/src/square/types/order_return_service_charge.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money -from .order_line_item_applied_tax import OrderLineItemAppliedTax from .order_service_charge_calculation_phase import OrderServiceChargeCalculationPhase -from .order_service_charge_scope import OrderServiceChargeScope +from .order_line_item_applied_tax import OrderLineItemAppliedTax from .order_service_charge_treatment_type import OrderServiceChargeTreatmentType +from .order_service_charge_scope import OrderServiceChargeScope +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturnServiceCharge(UncheckedBaseModel): diff --git a/src/square/types/order_return_tax.py b/src/square/types/order_return_tax.py index e7643418..5479b9d7 100644 --- a/src/square/types/order_return_tax.py +++ b/src/square/types/order_return_tax.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .order_line_item_tax_type import OrderLineItemTaxType from .money import Money from .order_line_item_tax_scope import OrderLineItemTaxScope -from .order_line_item_tax_type import OrderLineItemTaxType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturnTax(UncheckedBaseModel): diff --git a/src/square/types/order_return_tip.py b/src/square/types/order_return_tip.py index 6d053012..1a7ce590 100644 --- a/src/square/types/order_return_tip.py +++ b/src/square/types/order_return_tip.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderReturnTip(UncheckedBaseModel): diff --git a/src/square/types/order_reward.py b/src/square/types/order_reward.py index 7647b317..244ca36c 100644 --- a/src/square/types/order_reward.py +++ b/src/square/types/order_reward.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class OrderReward(UncheckedBaseModel): diff --git a/src/square/types/order_rounding_adjustment.py b/src/square/types/order_rounding_adjustment.py index 7a06e979..ef853e45 100644 --- a/src/square/types/order_rounding_adjustment.py +++ b/src/square/types/order_rounding_adjustment.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderRoundingAdjustment(UncheckedBaseModel): diff --git a/src/square/types/order_service_charge.py b/src/square/types/order_service_charge.py index ed4d657d..887a46d0 100644 --- a/src/square/types/order_service_charge.py +++ b/src/square/types/order_service_charge.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money -from .order_line_item_applied_tax import OrderLineItemAppliedTax from .order_service_charge_calculation_phase import OrderServiceChargeCalculationPhase -from .order_service_charge_scope import OrderServiceChargeScope -from .order_service_charge_treatment_type import OrderServiceChargeTreatmentType +from .order_line_item_applied_tax import OrderLineItemAppliedTax from .order_service_charge_type import OrderServiceChargeType +from .order_service_charge_treatment_type import OrderServiceChargeTreatmentType +from .order_service_charge_scope import OrderServiceChargeScope +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderServiceCharge(UncheckedBaseModel): diff --git a/src/square/types/order_source.py b/src/square/types/order_source.py index 10ff98a1..ec1345f1 100644 --- a/src/square/types/order_source.py +++ b/src/square/types/order_source.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class OrderSource(UncheckedBaseModel): diff --git a/src/square/types/order_updated.py b/src/square/types/order_updated.py index 23b8870c..03235a45 100644 --- a/src/square/types/order_updated.py +++ b/src/square/types/order_updated.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_state import OrderState +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderUpdated(UncheckedBaseModel): diff --git a/src/square/types/order_updated_event.py b/src/square/types/order_updated_event.py index 9747299c..f339fad0 100644 --- a/src/square/types/order_updated_event.py +++ b/src/square/types/order_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_updated_event_data import OrderUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/order_updated_event_data.py b/src/square/types/order_updated_event_data.py index eff47378..2197c796 100644 --- a/src/square/types/order_updated_event_data.py +++ b/src/square/types/order_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .order_updated_object import OrderUpdatedObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class OrderUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/order_updated_object.py b/src/square/types/order_updated_object.py index f828b8ea..144a4bfa 100644 --- a/src/square/types/order_updated_object.py +++ b/src/square/types/order_updated_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order_updated import OrderUpdated import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order_updated import OrderUpdated class OrderUpdatedObject(UncheckedBaseModel): diff --git a/src/square/types/pause_subscription_response.py b/src/square/types/pause_subscription_response.py index 629dd902..8d7181bd 100644 --- a/src/square/types/pause_subscription_response.py +++ b/src/square/types/pause_subscription_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription from .subscription_action import SubscriptionAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PauseSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/pay_order_response.py b/src/square/types/pay_order_response.py index a843bf2f..1bfb3ecf 100644 --- a/src/square/types/pay_order_response.py +++ b/src/square/types/pay_order_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayOrderResponse(UncheckedBaseModel): diff --git a/src/square/types/payment.py b/src/square/types/payment.py index 2ead708d..c13f5203 100644 --- a/src/square/types/payment.py +++ b/src/square/types/payment.py @@ -1,24 +1,23 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .address import Address -from .application_details import ApplicationDetails -from .bank_account_payment_details import BankAccountPaymentDetails -from .buy_now_pay_later_details import BuyNowPayLaterDetails +from .money import Money +from .processing_fee import ProcessingFee from .card_payment_details import CardPaymentDetails from .cash_payment_details import CashPaymentDetails -from .device_details import DeviceDetails -from .digital_wallet_details import DigitalWalletDetails +from .bank_account_payment_details import BankAccountPaymentDetails from .external_payment_details import ExternalPaymentDetails -from .money import Money -from .offline_payment_details import OfflinePaymentDetails -from .processing_fee import ProcessingFee -from .risk_evaluation import RiskEvaluation +from .digital_wallet_details import DigitalWalletDetails +from .buy_now_pay_later_details import BuyNowPayLaterDetails from .square_account_details import SquareAccountDetails +from .risk_evaluation import RiskEvaluation +from .address import Address +from .device_details import DeviceDetails +from .application_details import ApplicationDetails +from .offline_payment_details import OfflinePaymentDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Payment(UncheckedBaseModel): @@ -52,9 +51,7 @@ class Payment(UncheckedBaseModel): tip_money: typing.Optional[Money] = pydantic.Field(default=None) """ - The amount designated as a tip for the seller's staff. - - Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges. + The amount designated as a tip. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see diff --git a/src/square/types/payment_balance_activity_app_fee_refund_detail.py b/src/square/types/payment_balance_activity_app_fee_refund_detail.py index 5c3d7263..604033ab 100644 --- a/src/square/types/payment_balance_activity_app_fee_refund_detail.py +++ b/src/square/types/payment_balance_activity_app_fee_refund_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityAppFeeRefundDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_app_fee_revenue_detail.py b/src/square/types/payment_balance_activity_app_fee_revenue_detail.py index a9837c88..4f7b5ceb 100644 --- a/src/square/types/payment_balance_activity_app_fee_revenue_detail.py +++ b/src/square/types/payment_balance_activity_app_fee_revenue_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityAppFeeRevenueDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_automatic_savings_detail.py b/src/square/types/payment_balance_activity_automatic_savings_detail.py index 194e28a5..63aea8d9 100644 --- a/src/square/types/payment_balance_activity_automatic_savings_detail.py +++ b/src/square/types/payment_balance_activity_automatic_savings_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityAutomaticSavingsDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_automatic_savings_reversed_detail.py b/src/square/types/payment_balance_activity_automatic_savings_reversed_detail.py index 7dd72efb..5c9d7534 100644 --- a/src/square/types/payment_balance_activity_automatic_savings_reversed_detail.py +++ b/src/square/types/payment_balance_activity_automatic_savings_reversed_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityAutomaticSavingsReversedDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_charge_detail.py b/src/square/types/payment_balance_activity_charge_detail.py index 68f4eb03..14165a91 100644 --- a/src/square/types/payment_balance_activity_charge_detail.py +++ b/src/square/types/payment_balance_activity_charge_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityChargeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_deposit_fee_detail.py b/src/square/types/payment_balance_activity_deposit_fee_detail.py index e5512efd..0e3eee97 100644 --- a/src/square/types/payment_balance_activity_deposit_fee_detail.py +++ b/src/square/types/payment_balance_activity_deposit_fee_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityDepositFeeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_deposit_fee_reversed_detail.py b/src/square/types/payment_balance_activity_deposit_fee_reversed_detail.py index fe0862be..688a29e3 100644 --- a/src/square/types/payment_balance_activity_deposit_fee_reversed_detail.py +++ b/src/square/types/payment_balance_activity_deposit_fee_reversed_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityDepositFeeReversedDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_dispute_detail.py b/src/square/types/payment_balance_activity_dispute_detail.py index 76d9d5cd..529c7c80 100644 --- a/src/square/types/payment_balance_activity_dispute_detail.py +++ b/src/square/types/payment_balance_activity_dispute_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityDisputeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_fee_detail.py b/src/square/types/payment_balance_activity_fee_detail.py index 021ce622..4453b601 100644 --- a/src/square/types/payment_balance_activity_fee_detail.py +++ b/src/square/types/payment_balance_activity_fee_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityFeeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_free_processing_detail.py b/src/square/types/payment_balance_activity_free_processing_detail.py index ae7bf838..545d2b2f 100644 --- a/src/square/types/payment_balance_activity_free_processing_detail.py +++ b/src/square/types/payment_balance_activity_free_processing_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityFreeProcessingDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_hold_adjustment_detail.py b/src/square/types/payment_balance_activity_hold_adjustment_detail.py index d338e95b..a64024d3 100644 --- a/src/square/types/payment_balance_activity_hold_adjustment_detail.py +++ b/src/square/types/payment_balance_activity_hold_adjustment_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityHoldAdjustmentDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_open_dispute_detail.py b/src/square/types/payment_balance_activity_open_dispute_detail.py index 7ebc669c..6f1f9628 100644 --- a/src/square/types/payment_balance_activity_open_dispute_detail.py +++ b/src/square/types/payment_balance_activity_open_dispute_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityOpenDisputeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_other_adjustment_detail.py b/src/square/types/payment_balance_activity_other_adjustment_detail.py index c7467d04..6fff84b7 100644 --- a/src/square/types/payment_balance_activity_other_adjustment_detail.py +++ b/src/square/types/payment_balance_activity_other_adjustment_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityOtherAdjustmentDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_other_detail.py b/src/square/types/payment_balance_activity_other_detail.py index f10f0494..3b63d70b 100644 --- a/src/square/types/payment_balance_activity_other_detail.py +++ b/src/square/types/payment_balance_activity_other_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityOtherDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_refund_detail.py b/src/square/types/payment_balance_activity_refund_detail.py index 808111c8..a23f7dad 100644 --- a/src/square/types/payment_balance_activity_refund_detail.py +++ b/src/square/types/payment_balance_activity_refund_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityRefundDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_release_adjustment_detail.py b/src/square/types/payment_balance_activity_release_adjustment_detail.py index 0b9b61a2..f2eb2bbf 100644 --- a/src/square/types/payment_balance_activity_release_adjustment_detail.py +++ b/src/square/types/payment_balance_activity_release_adjustment_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityReleaseAdjustmentDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_reserve_hold_detail.py b/src/square/types/payment_balance_activity_reserve_hold_detail.py index 12be4de0..cfb81ba9 100644 --- a/src/square/types/payment_balance_activity_reserve_hold_detail.py +++ b/src/square/types/payment_balance_activity_reserve_hold_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityReserveHoldDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_reserve_release_detail.py b/src/square/types/payment_balance_activity_reserve_release_detail.py index bfe662e5..ab7a4c54 100644 --- a/src/square/types/payment_balance_activity_reserve_release_detail.py +++ b/src/square/types/payment_balance_activity_reserve_release_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityReserveReleaseDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_square_capital_payment_detail.py b/src/square/types/payment_balance_activity_square_capital_payment_detail.py index 670d0735..b198bba5 100644 --- a/src/square/types/payment_balance_activity_square_capital_payment_detail.py +++ b/src/square/types/payment_balance_activity_square_capital_payment_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivitySquareCapitalPaymentDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_square_capital_reversed_payment_detail.py b/src/square/types/payment_balance_activity_square_capital_reversed_payment_detail.py index e09b3e2b..f19c008f 100644 --- a/src/square/types/payment_balance_activity_square_capital_reversed_payment_detail.py +++ b/src/square/types/payment_balance_activity_square_capital_reversed_payment_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivitySquareCapitalReversedPaymentDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_square_payroll_transfer_detail.py b/src/square/types/payment_balance_activity_square_payroll_transfer_detail.py index 2e72a3fc..82368631 100644 --- a/src/square/types/payment_balance_activity_square_payroll_transfer_detail.py +++ b/src/square/types/payment_balance_activity_square_payroll_transfer_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivitySquarePayrollTransferDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.py b/src/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.py index ccd86445..5c0c983f 100644 --- a/src/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.py +++ b/src/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivitySquarePayrollTransferReversedDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_tax_on_fee_detail.py b/src/square/types/payment_balance_activity_tax_on_fee_detail.py index f979d002..115e8334 100644 --- a/src/square/types/payment_balance_activity_tax_on_fee_detail.py +++ b/src/square/types/payment_balance_activity_tax_on_fee_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityTaxOnFeeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_third_party_fee_detail.py b/src/square/types/payment_balance_activity_third_party_fee_detail.py index 156925fb..ebbf52df 100644 --- a/src/square/types/payment_balance_activity_third_party_fee_detail.py +++ b/src/square/types/payment_balance_activity_third_party_fee_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityThirdPartyFeeDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_balance_activity_third_party_fee_refund_detail.py b/src/square/types/payment_balance_activity_third_party_fee_refund_detail.py index 2242799f..6952de9c 100644 --- a/src/square/types/payment_balance_activity_third_party_fee_refund_detail.py +++ b/src/square/types/payment_balance_activity_third_party_fee_refund_detail.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PaymentBalanceActivityThirdPartyFeeRefundDetail(UncheckedBaseModel): diff --git a/src/square/types/payment_created_event.py b/src/square/types/payment_created_event.py index 4c648880..ab79a811 100644 --- a/src/square/types/payment_created_event.py +++ b/src/square/types/payment_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payment_created_event_data import PaymentCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/payment_created_event_data.py b/src/square/types/payment_created_event_data.py index 44f4d192..2b23779a 100644 --- a/src/square/types/payment_created_event_data.py +++ b/src/square/types/payment_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payment_created_event_object import PaymentCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/payment_created_event_object.py b/src/square/types/payment_created_event_object.py index acd369e6..d5a95458 100644 --- a/src/square/types/payment_created_event_object.py +++ b/src/square/types/payment_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payment import Payment import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payment import Payment class PaymentCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/payment_link.py b/src/square/types/payment_link.py index 69fb541e..ed449bf8 100644 --- a/src/square/types/payment_link.py +++ b/src/square/types/payment_link.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .checkout_options import CheckoutOptions from .pre_populated_data import PrePopulatedData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentLink(UncheckedBaseModel): diff --git a/src/square/types/payment_link_related_resources.py b/src/square/types/payment_link_related_resources.py index d7e4ebb8..03a09dd3 100644 --- a/src/square/types/payment_link_related_resources.py +++ b/src/square/types/payment_link_related_resources.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .order import Order +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentLinkRelatedResources(UncheckedBaseModel): @@ -16,7 +24,7 @@ class PaymentLinkRelatedResources(UncheckedBaseModel): The order associated with the payment link. """ - subscription_plans: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + subscription_plans: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ The subscription plan associated with the payment link. """ @@ -29,18 +37,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - PaymentLinkRelatedResources, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/payment_options.py b/src/square/types/payment_options.py index f08ebf6e..b2df7da8 100644 --- a/src/square/types/payment_options.py +++ b/src/square/types/payment_options.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payment_options_delay_action import PaymentOptionsDelayAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentOptions(UncheckedBaseModel): diff --git a/src/square/types/payment_refund.py b/src/square/types/payment_refund.py index d8ca22d5..25669f65 100644 --- a/src/square/types/payment_refund.py +++ b/src/square/types/payment_refund.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .destination_details import DestinationDetails from .money import Money from .processing_fee import ProcessingFee +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentRefund(UncheckedBaseModel): diff --git a/src/square/types/payment_updated_event.py b/src/square/types/payment_updated_event.py index 7d2a7bd1..c0780100 100644 --- a/src/square/types/payment_updated_event.py +++ b/src/square/types/payment_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payment_updated_event_data import PaymentUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/payment_updated_event_data.py b/src/square/types/payment_updated_event_data.py index 0b03f8e2..67f89b89 100644 --- a/src/square/types/payment_updated_event_data.py +++ b/src/square/types/payment_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payment_updated_event_object import PaymentUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PaymentUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/payment_updated_event_object.py b/src/square/types/payment_updated_event_object.py index 678e0714..eca63951 100644 --- a/src/square/types/payment_updated_event_object.py +++ b/src/square/types/payment_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payment import Payment import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payment import Payment class PaymentUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/payout.py b/src/square/types/payout.py index 558e8b94..1ba629d3 100644 --- a/src/square/types/payout.py +++ b/src/square/types/payout.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .destination import Destination -from .money import Money -from .payout_fee import PayoutFee +import pydantic +import typing from .payout_status import PayoutStatus +from .money import Money +from .destination import Destination from .payout_type import PayoutType +from .payout_fee import PayoutFee +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Payout(UncheckedBaseModel): diff --git a/src/square/types/payout_entry.py b/src/square/types/payout_entry.py index e2e402bf..3e5c206b 100644 --- a/src/square/types/payout_entry.py +++ b/src/square/types/payout_entry.py @@ -1,14 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .activity_type import ActivityType from .money import Money -from .payment_balance_activity_app_fee_refund_detail import PaymentBalanceActivityAppFeeRefundDetail from .payment_balance_activity_app_fee_revenue_detail import PaymentBalanceActivityAppFeeRevenueDetail +from .payment_balance_activity_app_fee_refund_detail import PaymentBalanceActivityAppFeeRefundDetail from .payment_balance_activity_automatic_savings_detail import PaymentBalanceActivityAutomaticSavingsDetail from .payment_balance_activity_automatic_savings_reversed_detail import ( PaymentBalanceActivityAutomaticSavingsReversedDetail, @@ -21,8 +19,8 @@ from .payment_balance_activity_free_processing_detail import PaymentBalanceActivityFreeProcessingDetail from .payment_balance_activity_hold_adjustment_detail import PaymentBalanceActivityHoldAdjustmentDetail from .payment_balance_activity_open_dispute_detail import PaymentBalanceActivityOpenDisputeDetail -from .payment_balance_activity_other_adjustment_detail import PaymentBalanceActivityOtherAdjustmentDetail from .payment_balance_activity_other_detail import PaymentBalanceActivityOtherDetail +from .payment_balance_activity_other_adjustment_detail import PaymentBalanceActivityOtherAdjustmentDetail from .payment_balance_activity_refund_detail import PaymentBalanceActivityRefundDetail from .payment_balance_activity_release_adjustment_detail import PaymentBalanceActivityReleaseAdjustmentDetail from .payment_balance_activity_reserve_hold_detail import PaymentBalanceActivityReserveHoldDetail @@ -31,13 +29,14 @@ from .payment_balance_activity_square_capital_reversed_payment_detail import ( PaymentBalanceActivitySquareCapitalReversedPaymentDetail, ) +from .payment_balance_activity_tax_on_fee_detail import PaymentBalanceActivityTaxOnFeeDetail +from .payment_balance_activity_third_party_fee_detail import PaymentBalanceActivityThirdPartyFeeDetail +from .payment_balance_activity_third_party_fee_refund_detail import PaymentBalanceActivityThirdPartyFeeRefundDetail from .payment_balance_activity_square_payroll_transfer_detail import PaymentBalanceActivitySquarePayrollTransferDetail from .payment_balance_activity_square_payroll_transfer_reversed_detail import ( PaymentBalanceActivitySquarePayrollTransferReversedDetail, ) -from .payment_balance_activity_tax_on_fee_detail import PaymentBalanceActivityTaxOnFeeDetail -from .payment_balance_activity_third_party_fee_detail import PaymentBalanceActivityThirdPartyFeeDetail -from .payment_balance_activity_third_party_fee_refund_detail import PaymentBalanceActivityThirdPartyFeeRefundDetail +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutEntry(UncheckedBaseModel): diff --git a/src/square/types/payout_failed_event.py b/src/square/types/payout_failed_event.py index 44ca89f1..68fb4841 100644 --- a/src/square/types/payout_failed_event.py +++ b/src/square/types/payout_failed_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payout_failed_event_data import PayoutFailedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutFailedEvent(UncheckedBaseModel): diff --git a/src/square/types/payout_failed_event_data.py b/src/square/types/payout_failed_event_data.py index bd105d40..98f95536 100644 --- a/src/square/types/payout_failed_event_data.py +++ b/src/square/types/payout_failed_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payout_failed_event_object import PayoutFailedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutFailedEventData(UncheckedBaseModel): diff --git a/src/square/types/payout_failed_event_object.py b/src/square/types/payout_failed_event_object.py index 1ad87b7e..fee208f4 100644 --- a/src/square/types/payout_failed_event_object.py +++ b/src/square/types/payout_failed_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payout import Payout import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payout import Payout class PayoutFailedEventObject(UncheckedBaseModel): diff --git a/src/square/types/payout_fee.py b/src/square/types/payout_fee.py index a7405bdf..68ac46dc 100644 --- a/src/square/types/payout_fee.py +++ b/src/square/types/payout_fee.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .money import Money +import pydantic from .payout_fee_type import PayoutFeeType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutFee(UncheckedBaseModel): diff --git a/src/square/types/payout_paid_event.py b/src/square/types/payout_paid_event.py index bcfed920..814ed56e 100644 --- a/src/square/types/payout_paid_event.py +++ b/src/square/types/payout_paid_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payout_paid_event_data import PayoutPaidEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutPaidEvent(UncheckedBaseModel): diff --git a/src/square/types/payout_paid_event_data.py b/src/square/types/payout_paid_event_data.py index 93c770e5..572eb1de 100644 --- a/src/square/types/payout_paid_event_data.py +++ b/src/square/types/payout_paid_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payout_paid_event_object import PayoutPaidEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutPaidEventData(UncheckedBaseModel): diff --git a/src/square/types/payout_paid_event_object.py b/src/square/types/payout_paid_event_object.py index cb61272f..5e6cf68e 100644 --- a/src/square/types/payout_paid_event_object.py +++ b/src/square/types/payout_paid_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payout import Payout import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payout import Payout class PayoutPaidEventObject(UncheckedBaseModel): diff --git a/src/square/types/payout_sent_event.py b/src/square/types/payout_sent_event.py index 28a70d55..4584fac7 100644 --- a/src/square/types/payout_sent_event.py +++ b/src/square/types/payout_sent_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payout_sent_event_data import PayoutSentEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutSentEvent(UncheckedBaseModel): diff --git a/src/square/types/payout_sent_event_data.py b/src/square/types/payout_sent_event_data.py index 6fbceed3..e6f4d5ac 100644 --- a/src/square/types/payout_sent_event_data.py +++ b/src/square/types/payout_sent_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .payout_sent_event_object import PayoutSentEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PayoutSentEventData(UncheckedBaseModel): diff --git a/src/square/types/payout_sent_event_object.py b/src/square/types/payout_sent_event_object.py index 9260f305..3dbbe2c9 100644 --- a/src/square/types/payout_sent_event_object.py +++ b/src/square/types/payout_sent_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payout import Payout import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payout import Payout class PayoutSentEventObject(UncheckedBaseModel): diff --git a/src/square/types/phase.py b/src/square/types/phase.py index 8c14da28..10831034 100644 --- a/src/square/types/phase.py +++ b/src/square/types/phase.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Phase(UncheckedBaseModel): diff --git a/src/square/types/phase_input.py b/src/square/types/phase_input.py index e7700065..88cf50e0 100644 --- a/src/square/types/phase_input.py +++ b/src/square/types/phase_input.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class PhaseInput(UncheckedBaseModel): diff --git a/src/square/types/pre_populated_data.py b/src/square/types/pre_populated_data.py index e5b5142d..1519304b 100644 --- a/src/square/types/pre_populated_data.py +++ b/src/square/types/pre_populated_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PrePopulatedData(UncheckedBaseModel): diff --git a/src/square/types/processing_fee.py b/src/square/types/processing_fee.py index 611c13a3..d80dba0b 100644 --- a/src/square/types/processing_fee.py +++ b/src/square/types/processing_fee.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ProcessingFee(UncheckedBaseModel): diff --git a/src/square/types/publish_invoice_response.py b/src/square/types/publish_invoice_response.py index 655e9336..5daa7639 100644 --- a/src/square/types/publish_invoice_response.py +++ b/src/square/types/publish_invoice_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PublishInvoiceResponse(UncheckedBaseModel): diff --git a/src/square/types/publish_scheduled_shift_response.py b/src/square/types/publish_scheduled_shift_response.py index 8ef96d33..01dfdd04 100644 --- a/src/square/types/publish_scheduled_shift_response.py +++ b/src/square/types/publish_scheduled_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .scheduled_shift import ScheduledShift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .scheduled_shift import ScheduledShift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class PublishScheduledShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/qr_code_options.py b/src/square/types/qr_code_options.py index 563871cc..dafd496e 100644 --- a/src/square/types/qr_code_options.py +++ b/src/square/types/qr_code_options.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class QrCodeOptions(UncheckedBaseModel): diff --git a/src/square/types/quick_pay.py b/src/square/types/quick_pay.py index 5fd63b19..30848383 100644 --- a/src/square/types/quick_pay.py +++ b/src/square/types/quick_pay.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class QuickPay(UncheckedBaseModel): diff --git a/src/square/types/range.py b/src/square/types/range.py index 255ce500..fb2ed0c0 100644 --- a/src/square/types/range.py +++ b/src/square/types/range.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Range(UncheckedBaseModel): diff --git a/src/square/types/receipt_options.py b/src/square/types/receipt_options.py index 9d2297a7..2d9b6389 100644 --- a/src/square/types/receipt_options.py +++ b/src/square/types/receipt_options.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class ReceiptOptions(UncheckedBaseModel): diff --git a/src/square/types/receive_transfer_order_response.py b/src/square/types/receive_transfer_order_response.py deleted file mode 100644 index 635ffde3..00000000 --- a/src/square/types/receive_transfer_order_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class ReceiveTransferOrderResponse(UncheckedBaseModel): - """ - Response for receiving items for a transfer order - """ - - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The updated transfer order - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/redeem_loyalty_reward_response.py b/src/square/types/redeem_loyalty_reward_response.py index 1a14280c..93d60562 100644 --- a/src/square/types/redeem_loyalty_reward_response.py +++ b/src/square/types/redeem_loyalty_reward_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_event import LoyaltyEvent +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RedeemLoyaltyRewardResponse(UncheckedBaseModel): diff --git a/src/square/types/reference.py b/src/square/types/reference.py deleted file mode 100644 index b07a6e88..00000000 --- a/src/square/types/reference.py +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .reference_type import ReferenceType - - -class Reference(UncheckedBaseModel): - type: typing.Optional[ReferenceType] = pydantic.Field(default=None) - """ - The type of entity a channel is associated with. - See [Type](#type-type) for possible values - """ - - id: typing.Optional[str] = pydantic.Field(default=None) - """ - The id of the entity a channel is associated with. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/reference_type.py b/src/square/types/reference_type.py deleted file mode 100644 index 6b8b82ec..00000000 --- a/src/square/types/reference_type.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ReferenceType = typing.Union[ - typing.Literal[ - "UNKNOWN_TYPE", - "LOCATION", - "FIRST_PARTY_INTEGRATION", - "OAUTH_APPLICATION", - "ONLINE_SITE", - "ONLINE_CHECKOUT", - "INVOICE", - "GIFT_CARD", - "GIFT_CARD_MARKETPLACE", - "RECURRING_SUBSCRIPTION", - "ONLINE_BOOKING_FLOW", - "SQUARE_ASSISTANT", - "CASH_LOCAL", - "POINT_OF_SALE", - "KIOSK", - ], - typing.Any, -] diff --git a/src/square/types/refund.py b/src/square/types/refund.py index b1c67432..67ddcd48 100644 --- a/src/square/types/refund.py +++ b/src/square/types/refund.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .additional_recipient import AdditionalRecipient +import pydantic +import typing from .money import Money from .refund_status import RefundStatus +from .additional_recipient import AdditionalRecipient +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Refund(UncheckedBaseModel): diff --git a/src/square/types/refund_created_event.py b/src/square/types/refund_created_event.py index f491d1ee..630a7d74 100644 --- a/src/square/types/refund_created_event.py +++ b/src/square/types/refund_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .refund_created_event_data import RefundCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RefundCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/refund_created_event_data.py b/src/square/types/refund_created_event_data.py index 0f0bdbcf..81aed93b 100644 --- a/src/square/types/refund_created_event_data.py +++ b/src/square/types/refund_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .refund_created_event_object import RefundCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RefundCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/refund_created_event_object.py b/src/square/types/refund_created_event_object.py index ed80cb70..4d841ab6 100644 --- a/src/square/types/refund_created_event_object.py +++ b/src/square/types/refund_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payment_refund import PaymentRefund import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payment_refund import PaymentRefund class RefundCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/refund_payment_response.py b/src/square/types/refund_payment_response.py index 491b3518..b2bbd941 100644 --- a/src/square/types/refund_payment_response.py +++ b/src/square/types/refund_payment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment_refund import PaymentRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RefundPaymentResponse(UncheckedBaseModel): diff --git a/src/square/types/refund_updated_event.py b/src/square/types/refund_updated_event.py index c2f377a9..184a232a 100644 --- a/src/square/types/refund_updated_event.py +++ b/src/square/types/refund_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .refund_updated_event_data import RefundUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RefundUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/refund_updated_event_data.py b/src/square/types/refund_updated_event_data.py index d6e1962e..2886110b 100644 --- a/src/square/types/refund_updated_event_data.py +++ b/src/square/types/refund_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .refund_updated_event_object import RefundUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RefundUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/refund_updated_event_object.py b/src/square/types/refund_updated_event_object.py index 2b3499b5..f52b0ac1 100644 --- a/src/square/types/refund_updated_event_object.py +++ b/src/square/types/refund_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .payment_refund import PaymentRefund import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .payment_refund import PaymentRefund class RefundUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/register_domain_response.py b/src/square/types/register_domain_response.py index 2ed831f4..665f01de 100644 --- a/src/square/types/register_domain_response.py +++ b/src/square/types/register_domain_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .register_domain_response_status import RegisterDomainResponseStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RegisterDomainResponse(UncheckedBaseModel): diff --git a/src/square/types/remove_group_from_customer_response.py b/src/square/types/remove_group_from_customer_response.py index fbaf140e..573269e1 100644 --- a/src/square/types/remove_group_from_customer_response.py +++ b/src/square/types/remove_group_from_customer_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class RemoveGroupFromCustomerResponse(UncheckedBaseModel): diff --git a/src/square/types/resume_subscription_response.py b/src/square/types/resume_subscription_response.py index e9f65e94..6c16a406 100644 --- a/src/square/types/resume_subscription_response.py +++ b/src/square/types/resume_subscription_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription from .subscription_action import SubscriptionAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ResumeSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_booking_custom_attribute_definition_response.py b/src/square/types/retrieve_booking_custom_attribute_definition_response.py index 33b225ed..2a29bff1 100644 --- a/src/square/types/retrieve_booking_custom_attribute_definition_response.py +++ b/src/square/types/retrieve_booking_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveBookingCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_booking_custom_attribute_response.py b/src/square/types/retrieve_booking_custom_attribute_response.py index f22deff5..789c2da7 100644 --- a/src/square/types/retrieve_booking_custom_attribute_response.py +++ b/src/square/types/retrieve_booking_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveBookingCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_channel_response.py b/src/square/types/retrieve_channel_response.py deleted file mode 100644 index c8c9d8e3..00000000 --- a/src/square/types/retrieve_channel_response.py +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .channel import Channel -from .error import Error - - -class RetrieveChannelResponse(UncheckedBaseModel): - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Information about errors encountered during the request. - """ - - channel: typing.Optional[Channel] = pydantic.Field(default=None) - """ - The requested Channel. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/retrieve_job_response.py b/src/square/types/retrieve_job_response.py index 62ce4252..653b8d1c 100644 --- a/src/square/types/retrieve_job_response.py +++ b/src/square/types/retrieve_job_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .job import Job import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .job import Job +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveJobResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_location_booking_profile_response.py b/src/square/types/retrieve_location_booking_profile_response.py index 5d100846..06b327cd 100644 --- a/src/square/types/retrieve_location_booking_profile_response.py +++ b/src/square/types/retrieve_location_booking_profile_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .location_booking_profile import LocationBookingProfile import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .location_booking_profile import LocationBookingProfile +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveLocationBookingProfileResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_location_custom_attribute_definition_response.py b/src/square/types/retrieve_location_custom_attribute_definition_response.py index 73bc8bcf..b877ec2f 100644 --- a/src/square/types/retrieve_location_custom_attribute_definition_response.py +++ b/src/square/types/retrieve_location_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveLocationCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_location_custom_attribute_response.py b/src/square/types/retrieve_location_custom_attribute_response.py index 0bc149d2..017d6191 100644 --- a/src/square/types/retrieve_location_custom_attribute_response.py +++ b/src/square/types/retrieve_location_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveLocationCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_location_settings_response.py b/src/square/types/retrieve_location_settings_response.py index ee467a57..27d70176 100644 --- a/src/square/types/retrieve_location_settings_response.py +++ b/src/square/types/retrieve_location_settings_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .checkout_location_settings import CheckoutLocationSettings -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveLocationSettingsResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_merchant_custom_attribute_definition_response.py b/src/square/types/retrieve_merchant_custom_attribute_definition_response.py index 12cc6468..3e55a525 100644 --- a/src/square/types/retrieve_merchant_custom_attribute_definition_response.py +++ b/src/square/types/retrieve_merchant_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveMerchantCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_merchant_custom_attribute_response.py b/src/square/types/retrieve_merchant_custom_attribute_response.py index 92bf2585..ef44cec8 100644 --- a/src/square/types/retrieve_merchant_custom_attribute_response.py +++ b/src/square/types/retrieve_merchant_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveMerchantCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_merchant_settings_response.py b/src/square/types/retrieve_merchant_settings_response.py index d651c1a0..8128faab 100644 --- a/src/square/types/retrieve_merchant_settings_response.py +++ b/src/square/types/retrieve_merchant_settings_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .checkout_merchant_settings import CheckoutMerchantSettings -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveMerchantSettingsResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_order_custom_attribute_definition_response.py b/src/square/types/retrieve_order_custom_attribute_definition_response.py index 8690e34b..058f8bc4 100644 --- a/src/square/types/retrieve_order_custom_attribute_definition_response.py +++ b/src/square/types/retrieve_order_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveOrderCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_order_custom_attribute_response.py b/src/square/types/retrieve_order_custom_attribute_response.py index 482c2fbb..65e111db 100644 --- a/src/square/types/retrieve_order_custom_attribute_response.py +++ b/src/square/types/retrieve_order_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveOrderCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_scheduled_shift_response.py b/src/square/types/retrieve_scheduled_shift_response.py index 46b49a28..af04b22d 100644 --- a/src/square/types/retrieve_scheduled_shift_response.py +++ b/src/square/types/retrieve_scheduled_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .scheduled_shift import ScheduledShift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .scheduled_shift import ScheduledShift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveScheduledShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_timecard_response.py b/src/square/types/retrieve_timecard_response.py index 7acfa5fd..f9491bf7 100644 --- a/src/square/types/retrieve_timecard_response.py +++ b/src/square/types/retrieve_timecard_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard import Timecard import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .timecard import Timecard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveTimecardResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_token_status_response.py b/src/square/types/retrieve_token_status_response.py index 1bdc92b4..6f723947 100644 --- a/src/square/types/retrieve_token_status_response.py +++ b/src/square/types/retrieve_token_status_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RetrieveTokenStatusResponse(UncheckedBaseModel): diff --git a/src/square/types/retrieve_transfer_order_response.py b/src/square/types/retrieve_transfer_order_response.py deleted file mode 100644 index df629ead..00000000 --- a/src/square/types/retrieve_transfer_order_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class RetrieveTransferOrderResponse(UncheckedBaseModel): - """ - Response containing the requested transfer order - """ - - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The requested transfer order - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/revoke_token_response.py b/src/square/types/revoke_token_response.py index 84b07a15..736eb37a 100644 --- a/src/square/types/revoke_token_response.py +++ b/src/square/types/revoke_token_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RevokeTokenResponse(UncheckedBaseModel): diff --git a/src/square/types/risk_evaluation.py b/src/square/types/risk_evaluation.py index 0aae9651..53301ef7 100644 --- a/src/square/types/risk_evaluation.py +++ b/src/square/types/risk_evaluation.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .risk_evaluation_risk_level import RiskEvaluationRiskLevel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class RiskEvaluation(UncheckedBaseModel): diff --git a/src/square/types/save_card_options.py b/src/square/types/save_card_options.py index e4c0e5c7..477320bb 100644 --- a/src/square/types/save_card_options.py +++ b/src/square/types/save_card_options.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic +import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SaveCardOptions(UncheckedBaseModel): diff --git a/src/square/types/scheduled_shift.py b/src/square/types/scheduled_shift.py index b7a53661..f5df0727 100644 --- a/src/square/types/scheduled_shift.py +++ b/src/square/types/scheduled_shift.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .scheduled_shift_details import ScheduledShiftDetails +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ScheduledShift(UncheckedBaseModel): diff --git a/src/square/types/scheduled_shift_details.py b/src/square/types/scheduled_shift_details.py index a7983f98..24d19b63 100644 --- a/src/square/types/scheduled_shift_details.py +++ b/src/square/types/scheduled_shift_details.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class ScheduledShiftDetails(UncheckedBaseModel): diff --git a/src/square/types/scheduled_shift_filter.py b/src/square/types/scheduled_shift_filter.py index 964db084..f1319355 100644 --- a/src/square/types/scheduled_shift_filter.py +++ b/src/square/types/scheduled_shift_filter.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .time_range import TimeRange +from .scheduled_shift_workday import ScheduledShiftWorkday from .scheduled_shift_filter_assignment_status import ScheduledShiftFilterAssignmentStatus from .scheduled_shift_filter_scheduled_shift_status import ScheduledShiftFilterScheduledShiftStatus -from .scheduled_shift_workday import ScheduledShiftWorkday -from .time_range import TimeRange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ScheduledShiftFilter(UncheckedBaseModel): diff --git a/src/square/types/scheduled_shift_query.py b/src/square/types/scheduled_shift_query.py index ebf8ede1..6c0f0166 100644 --- a/src/square/types/scheduled_shift_query.py +++ b/src/square/types/scheduled_shift_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .scheduled_shift_filter import ScheduledShiftFilter +import pydantic from .scheduled_shift_sort import ScheduledShiftSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ScheduledShiftQuery(UncheckedBaseModel): diff --git a/src/square/types/scheduled_shift_sort.py b/src/square/types/scheduled_shift_sort.py index 0fce7b00..a4cd8c9c 100644 --- a/src/square/types/scheduled_shift_sort.py +++ b/src/square/types/scheduled_shift_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .scheduled_shift_sort_field import ScheduledShiftSortField +import pydantic from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ScheduledShiftSort(UncheckedBaseModel): diff --git a/src/square/types/scheduled_shift_workday.py b/src/square/types/scheduled_shift_workday.py index cb6c67df..d5ef0dff 100644 --- a/src/square/types/scheduled_shift_workday.py +++ b/src/square/types/scheduled_shift_workday.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .date_range import DateRange +import pydantic from .scheduled_shift_workday_matcher import ScheduledShiftWorkdayMatcher +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ScheduledShiftWorkday(UncheckedBaseModel): diff --git a/src/square/types/search_availability_filter.py b/src/square/types/search_availability_filter.py index a5199b03..6e7ef5ab 100644 --- a/src/square/types/search_availability_filter.py +++ b/src/square/types/search_availability_filter.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .segment_filter import SegmentFilter from .time_range import TimeRange +import pydantic +import typing +from .segment_filter import SegmentFilter +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchAvailabilityFilter(UncheckedBaseModel): diff --git a/src/square/types/search_availability_query.py b/src/square/types/search_availability_query.py index 687927ff..04cb8413 100644 --- a/src/square/types/search_availability_query.py +++ b/src/square/types/search_availability_query.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .search_availability_filter import SearchAvailabilityFilter +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class SearchAvailabilityQuery(UncheckedBaseModel): diff --git a/src/square/types/search_availability_response.py b/src/square/types/search_availability_response.py index 1caf0388..241920f1 100644 --- a/src/square/types/search_availability_response.py +++ b/src/square/types/search_availability_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .availability import Availability +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchAvailabilityResponse(UncheckedBaseModel): diff --git a/src/square/types/search_catalog_items_response.py b/src/square/types/search_catalog_items_response.py index 1f8e338f..e69f2893 100644 --- a/src/square/types/search_catalog_items_response.py +++ b/src/square/types/search_catalog_items_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchCatalogItemsResponse(UncheckedBaseModel): @@ -20,7 +28,7 @@ class SearchCatalogItemsResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - items: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + items: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ Returned items matching the specified query expressions. """ @@ -43,18 +51,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - SearchCatalogItemsResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/search_catalog_objects_response.py b/src/square/types/search_catalog_objects_response.py index e9af821e..909afd50 100644 --- a/src/square/types/search_catalog_objects_response.py +++ b/src/square/types/search_catalog_objects_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchCatalogObjectsResponse(UncheckedBaseModel): @@ -22,12 +30,12 @@ class SearchCatalogObjectsResponse(UncheckedBaseModel): See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. """ - objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ The CatalogObjects returned. """ - related_objects: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None) + related_objects: typing.Optional[typing.List[CatalogObject]] = pydantic.Field(default=None) """ A list of CatalogObjects referenced by the objects in the `objects` field. """ @@ -46,18 +54,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - SearchCatalogObjectsResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/search_customers_response.py b/src/square/types/search_customers_response.py index 62cb756a..519220a1 100644 --- a/src/square/types/search_customers_response.py +++ b/src/square/types/search_customers_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer import Customer -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchCustomersResponse(UncheckedBaseModel): diff --git a/src/square/types/search_events_filter.py b/src/square/types/search_events_filter.py index df8abc0a..92ed7fa2 100644 --- a/src/square/types/search_events_filter.py +++ b/src/square/types/search_events_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .time_range import TimeRange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchEventsFilter(UncheckedBaseModel): diff --git a/src/square/types/search_events_query.py b/src/square/types/search_events_query.py index e5d2714a..f0ef217e 100644 --- a/src/square/types/search_events_query.py +++ b/src/square/types/search_events_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .search_events_filter import SearchEventsFilter +import pydantic from .search_events_sort import SearchEventsSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchEventsQuery(UncheckedBaseModel): diff --git a/src/square/types/search_events_response.py b/src/square/types/search_events_response.py index 60de5720..87b7ba17 100644 --- a/src/square/types/search_events_response.py +++ b/src/square/types/search_events_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .event import Event from .event_metadata import EventMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchEventsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_events_sort.py b/src/square/types/search_events_sort.py index c19d2a6f..80fa5d0e 100644 --- a/src/square/types/search_events_sort.py +++ b/src/square/types/search_events_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .search_events_sort_field import SearchEventsSortField +import pydantic from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchEventsSort(UncheckedBaseModel): diff --git a/src/square/types/search_invoices_response.py b/src/square/types/search_invoices_response.py index f1667c80..3127f917 100644 --- a/src/square/types/search_invoices_response.py +++ b/src/square/types/search_invoices_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchInvoicesResponse(UncheckedBaseModel): diff --git a/src/square/types/search_loyalty_accounts_request_loyalty_account_query.py b/src/square/types/search_loyalty_accounts_request_loyalty_account_query.py index 8569862e..a36c9133 100644 --- a/src/square/types/search_loyalty_accounts_request_loyalty_account_query.py +++ b/src/square/types/search_loyalty_accounts_request_loyalty_account_query.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .loyalty_account_mapping import LoyaltyAccountMapping import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .loyalty_account_mapping import LoyaltyAccountMapping class SearchLoyaltyAccountsRequestLoyaltyAccountQuery(UncheckedBaseModel): diff --git a/src/square/types/search_loyalty_accounts_response.py b/src/square/types/search_loyalty_accounts_response.py index ec5c12b8..222bc75c 100644 --- a/src/square/types/search_loyalty_accounts_response.py +++ b/src/square/types/search_loyalty_accounts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_account import LoyaltyAccount +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchLoyaltyAccountsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_loyalty_events_response.py b/src/square/types/search_loyalty_events_response.py index 8d829383..9895c498 100644 --- a/src/square/types/search_loyalty_events_response.py +++ b/src/square/types/search_loyalty_events_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_event import LoyaltyEvent +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchLoyaltyEventsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_loyalty_rewards_request_loyalty_reward_query.py b/src/square/types/search_loyalty_rewards_request_loyalty_reward_query.py index 9511036d..bbc13d78 100644 --- a/src/square/types/search_loyalty_rewards_request_loyalty_reward_query.py +++ b/src/square/types/search_loyalty_rewards_request_loyalty_reward_query.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .loyalty_reward_status import LoyaltyRewardStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchLoyaltyRewardsRequestLoyaltyRewardQuery(UncheckedBaseModel): diff --git a/src/square/types/search_loyalty_rewards_response.py b/src/square/types/search_loyalty_rewards_response.py index 4b99eb31..37908f2c 100644 --- a/src/square/types/search_loyalty_rewards_response.py +++ b/src/square/types/search_loyalty_rewards_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .loyalty_reward import LoyaltyReward +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchLoyaltyRewardsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_orders_customer_filter.py b/src/square/types/search_orders_customer_filter.py index 5517c7ae..df8c0b74 100644 --- a/src/square/types/search_orders_customer_filter.py +++ b/src/square/types/search_orders_customer_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SearchOrdersCustomerFilter(UncheckedBaseModel): diff --git a/src/square/types/search_orders_date_time_filter.py b/src/square/types/search_orders_date_time_filter.py index 69006eb1..1e95a76b 100644 --- a/src/square/types/search_orders_date_time_filter.py +++ b/src/square/types/search_orders_date_time_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .time_range import TimeRange import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .time_range import TimeRange class SearchOrdersDateTimeFilter(UncheckedBaseModel): diff --git a/src/square/types/search_orders_filter.py b/src/square/types/search_orders_filter.py index d7a50ab7..d0be0905 100644 --- a/src/square/types/search_orders_filter.py +++ b/src/square/types/search_orders_filter.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .search_orders_state_filter import SearchOrdersStateFilter import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .search_orders_customer_filter import SearchOrdersCustomerFilter from .search_orders_date_time_filter import SearchOrdersDateTimeFilter from .search_orders_fulfillment_filter import SearchOrdersFulfillmentFilter from .search_orders_source_filter import SearchOrdersSourceFilter -from .search_orders_state_filter import SearchOrdersStateFilter +from .search_orders_customer_filter import SearchOrdersCustomerFilter +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchOrdersFilter(UncheckedBaseModel): diff --git a/src/square/types/search_orders_fulfillment_filter.py b/src/square/types/search_orders_fulfillment_filter.py index c0bff795..0a32a574 100644 --- a/src/square/types/search_orders_fulfillment_filter.py +++ b/src/square/types/search_orders_fulfillment_filter.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .fulfillment_type import FulfillmentType import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .fulfillment_state import FulfillmentState -from .fulfillment_type import FulfillmentType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchOrdersFulfillmentFilter(UncheckedBaseModel): diff --git a/src/square/types/search_orders_query.py b/src/square/types/search_orders_query.py index d1c46564..cc15d8a6 100644 --- a/src/square/types/search_orders_query.py +++ b/src/square/types/search_orders_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .search_orders_filter import SearchOrdersFilter +import pydantic from .search_orders_sort import SearchOrdersSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchOrdersQuery(UncheckedBaseModel): diff --git a/src/square/types/search_orders_response.py b/src/square/types/search_orders_response.py index 6ed1bed1..66fa1e98 100644 --- a/src/square/types/search_orders_response.py +++ b/src/square/types/search_orders_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order_entry import OrderEntry import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error from .order import Order -from .order_entry import OrderEntry +from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchOrdersResponse(UncheckedBaseModel): diff --git a/src/square/types/search_orders_sort.py b/src/square/types/search_orders_sort.py index 7aeef304..fdaf7df6 100644 --- a/src/square/types/search_orders_sort.py +++ b/src/square/types/search_orders_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .search_orders_sort_field import SearchOrdersSortField +import pydantic +import typing from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchOrdersSort(UncheckedBaseModel): diff --git a/src/square/types/search_orders_source_filter.py b/src/square/types/search_orders_source_filter.py index 4dd471bf..988cb9ea 100644 --- a/src/square/types/search_orders_source_filter.py +++ b/src/square/types/search_orders_source_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SearchOrdersSourceFilter(UncheckedBaseModel): diff --git a/src/square/types/search_orders_state_filter.py b/src/square/types/search_orders_state_filter.py index ed764aa5..54d00fe1 100644 --- a/src/square/types/search_orders_state_filter.py +++ b/src/square/types/search_orders_state_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order_state import OrderState import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .order_state import OrderState class SearchOrdersStateFilter(UncheckedBaseModel): diff --git a/src/square/types/search_scheduled_shifts_response.py b/src/square/types/search_scheduled_shifts_response.py index ae173696..7f0cbca4 100644 --- a/src/square/types/search_scheduled_shifts_response.py +++ b/src/square/types/search_scheduled_shifts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .scheduled_shift import ScheduledShift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .scheduled_shift import ScheduledShift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchScheduledShiftsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_shifts_response.py b/src/square/types/search_shifts_response.py index 5ad9c840..19297f4e 100644 --- a/src/square/types/search_shifts_response.py +++ b/src/square/types/search_shifts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .shift import Shift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .shift import Shift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchShiftsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_subscriptions_filter.py b/src/square/types/search_subscriptions_filter.py index e166c156..6c940d24 100644 --- a/src/square/types/search_subscriptions_filter.py +++ b/src/square/types/search_subscriptions_filter.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SearchSubscriptionsFilter(UncheckedBaseModel): diff --git a/src/square/types/search_subscriptions_query.py b/src/square/types/search_subscriptions_query.py index 7cabaa68..3259d346 100644 --- a/src/square/types/search_subscriptions_query.py +++ b/src/square/types/search_subscriptions_query.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .search_subscriptions_filter import SearchSubscriptionsFilter import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .search_subscriptions_filter import SearchSubscriptionsFilter class SearchSubscriptionsQuery(UncheckedBaseModel): diff --git a/src/square/types/search_subscriptions_response.py b/src/square/types/search_subscriptions_response.py index 725134ff..75082d3e 100644 --- a/src/square/types/search_subscriptions_response.py +++ b/src/square/types/search_subscriptions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchSubscriptionsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_team_members_filter.py b/src/square/types/search_team_members_filter.py index be85906a..e4430519 100644 --- a/src/square/types/search_team_members_filter.py +++ b/src/square/types/search_team_members_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_status import TeamMemberStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchTeamMembersFilter(UncheckedBaseModel): diff --git a/src/square/types/search_team_members_query.py b/src/square/types/search_team_members_query.py index f74d92bf..5730e497 100644 --- a/src/square/types/search_team_members_query.py +++ b/src/square/types/search_team_members_query.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .search_team_members_filter import SearchTeamMembersFilter import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .search_team_members_filter import SearchTeamMembersFilter class SearchTeamMembersQuery(UncheckedBaseModel): diff --git a/src/square/types/search_team_members_response.py b/src/square/types/search_team_members_response.py index c59d62ee..ea46d869 100644 --- a/src/square/types/search_team_members_response.py +++ b/src/square/types/search_team_members_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member import TeamMember +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchTeamMembersResponse(UncheckedBaseModel): diff --git a/src/square/types/search_terminal_actions_response.py b/src/square/types/search_terminal_actions_response.py index 97efa277..ef15fe65 100644 --- a/src/square/types/search_terminal_actions_response.py +++ b/src/square/types/search_terminal_actions_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_action import TerminalAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchTerminalActionsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_terminal_checkouts_response.py b/src/square/types/search_terminal_checkouts_response.py index 19077baa..78fe0f61 100644 --- a/src/square/types/search_terminal_checkouts_response.py +++ b/src/square/types/search_terminal_checkouts_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_checkout import TerminalCheckout +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchTerminalCheckoutsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_terminal_refunds_response.py b/src/square/types/search_terminal_refunds_response.py index 7d3d6d21..bb3114e7 100644 --- a/src/square/types/search_terminal_refunds_response.py +++ b/src/square/types/search_terminal_refunds_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .terminal_refund import TerminalRefund +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchTerminalRefundsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_timecards_response.py b/src/square/types/search_timecards_response.py index 3f34141c..af79bc9c 100644 --- a/src/square/types/search_timecards_response.py +++ b/src/square/types/search_timecards_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard import Timecard import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .timecard import Timecard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchTimecardsResponse(UncheckedBaseModel): diff --git a/src/square/types/search_transfer_orders_response.py b/src/square/types/search_transfer_orders_response.py deleted file mode 100644 index 33bbda2a..00000000 --- a/src/square/types/search_transfer_orders_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class SearchTransferOrdersResponse(UncheckedBaseModel): - """ - Response for searching transfer orders - """ - - transfer_orders: typing.Optional[typing.List[TransferOrder]] = pydantic.Field(default=None) - """ - List of transfer orders matching the search criteria - """ - - cursor: typing.Optional[str] = pydantic.Field(default=None) - """ - Pagination cursor for fetching the next page of results - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/search_vendors_request_filter.py b/src/square/types/search_vendors_request_filter.py index 99752ffc..c14d02cb 100644 --- a/src/square/types/search_vendors_request_filter.py +++ b/src/square/types/search_vendors_request_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor_status import VendorStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchVendorsRequestFilter(UncheckedBaseModel): diff --git a/src/square/types/search_vendors_request_sort.py b/src/square/types/search_vendors_request_sort.py index e272eb50..1d9ba70e 100644 --- a/src/square/types/search_vendors_request_sort.py +++ b/src/square/types/search_vendors_request_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .search_vendors_request_sort_field import SearchVendorsRequestSortField +import pydantic from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchVendorsRequestSort(UncheckedBaseModel): diff --git a/src/square/types/search_vendors_response.py b/src/square/types/search_vendors_response.py index af0d5c83..cbc9b7e3 100644 --- a/src/square/types/search_vendors_response.py +++ b/src/square/types/search_vendors_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .vendor import Vendor +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SearchVendorsResponse(UncheckedBaseModel): diff --git a/src/square/types/segment_filter.py b/src/square/types/segment_filter.py index f4de1af3..e76e357e 100644 --- a/src/square/types/segment_filter.py +++ b/src/square/types/segment_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .filter_value import FilterValue +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SegmentFilter(UncheckedBaseModel): diff --git a/src/square/types/select_option.py b/src/square/types/select_option.py index a4a8bad3..75f52bbc 100644 --- a/src/square/types/select_option.py +++ b/src/square/types/select_option.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class SelectOption(UncheckedBaseModel): diff --git a/src/square/types/select_options.py b/src/square/types/select_options.py index 2ab14535..27ba583a 100644 --- a/src/square/types/select_options.py +++ b/src/square/types/select_options.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .select_option import SelectOption +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SelectOptions(UncheckedBaseModel): diff --git a/src/square/types/shift.py b/src/square/types/shift.py index c510d03e..d11dd1d3 100644 --- a/src/square/types/shift.py +++ b/src/square/types/shift.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .shift_wage import ShiftWage from .break_ import Break -from .money import Money from .shift_status import ShiftStatus -from .shift_wage import ShiftWage +from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Shift(UncheckedBaseModel): diff --git a/src/square/types/shift_filter.py b/src/square/types/shift_filter.py index 1126f97a..2d482e62 100644 --- a/src/square/types/shift_filter.py +++ b/src/square/types/shift_filter.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .shift_filter_status import ShiftFilterStatus -from .shift_workday import ShiftWorkday from .time_range import TimeRange +from .shift_workday import ShiftWorkday +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ShiftFilter(UncheckedBaseModel): diff --git a/src/square/types/shift_query.py b/src/square/types/shift_query.py index de2c7730..4a15e652 100644 --- a/src/square/types/shift_query.py +++ b/src/square/types/shift_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .shift_filter import ShiftFilter +import pydantic from .shift_sort import ShiftSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ShiftQuery(UncheckedBaseModel): diff --git a/src/square/types/shift_sort.py b/src/square/types/shift_sort.py index 39c5eadc..98a7fece 100644 --- a/src/square/types/shift_sort.py +++ b/src/square/types/shift_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .shift_sort_field import ShiftSortField +import pydantic from .sort_order import SortOrder +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ShiftSort(UncheckedBaseModel): diff --git a/src/square/types/shift_wage.py b/src/square/types/shift_wage.py index bda2d11d..f93a2ad7 100644 --- a/src/square/types/shift_wage.py +++ b/src/square/types/shift_wage.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ShiftWage(UncheckedBaseModel): diff --git a/src/square/types/shift_workday.py b/src/square/types/shift_workday.py index ddc1944d..23d6607c 100644 --- a/src/square/types/shift_workday.py +++ b/src/square/types/shift_workday.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .date_range import DateRange +import pydantic from .shift_workday_matcher import ShiftWorkdayMatcher +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ShiftWorkday(UncheckedBaseModel): diff --git a/src/square/types/shipping_fee.py b/src/square/types/shipping_fee.py index b5ef4d4c..dbea2e82 100644 --- a/src/square/types/shipping_fee.py +++ b/src/square/types/shipping_fee.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ShippingFee(UncheckedBaseModel): diff --git a/src/square/types/signature_image.py b/src/square/types/signature_image.py index 6d3afcec..e40d38e4 100644 --- a/src/square/types/signature_image.py +++ b/src/square/types/signature_image.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SignatureImage(UncheckedBaseModel): diff --git a/src/square/types/signature_options.py b/src/square/types/signature_options.py index 9428f479..3e982b41 100644 --- a/src/square/types/signature_options.py +++ b/src/square/types/signature_options.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing from .signature_image import SignatureImage +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SignatureOptions(UncheckedBaseModel): diff --git a/src/square/types/site.py b/src/square/types/site.py index d846ac34..15ae6850 100644 --- a/src/square/types/site.py +++ b/src/square/types/site.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Site(UncheckedBaseModel): diff --git a/src/square/types/snippet.py b/src/square/types/snippet.py index c6531f94..c48ead3c 100644 --- a/src/square/types/snippet.py +++ b/src/square/types/snippet.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class Snippet(UncheckedBaseModel): diff --git a/src/square/types/source_application.py b/src/square/types/source_application.py index 43d6322b..7b798b9a 100644 --- a/src/square/types/source_application.py +++ b/src/square/types/source_application.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .product import Product import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .product import Product class SourceApplication(UncheckedBaseModel): diff --git a/src/square/types/square_account_details.py b/src/square/types/square_account_details.py index 6df86514..0575c421 100644 --- a/src/square/types/square_account_details.py +++ b/src/square/types/square_account_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SquareAccountDetails(UncheckedBaseModel): diff --git a/src/square/types/standard_unit_description.py b/src/square/types/standard_unit_description.py index 2fec3e0c..39b4d1b8 100644 --- a/src/square/types/standard_unit_description.py +++ b/src/square/types/standard_unit_description.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .measurement_unit import MeasurementUnit import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .measurement_unit import MeasurementUnit class StandardUnitDescription(UncheckedBaseModel): diff --git a/src/square/types/standard_unit_description_group.py b/src/square/types/standard_unit_description_group.py index 40753dd4..f978bce1 100644 --- a/src/square/types/standard_unit_description_group.py +++ b/src/square/types/standard_unit_description_group.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .standard_unit_description import StandardUnitDescription import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .standard_unit_description import StandardUnitDescription class StandardUnitDescriptionGroup(UncheckedBaseModel): diff --git a/src/square/types/start_transfer_order_response.py b/src/square/types/start_transfer_order_response.py deleted file mode 100644 index ee077dab..00000000 --- a/src/square/types/start_transfer_order_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class StartTransferOrderResponse(UncheckedBaseModel): - """ - Response for starting a transfer order. - """ - - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The updated transfer order with status changed to STARTED - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/submit_evidence_response.py b/src/square/types/submit_evidence_response.py index ff8b906d..dd429c51 100644 --- a/src/square/types/submit_evidence_response.py +++ b/src/square/types/submit_evidence_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .dispute import Dispute -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubmitEvidenceResponse(UncheckedBaseModel): diff --git a/src/square/types/subscription.py b/src/square/types/subscription.py index 605bbf30..61656697 100644 --- a/src/square/types/subscription.py +++ b/src/square/types/subscription.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .subscription_status import SubscriptionStatus from .money import Money -from .phase import Phase -from .subscription_action import SubscriptionAction from .subscription_source import SubscriptionSource -from .subscription_status import SubscriptionStatus +from .subscription_action import SubscriptionAction +from .phase import Phase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Subscription(UncheckedBaseModel): @@ -145,11 +144,6 @@ class Subscription(UncheckedBaseModel): array of phases for this subscription """ - completed_date: typing.Optional[str] = pydantic.Field(default=None) - """ - The `YYYY-MM-DD`-formatted date when the subscription enters a terminal state. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/subscription_action.py b/src/square/types/subscription_action.py index 67fe750b..f42c31cb 100644 --- a/src/square/types/subscription_action.py +++ b/src/square/types/subscription_action.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .phase import Phase from .subscription_action_type import SubscriptionActionType +from .phase import Phase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionAction(UncheckedBaseModel): diff --git a/src/square/types/subscription_action_type.py b/src/square/types/subscription_action_type.py index f7d061e4..c2c8b83f 100644 --- a/src/square/types/subscription_action_type.py +++ b/src/square/types/subscription_action_type.py @@ -3,5 +3,5 @@ import typing SubscriptionActionType = typing.Union[ - typing.Literal["CANCEL", "PAUSE", "RESUME", "SWAP_PLAN", "CHANGE_BILLING_ANCHOR_DATE", "COMPLETE"], typing.Any + typing.Literal["CANCEL", "PAUSE", "RESUME", "SWAP_PLAN", "CHANGE_BILLING_ANCHOR_DATE"], typing.Any ] diff --git a/src/square/types/subscription_created_event.py b/src/square/types/subscription_created_event.py index bb129258..cfcbc959 100644 --- a/src/square/types/subscription_created_event.py +++ b/src/square/types/subscription_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .subscription_created_event_data import SubscriptionCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/subscription_created_event_data.py b/src/square/types/subscription_created_event_data.py index b0c3dead..34bad482 100644 --- a/src/square/types/subscription_created_event_data.py +++ b/src/square/types/subscription_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .subscription_created_event_object import SubscriptionCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/subscription_created_event_object.py b/src/square/types/subscription_created_event_object.py index 9f11d483..23854c27 100644 --- a/src/square/types/subscription_created_event_object.py +++ b/src/square/types/subscription_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .subscription import Subscription import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .subscription import Subscription class SubscriptionCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/subscription_event.py b/src/square/types/subscription_event.py index 4c9d079b..acd2affd 100644 --- a/src/square/types/subscription_event.py +++ b/src/square/types/subscription_event.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .phase import Phase -from .subscription_event_info import SubscriptionEventInfo +import pydantic from .subscription_event_subscription_event_type import SubscriptionEventSubscriptionEventType +import typing +from .subscription_event_info import SubscriptionEventInfo +from .phase import Phase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionEvent(UncheckedBaseModel): diff --git a/src/square/types/subscription_event_info.py b/src/square/types/subscription_event_info.py index edb3de01..cf5a5080 100644 --- a/src/square/types/subscription_event_info.py +++ b/src/square/types/subscription_event_info.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .subscription_event_info_code import SubscriptionEventInfoCode +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionEventInfo(UncheckedBaseModel): diff --git a/src/square/types/subscription_phase.py b/src/square/types/subscription_phase.py index b25287d6..b713f4a3 100644 --- a/src/square/types/subscription_phase.py +++ b/src/square/types/subscription_phase.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money from .subscription_cadence import SubscriptionCadence +from .money import Money from .subscription_pricing import SubscriptionPricing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionPhase(UncheckedBaseModel): diff --git a/src/square/types/subscription_pricing.py b/src/square/types/subscription_pricing.py index cbcc5f41..55d436e5 100644 --- a/src/square/types/subscription_pricing.py +++ b/src/square/types/subscription_pricing.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .subscription_pricing_type import SubscriptionPricingType import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money -from .subscription_pricing_type import SubscriptionPricingType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionPricing(UncheckedBaseModel): diff --git a/src/square/types/subscription_source.py b/src/square/types/subscription_source.py index e9f89474..7150d22c 100644 --- a/src/square/types/subscription_source.py +++ b/src/square/types/subscription_source.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SubscriptionSource(UncheckedBaseModel): diff --git a/src/square/types/subscription_status.py b/src/square/types/subscription_status.py index e1452152..537b411c 100644 --- a/src/square/types/subscription_status.py +++ b/src/square/types/subscription_status.py @@ -2,6 +2,4 @@ import typing -SubscriptionStatus = typing.Union[ - typing.Literal["PENDING", "ACTIVE", "CANCELED", "DEACTIVATED", "PAUSED", "COMPLETED"], typing.Any -] +SubscriptionStatus = typing.Union[typing.Literal["PENDING", "ACTIVE", "CANCELED", "DEACTIVATED", "PAUSED"], typing.Any] diff --git a/src/square/types/subscription_test_result.py b/src/square/types/subscription_test_result.py index cd82b2a1..1ecfa6d0 100644 --- a/src/square/types/subscription_test_result.py +++ b/src/square/types/subscription_test_result.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class SubscriptionTestResult(UncheckedBaseModel): diff --git a/src/square/types/subscription_updated_event.py b/src/square/types/subscription_updated_event.py index 927d6a25..f09b7f5e 100644 --- a/src/square/types/subscription_updated_event.py +++ b/src/square/types/subscription_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .subscription_updated_event_data import SubscriptionUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/subscription_updated_event_data.py b/src/square/types/subscription_updated_event_data.py index 868d9b7d..81075540 100644 --- a/src/square/types/subscription_updated_event_data.py +++ b/src/square/types/subscription_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .subscription_updated_event_object import SubscriptionUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SubscriptionUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/subscription_updated_event_object.py b/src/square/types/subscription_updated_event_object.py index 99d715cd..f0bb4c76 100644 --- a/src/square/types/subscription_updated_event_object.py +++ b/src/square/types/subscription_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .subscription import Subscription import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .subscription import Subscription class SubscriptionUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/swap_plan_response.py b/src/square/types/swap_plan_response.py index f459dc62..3a16d053 100644 --- a/src/square/types/swap_plan_response.py +++ b/src/square/types/swap_plan_response.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription from .subscription_action import SubscriptionAction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class SwapPlanResponse(UncheckedBaseModel): diff --git a/src/square/types/tax_ids.py b/src/square/types/tax_ids.py index fc6a5a58..b85cd296 100644 --- a/src/square/types/tax_ids.py +++ b/src/square/types/tax_ids.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class TaxIds(UncheckedBaseModel): diff --git a/src/square/types/team_member.py b/src/square/types/team_member.py index 52d5054f..ba9dfccc 100644 --- a/src/square/types/team_member.py +++ b/src/square/types/team_member.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .team_member_assigned_locations import TeamMemberAssignedLocations from .team_member_status import TeamMemberStatus +from .team_member_assigned_locations import TeamMemberAssignedLocations from .wage_setting import WageSetting +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMember(UncheckedBaseModel): diff --git a/src/square/types/team_member_assigned_locations.py b/src/square/types/team_member_assigned_locations.py index b99dd87d..9bff9be6 100644 --- a/src/square/types/team_member_assigned_locations.py +++ b/src/square/types/team_member_assigned_locations.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member_assigned_locations_assignment_type import TeamMemberAssignedLocationsAssignmentType import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .team_member_assigned_locations_assignment_type import TeamMemberAssignedLocationsAssignmentType class TeamMemberAssignedLocations(UncheckedBaseModel): diff --git a/src/square/types/team_member_booking_profile.py b/src/square/types/team_member_booking_profile.py index e276c001..0e987d84 100644 --- a/src/square/types/team_member_booking_profile.py +++ b/src/square/types/team_member_booking_profile.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class TeamMemberBookingProfile(UncheckedBaseModel): diff --git a/src/square/types/team_member_created_event.py b/src/square/types/team_member_created_event.py index c2c3c7a4..09e8a244 100644 --- a/src/square/types/team_member_created_event.py +++ b/src/square/types/team_member_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_created_event_data import TeamMemberCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/team_member_created_event_data.py b/src/square/types/team_member_created_event_data.py index 8255ebed..8ba29bda 100644 --- a/src/square/types/team_member_created_event_data.py +++ b/src/square/types/team_member_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_created_event_object import TeamMemberCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/team_member_created_event_object.py b/src/square/types/team_member_created_event_object.py index 10c23a3b..3c9bceab 100644 --- a/src/square/types/team_member_created_event_object.py +++ b/src/square/types/team_member_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .team_member import TeamMember class TeamMemberCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/team_member_updated_event.py b/src/square/types/team_member_updated_event.py index c1ced542..a60ab946 100644 --- a/src/square/types/team_member_updated_event.py +++ b/src/square/types/team_member_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_updated_event_data import TeamMemberUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/team_member_updated_event_data.py b/src/square/types/team_member_updated_event_data.py index 0992f618..edb7bc17 100644 --- a/src/square/types/team_member_updated_event_data.py +++ b/src/square/types/team_member_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_updated_event_object import TeamMemberUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/team_member_updated_event_object.py b/src/square/types/team_member_updated_event_object.py index 42cb4955..3a53f7b6 100644 --- a/src/square/types/team_member_updated_event_object.py +++ b/src/square/types/team_member_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .team_member import TeamMember class TeamMemberUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/team_member_wage.py b/src/square/types/team_member_wage.py index f90e7c2c..bcdca03f 100644 --- a/src/square/types/team_member_wage.py +++ b/src/square/types/team_member_wage.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberWage(UncheckedBaseModel): diff --git a/src/square/types/team_member_wage_setting_updated_event.py b/src/square/types/team_member_wage_setting_updated_event.py index 5588869e..6951a30a 100644 --- a/src/square/types/team_member_wage_setting_updated_event.py +++ b/src/square/types/team_member_wage_setting_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_wage_setting_updated_event_data import TeamMemberWageSettingUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberWageSettingUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/team_member_wage_setting_updated_event_data.py b/src/square/types/team_member_wage_setting_updated_event_data.py index 43daf7c5..f81b7898 100644 --- a/src/square/types/team_member_wage_setting_updated_event_data.py +++ b/src/square/types/team_member_wage_setting_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .team_member_wage_setting_updated_event_object import TeamMemberWageSettingUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TeamMemberWageSettingUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/team_member_wage_setting_updated_event_object.py b/src/square/types/team_member_wage_setting_updated_event_object.py index af41e735..648ef3bf 100644 --- a/src/square/types/team_member_wage_setting_updated_event_object.py +++ b/src/square/types/team_member_wage_setting_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .wage_setting import WageSetting import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .wage_setting import WageSetting class TeamMemberWageSettingUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/tender.py b/src/square/types/tender.py index a1f8e8e2..633bb34d 100644 --- a/src/square/types/tender.py +++ b/src/square/types/tender.py @@ -1,18 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .additional_recipient import AdditionalRecipient from .money import Money -from .tender_bank_account_details import TenderBankAccountDetails -from .tender_buy_now_pay_later_details import TenderBuyNowPayLaterDetails +from .tender_type import TenderType from .tender_card_details import TenderCardDetails from .tender_cash_details import TenderCashDetails +from .tender_bank_account_details import TenderBankAccountDetails +from .tender_buy_now_pay_later_details import TenderBuyNowPayLaterDetails from .tender_square_account_details import TenderSquareAccountDetails -from .tender_type import TenderType +from .additional_recipient import AdditionalRecipient +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Tender(UncheckedBaseModel): diff --git a/src/square/types/tender_bank_account_details.py b/src/square/types/tender_bank_account_details.py index 5b7aa424..3eca5c09 100644 --- a/src/square/types/tender_bank_account_details.py +++ b/src/square/types/tender_bank_account_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .tender_bank_account_details_status import TenderBankAccountDetailsStatus import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .tender_bank_account_details_status import TenderBankAccountDetailsStatus class TenderBankAccountDetails(UncheckedBaseModel): diff --git a/src/square/types/tender_buy_now_pay_later_details.py b/src/square/types/tender_buy_now_pay_later_details.py index bdc35650..5def3410 100644 --- a/src/square/types/tender_buy_now_pay_later_details.py +++ b/src/square/types/tender_buy_now_pay_later_details.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .tender_buy_now_pay_later_details_brand import TenderBuyNowPayLaterDetailsBrand +import pydantic from .tender_buy_now_pay_later_details_status import TenderBuyNowPayLaterDetailsStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TenderBuyNowPayLaterDetails(UncheckedBaseModel): diff --git a/src/square/types/tender_card_details.py b/src/square/types/tender_card_details.py index d544f761..44534777 100644 --- a/src/square/types/tender_card_details.py +++ b/src/square/types/tender_card_details.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .tender_card_details_status import TenderCardDetailsStatus import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .card import Card from .tender_card_details_entry_method import TenderCardDetailsEntryMethod -from .tender_card_details_status import TenderCardDetailsStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TenderCardDetails(UncheckedBaseModel): diff --git a/src/square/types/tender_cash_details.py b/src/square/types/tender_cash_details.py index 06589de2..6ce866ad 100644 --- a/src/square/types/tender_cash_details.py +++ b/src/square/types/tender_cash_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .money import Money import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .money import Money class TenderCashDetails(UncheckedBaseModel): diff --git a/src/square/types/tender_square_account_details.py b/src/square/types/tender_square_account_details.py index 1a9cd7f9..801f6bec 100644 --- a/src/square/types/tender_square_account_details.py +++ b/src/square/types/tender_square_account_details.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .tender_square_account_details_status import TenderSquareAccountDetailsStatus import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .tender_square_account_details_status import TenderSquareAccountDetailsStatus class TenderSquareAccountDetails(UncheckedBaseModel): diff --git a/src/square/types/terminal_action.py b/src/square/types/terminal_action.py index 428417dd..02b08174 100644 --- a/src/square/types/terminal_action.py +++ b/src/square/types/terminal_action.py @@ -1,20 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .action_cancel_reason import ActionCancelReason -from .confirmation_options import ConfirmationOptions -from .data_collection_options import DataCollectionOptions -from .device_metadata import DeviceMetadata +from .terminal_action_action_type import TerminalActionActionType from .qr_code_options import QrCodeOptions -from .receipt_options import ReceiptOptions from .save_card_options import SaveCardOptions -from .select_options import SelectOptions from .signature_options import SignatureOptions -from .terminal_action_action_type import TerminalActionActionType +from .confirmation_options import ConfirmationOptions +from .receipt_options import ReceiptOptions +from .data_collection_options import DataCollectionOptions +from .select_options import SelectOptions +from .device_metadata import DeviceMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalAction(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_created_event.py b/src/square/types/terminal_action_created_event.py index 121e01db..3bca1ea0 100644 --- a/src/square/types/terminal_action_created_event.py +++ b/src/square/types/terminal_action_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_action_created_event_data import TerminalActionCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalActionCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_created_event_data.py b/src/square/types/terminal_action_created_event_data.py index c82760b7..5b0ca05c 100644 --- a/src/square/types/terminal_action_created_event_data.py +++ b/src/square/types/terminal_action_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_action_created_event_object import TerminalActionCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalActionCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_created_event_object.py b/src/square/types/terminal_action_created_event_object.py index acb9eeb0..1f1e1d07 100644 --- a/src/square/types/terminal_action_created_event_object.py +++ b/src/square/types/terminal_action_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .terminal_action import TerminalAction import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_action import TerminalAction class TerminalActionCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_query.py b/src/square/types/terminal_action_query.py index 2de9c807..9bafe4a4 100644 --- a/src/square/types/terminal_action_query.py +++ b/src/square/types/terminal_action_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .terminal_action_query_filter import TerminalActionQueryFilter +import pydantic from .terminal_action_query_sort import TerminalActionQuerySort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalActionQuery(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_query_filter.py b/src/square/types/terminal_action_query_filter.py index 7b3941d4..44558065 100644 --- a/src/square/types/terminal_action_query_filter.py +++ b/src/square/types/terminal_action_query_filter.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_action_action_type import TerminalActionActionType from .time_range import TimeRange +from .terminal_action_action_type import TerminalActionActionType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalActionQueryFilter(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_query_sort.py b/src/square/types/terminal_action_query_sort.py index 53d01e60..7637b769 100644 --- a/src/square/types/terminal_action_query_sort.py +++ b/src/square/types/terminal_action_query_sort.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .sort_order import SortOrder import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .sort_order import SortOrder class TerminalActionQuerySort(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_updated_event.py b/src/square/types/terminal_action_updated_event.py index 3d0efd10..7d141c63 100644 --- a/src/square/types/terminal_action_updated_event.py +++ b/src/square/types/terminal_action_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_action_updated_event_data import TerminalActionUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalActionUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_updated_event_data.py b/src/square/types/terminal_action_updated_event_data.py index 8cfe0ca7..24c34337 100644 --- a/src/square/types/terminal_action_updated_event_data.py +++ b/src/square/types/terminal_action_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_action_updated_event_object import TerminalActionUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalActionUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/terminal_action_updated_event_object.py b/src/square/types/terminal_action_updated_event_object.py index 12f97a9b..2d1de458 100644 --- a/src/square/types/terminal_action_updated_event_object.py +++ b/src/square/types/terminal_action_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .terminal_action import TerminalAction import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_action import TerminalAction class TerminalActionUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout.py b/src/square/types/terminal_checkout.py index 9ab4312b..4ff3d092 100644 --- a/src/square/types/terminal_checkout.py +++ b/src/square/types/terminal_checkout.py @@ -1,15 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .action_cancel_reason import ActionCancelReason -from .checkout_options_payment_type import CheckoutOptionsPaymentType -from .device_checkout_options import DeviceCheckoutOptions from .money import Money from .payment_options import PaymentOptions +from .device_checkout_options import DeviceCheckoutOptions +from .action_cancel_reason import ActionCancelReason +from .checkout_options_payment_type import CheckoutOptionsPaymentType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckout(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_created_event.py b/src/square/types/terminal_checkout_created_event.py index 072a3790..dc028dcf 100644 --- a/src/square/types/terminal_checkout_created_event.py +++ b/src/square/types/terminal_checkout_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_checkout_created_event_data import TerminalCheckoutCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckoutCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_created_event_data.py b/src/square/types/terminal_checkout_created_event_data.py index d4aa4de6..3a4be1dc 100644 --- a/src/square/types/terminal_checkout_created_event_data.py +++ b/src/square/types/terminal_checkout_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_checkout_created_event_object import TerminalCheckoutCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckoutCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_created_event_object.py b/src/square/types/terminal_checkout_created_event_object.py index 00da1e00..5f0325fe 100644 --- a/src/square/types/terminal_checkout_created_event_object.py +++ b/src/square/types/terminal_checkout_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .terminal_checkout import TerminalCheckout import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_checkout import TerminalCheckout class TerminalCheckoutCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_query.py b/src/square/types/terminal_checkout_query.py index 0407a249..21f39bd0 100644 --- a/src/square/types/terminal_checkout_query.py +++ b/src/square/types/terminal_checkout_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .terminal_checkout_query_filter import TerminalCheckoutQueryFilter +import pydantic from .terminal_checkout_query_sort import TerminalCheckoutQuerySort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckoutQuery(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_query_filter.py b/src/square/types/terminal_checkout_query_filter.py index cad30585..9debdd7e 100644 --- a/src/square/types/terminal_checkout_query_filter.py +++ b/src/square/types/terminal_checkout_query_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .time_range import TimeRange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckoutQueryFilter(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_query_sort.py b/src/square/types/terminal_checkout_query_sort.py index ce364d11..57c0b784 100644 --- a/src/square/types/terminal_checkout_query_sort.py +++ b/src/square/types/terminal_checkout_query_sort.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .sort_order import SortOrder import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .sort_order import SortOrder class TerminalCheckoutQuerySort(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_updated_event.py b/src/square/types/terminal_checkout_updated_event.py index bdaa80ba..d4ed7460 100644 --- a/src/square/types/terminal_checkout_updated_event.py +++ b/src/square/types/terminal_checkout_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_checkout_updated_event_data import TerminalCheckoutUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckoutUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_updated_event_data.py b/src/square/types/terminal_checkout_updated_event_data.py index 15c5c766..2020eae2 100644 --- a/src/square/types/terminal_checkout_updated_event_data.py +++ b/src/square/types/terminal_checkout_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_checkout_updated_event_object import TerminalCheckoutUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalCheckoutUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/terminal_checkout_updated_event_object.py b/src/square/types/terminal_checkout_updated_event_object.py index dcb38b2d..ad4e42dd 100644 --- a/src/square/types/terminal_checkout_updated_event_object.py +++ b/src/square/types/terminal_checkout_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .terminal_checkout import TerminalCheckout import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_checkout import TerminalCheckout class TerminalCheckoutUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund.py b/src/square/types/terminal_refund.py index 7c30e1a7..05dbdcd2 100644 --- a/src/square/types/terminal_refund.py +++ b/src/square/types/terminal_refund.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .action_cancel_reason import ActionCancelReason from .money import Money +from .action_cancel_reason import ActionCancelReason +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefund(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_created_event.py b/src/square/types/terminal_refund_created_event.py index d3a046a5..21d63001 100644 --- a/src/square/types/terminal_refund_created_event.py +++ b/src/square/types/terminal_refund_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_refund_created_event_data import TerminalRefundCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefundCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_created_event_data.py b/src/square/types/terminal_refund_created_event_data.py index a0b2bd3d..6b4e06b7 100644 --- a/src/square/types/terminal_refund_created_event_data.py +++ b/src/square/types/terminal_refund_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_refund_created_event_object import TerminalRefundCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefundCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_created_event_object.py b/src/square/types/terminal_refund_created_event_object.py index 0ecf984c..7ca7e1d0 100644 --- a/src/square/types/terminal_refund_created_event_object.py +++ b/src/square/types/terminal_refund_created_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .terminal_refund import TerminalRefund import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_refund import TerminalRefund class TerminalRefundCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_query.py b/src/square/types/terminal_refund_query.py index 0d6e0a33..5de00d39 100644 --- a/src/square/types/terminal_refund_query.py +++ b/src/square/types/terminal_refund_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .terminal_refund_query_filter import TerminalRefundQueryFilter +import pydantic from .terminal_refund_query_sort import TerminalRefundQuerySort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefundQuery(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_query_filter.py b/src/square/types/terminal_refund_query_filter.py index 36a96588..ca8cd910 100644 --- a/src/square/types/terminal_refund_query_filter.py +++ b/src/square/types/terminal_refund_query_filter.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .time_range import TimeRange +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefundQueryFilter(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_query_sort.py b/src/square/types/terminal_refund_query_sort.py index d1df5e3d..b5d2ee09 100644 --- a/src/square/types/terminal_refund_query_sort.py +++ b/src/square/types/terminal_refund_query_sort.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class TerminalRefundQuerySort(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_updated_event.py b/src/square/types/terminal_refund_updated_event.py index a12bfa44..cbeef557 100644 --- a/src/square/types/terminal_refund_updated_event.py +++ b/src/square/types/terminal_refund_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_refund_updated_event_data import TerminalRefundUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefundUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_updated_event_data.py b/src/square/types/terminal_refund_updated_event_data.py index 0fa96666..fea89107 100644 --- a/src/square/types/terminal_refund_updated_event_data.py +++ b/src/square/types/terminal_refund_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .terminal_refund_updated_event_object import TerminalRefundUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TerminalRefundUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/terminal_refund_updated_event_object.py b/src/square/types/terminal_refund_updated_event_object.py index 5710cc4e..becc346b 100644 --- a/src/square/types/terminal_refund_updated_event_object.py +++ b/src/square/types/terminal_refund_updated_event_object.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .terminal_refund import TerminalRefund import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .terminal_refund import TerminalRefund class TerminalRefundUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/test_webhook_subscription_response.py b/src/square/types/test_webhook_subscription_response.py index 8443a290..78bed135 100644 --- a/src/square/types/test_webhook_subscription_response.py +++ b/src/square/types/test_webhook_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription_test_result import SubscriptionTestResult +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TestWebhookSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/time_range.py b/src/square/types/time_range.py index 2f50a984..0c475dc8 100644 --- a/src/square/types/time_range.py +++ b/src/square/types/time_range.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class TimeRange(UncheckedBaseModel): diff --git a/src/square/types/timecard.py b/src/square/types/timecard.py index 74b9ab6f..403b0fef 100644 --- a/src/square/types/timecard.py +++ b/src/square/types/timecard.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .timecard_wage import TimecardWage from .break_ import Break -from .money import Money from .timecard_status import TimecardStatus -from .timecard_wage import TimecardWage +from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Timecard(UncheckedBaseModel): diff --git a/src/square/types/timecard_filter.py b/src/square/types/timecard_filter.py index dffeff91..e09e1999 100644 --- a/src/square/types/timecard_filter.py +++ b/src/square/types/timecard_filter.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .time_range import TimeRange from .timecard_filter_status import TimecardFilterStatus +from .time_range import TimeRange from .timecard_workday import TimecardWorkday +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TimecardFilter(UncheckedBaseModel): diff --git a/src/square/types/timecard_query.py b/src/square/types/timecard_query.py index 5fd791ce..52be4db0 100644 --- a/src/square/types/timecard_query.py +++ b/src/square/types/timecard_query.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .timecard_filter import TimecardFilter +import pydantic from .timecard_sort import TimecardSort +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TimecardQuery(UncheckedBaseModel): diff --git a/src/square/types/timecard_sort.py b/src/square/types/timecard_sort.py index 1c234c67..f78e9ff4 100644 --- a/src/square/types/timecard_sort.py +++ b/src/square/types/timecard_sort.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard_sort_field import TimecardSortField import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .sort_order import SortOrder -from .timecard_sort_field import TimecardSortField +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TimecardSort(UncheckedBaseModel): diff --git a/src/square/types/timecard_wage.py b/src/square/types/timecard_wage.py index 77bf904d..0490688a 100644 --- a/src/square/types/timecard_wage.py +++ b/src/square/types/timecard_wage.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .money import Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TimecardWage(UncheckedBaseModel): diff --git a/src/square/types/timecard_workday.py b/src/square/types/timecard_workday.py index 3392c904..07cea638 100644 --- a/src/square/types/timecard_workday.py +++ b/src/square/types/timecard_workday.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .date_range import DateRange +import pydantic from .timecard_workday_matcher import TimecardWorkdayMatcher +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class TimecardWorkday(UncheckedBaseModel): diff --git a/src/square/types/tip_settings.py b/src/square/types/tip_settings.py index ceea9585..32d81742 100644 --- a/src/square/types/tip_settings.py +++ b/src/square/types/tip_settings.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class TipSettings(UncheckedBaseModel): diff --git a/src/square/types/transaction.py b/src/square/types/transaction.py index 3085a5cb..f9151bba 100644 --- a/src/square/types/transaction.py +++ b/src/square/types/transaction.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .address import Address -from .refund import Refund from .tender import Tender +from .refund import Refund from .transaction_product import TransactionProduct +from .address import Address +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Transaction(UncheckedBaseModel): diff --git a/src/square/types/transfer_order.py b/src/square/types/transfer_order.py deleted file mode 100644 index 0e17bfd1..00000000 --- a/src/square/types/transfer_order.py +++ /dev/null @@ -1,142 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_line import TransferOrderLine -from .transfer_order_status import TransferOrderStatus - - -class TransferOrder(UncheckedBaseModel): - """ - Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s - between [Location](entity:Location)s. Transfer orders track the entire lifecycle of an inventory - transfer, including: - - What items and quantities are being moved - - Source and destination locations - - Current [TransferOrderStatus](entity:TransferOrderStatus) - - Shipping information and tracking - - Which [TeamMember](entity:TeamMember) initiated the transfer - - This object is commonly used to: - - Track [CatalogItemVariation](entity:CatalogItemVariation) movements between [Location](entity:Location)s - - Reconcile expected vs received quantities - - Monitor transfer progress and shipping status - - Audit inventory movement history - """ - - id: typing.Optional[str] = pydantic.Field(default=None) - """ - Unique system-generated identifier for this transfer order. Use this ID for: - - Retrieving transfer order details - - Tracking status changes via webhooks - - Linking transfers in external systems - """ - - source_location_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The source [Location](entity:Location) sending the [CatalogItemVariation](entity:CatalogItemVariation)s. - This location must: - - Be active in your Square organization - - Have sufficient inventory for the items being transferred - - Not be the same as the destination location - - This field is not updatable. - """ - - destination_location_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The destination [Location](entity:Location) receiving the [CatalogItemVariation](entity:CatalogItemVariation)s. - This location must: - - Be active in your Square organization - - Not be the same as the source location - - This field is not updatable. - """ - - status: typing.Optional[TransferOrderStatus] = pydantic.Field(default=None) - """ - Current [TransferOrderStatus](entity:TransferOrderStatus) indicating where the order is in its lifecycle. - Status transitions follow this progression: - 1. [DRAFT](entity:TransferOrderStatus) -> [STARTED](entity:TransferOrderStatus) via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder) - 2. [STARTED](entity:TransferOrderStatus) -> [PARTIALLY_RECEIVED](entity:TransferOrderStatus) via [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) - 3. [PARTIALLY_RECEIVED](entity:TransferOrderStatus) -> [COMPLETED](entity:TransferOrderStatus) after all items received - - Orders can be [CANCELED](entity:TransferOrderStatus) from [STARTED](entity:TransferOrderStatus) or - [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - - This field is read-only and reflects the current state of the transfer order, and cannot be updated directly. Use the appropriate - endpoints (e.g. [StartPurchaseOrder](api-endpoint:TransferOrders-StartTransferOrder), to change the status. - See [TransferOrderStatus](#type-transferorderstatus) for possible values - """ - - created_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Timestamp when the transfer order was created, in RFC 3339 format. - Used for: - - Auditing transfer history - - Tracking order age - - Reporting and analytics - """ - - updated_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Timestamp when the transfer order was last updated, in RFC 3339 format. - Updated when: - - Order status changes - - Items are received - - Notes or metadata are modified - """ - - expected_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Expected transfer completion date, in RFC 3339 format. - Used for: - - Planning inventory availability - - Scheduling receiving staff - - Monitoring transfer timeliness - """ - - completed_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Timestamp when the transfer order was completed or canceled, in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). - """ - - notes: typing.Optional[str] = pydantic.Field(default=None) - """ - Optional notes about the transfer. - """ - - tracking_number: typing.Optional[str] = pydantic.Field(default=None) - """ - Shipment tracking number for monitoring transfer progress. - """ - - created_by_team_member_id: typing.Optional[str] = pydantic.Field(default=None) - """ - ID of the [TeamMember](entity:TeamMember) who created this transfer order. This field is not writeable by the Connect V2 API. - """ - - line_items: typing.Optional[typing.List[TransferOrderLine]] = pydantic.Field(default=None) - """ - List of [CatalogItemVariation](entity:CatalogItemVariation)s being transferred. - """ - - version: typing.Optional[int] = pydantic.Field(default=None) - """ - Version for optimistic concurrency control. This is a monotonically increasing integer - that changes whenever the transfer order is modified. Use this when calling - [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder) and other endpoints to ensure you're - not overwriting concurrent changes. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_created_event.py b/src/square/types/transfer_order_created_event.py deleted file mode 100644 index 0665a675..00000000 --- a/src/square/types/transfer_order_created_event.py +++ /dev/null @@ -1,48 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_created_event_data import TransferOrderCreatedEventData - - -class TransferOrderCreatedEvent(UncheckedBaseModel): - """ - Published when a transfer_order is created. - """ - - merchant_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the target merchant associated with the event. - """ - - type: typing.Optional[str] = pydantic.Field(default=None) - """ - The type of event this represents, `"transfer_order.created"`. - """ - - event_id: typing.Optional[str] = pydantic.Field(default=None) - """ - A unique ID for the event. - """ - - created_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Timestamp of when the event was created, in RFC 3339 format. - """ - - data: typing.Optional[TransferOrderCreatedEventData] = pydantic.Field(default=None) - """ - Data associated with the event. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_created_event_data.py b/src/square/types/transfer_order_created_event_data.py deleted file mode 100644 index 534debe8..00000000 --- a/src/square/types/transfer_order_created_event_data.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_created_event_object import TransferOrderCreatedEventObject - - -class TransferOrderCreatedEventData(UncheckedBaseModel): - type: typing.Optional[str] = pydantic.Field(default=None) - """ - Name of the affected object’s type, `"transfer_order"`. - """ - - id: typing.Optional[str] = pydantic.Field(default=None) - """ - ID of the affected transfer_order. - """ - - object: typing.Optional[TransferOrderCreatedEventObject] = pydantic.Field(default=None) - """ - An object containing the created transfer_order. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_created_event_object.py b/src/square/types/transfer_order_created_event_object.py deleted file mode 100644 index 484682d2..00000000 --- a/src/square/types/transfer_order_created_event_object.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order import TransferOrder - - -class TransferOrderCreatedEventObject(UncheckedBaseModel): - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The created transfer_order. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_deleted_event.py b/src/square/types/transfer_order_deleted_event.py deleted file mode 100644 index ff2863af..00000000 --- a/src/square/types/transfer_order_deleted_event.py +++ /dev/null @@ -1,48 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_deleted_event_data import TransferOrderDeletedEventData - - -class TransferOrderDeletedEvent(UncheckedBaseModel): - """ - Published when a transfer_order is deleted. - """ - - merchant_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the target merchant associated with the event. - """ - - type: typing.Optional[str] = pydantic.Field(default=None) - """ - The type of event this represents, `"transfer_order.deleted"`. - """ - - event_id: typing.Optional[str] = pydantic.Field(default=None) - """ - A unique ID for the event. - """ - - created_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Timestamp of when the event was created, in RFC 3339 format. - """ - - data: typing.Optional[TransferOrderDeletedEventData] = pydantic.Field(default=None) - """ - Data associated with the event. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_deleted_event_data.py b/src/square/types/transfer_order_deleted_event_data.py deleted file mode 100644 index 74453b3b..00000000 --- a/src/square/types/transfer_order_deleted_event_data.py +++ /dev/null @@ -1,33 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class TransferOrderDeletedEventData(UncheckedBaseModel): - type: typing.Optional[str] = pydantic.Field(default=None) - """ - Name of the affected object’s type, `"transfer_order"`. - """ - - id: typing.Optional[str] = pydantic.Field(default=None) - """ - ID of the affected transfer_order. - """ - - deleted: typing.Optional[bool] = pydantic.Field(default=None) - """ - Is true if the affected object was deleted. Otherwise absent. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_filter.py b/src/square/types/transfer_order_filter.py deleted file mode 100644 index ab914898..00000000 --- a/src/square/types/transfer_order_filter.py +++ /dev/null @@ -1,39 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_status import TransferOrderStatus - - -class TransferOrderFilter(UncheckedBaseModel): - """ - Filter criteria for searching transfer orders - """ - - source_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter by source location IDs - """ - - destination_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter by destination location IDs - """ - - statuses: typing.Optional[typing.List[TransferOrderStatus]] = pydantic.Field(default=None) - """ - Filter by order statuses - See [TransferOrderStatus](#type-transferorderstatus) for possible values - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_goods_receipt.py b/src/square/types/transfer_order_goods_receipt.py deleted file mode 100644 index 51534d37..00000000 --- a/src/square/types/transfer_order_goods_receipt.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_goods_receipt_line_item import TransferOrderGoodsReceiptLineItem - - -class TransferOrderGoodsReceipt(UncheckedBaseModel): - """ - The goods receipt details for a transfer order. This object represents a single receipt - of goods against a transfer order, tracking: - - - Which [CatalogItemVariation](entity:CatalogItemVariation)s were received - - Quantities received in good condition - - Quantities damaged during transit/handling - - Quantities canceled during receipt - - Multiple goods receipts can be created for a single transfer order to handle: - - Partial deliveries - - Multiple shipments - - Split receipts across different dates - - Cancellations of specific quantities - - Each receipt automatically: - - Updates the transfer order status - - Adjusts received quantities - - Updates inventory levels at both source and destination [Location](entity:Location)s - """ - - line_items: typing.Optional[typing.List[TransferOrderGoodsReceiptLineItem]] = pydantic.Field(default=None) - """ - Line items being received. Each line item specifies: - - The item being received - - Quantity received in good condition - - Quantity received damaged - - Quantity canceled - - Constraints: - - Must include at least one line item - - Maximum of 1000 line items per receipt - - Each line item must reference a valid item from the transfer order - - Total of received, damaged, and canceled quantities cannot exceed ordered quantity - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_goods_receipt_line_item.py b/src/square/types/transfer_order_goods_receipt_line_item.py deleted file mode 100644 index e1d414f2..00000000 --- a/src/square/types/transfer_order_goods_receipt_line_item.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class TransferOrderGoodsReceiptLineItem(UncheckedBaseModel): - """ - A simplified line item for goods receipts in transfer orders - """ - - transfer_order_line_uid: str = pydantic.Field() - """ - The unique identifier of the Transfer Order line being received - """ - - quantity_received: typing.Optional[str] = pydantic.Field(default=None) - """ - The quantity received for this line item as a decimal string (e.g. "10.5"). - These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. - """ - - quantity_damaged: typing.Optional[str] = pydantic.Field(default=None) - """ - The quantity that was damaged during shipping/handling as a decimal string (e.g. "1.5"). - These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. - """ - - quantity_canceled: typing.Optional[str] = pydantic.Field(default=None) - """ - The quantity that was canceled during shipping/handling as a decimal string (e.g. "1.5"). These will be immediately added to inventory in the source location. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_line.py b/src/square/types/transfer_order_line.py deleted file mode 100644 index 611b5de9..00000000 --- a/src/square/types/transfer_order_line.py +++ /dev/null @@ -1,70 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class TransferOrderLine(UncheckedBaseModel): - """ - Represents a line item in a transfer order. Each line item tracks a specific - [CatalogItemVariation](entity:CatalogItemVariation) being transferred, including ordered quantities - and receipt status. - """ - - uid: typing.Optional[str] = pydantic.Field(default=None) - """ - Unique system-generated identifier for the line item. Provide when updating/removing a line via [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). - """ - - item_variation_id: str = pydantic.Field() - """ - The required identifier of the [CatalogItemVariation](entity:CatalogItemVariation) being transferred. Must reference - a valid catalog item variation that exists in the [Catalog](api:Catalog). - """ - - quantity_ordered: str = pydantic.Field() - """ - Total quantity ordered, formatted as a decimal string (e.g. "10 or 10.0000"). Required to be a positive number. - - To remove a line item, set `remove` to `true` in [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). - """ - - quantity_pending: typing.Optional[str] = pydantic.Field(default=None) - """ - Calculated quantity of this line item's yet to be received stock. This is the difference between the total quantity ordered and the sum of quantities received, canceled, and damaged. - """ - - quantity_received: typing.Optional[str] = pydantic.Field(default=None) - """ - Quantity received at destination. These items are added to the destination - [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. - - This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). - """ - - quantity_damaged: typing.Optional[str] = pydantic.Field(default=None) - """ - Quantity received in damaged condition. These items are added to the destination - [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. - - This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). - """ - - quantity_canceled: typing.Optional[str] = pydantic.Field(default=None) - """ - Quantity that was canceled. These items will be immediately added to inventory in the source location. - - This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) or [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_query.py b/src/square/types/transfer_order_query.py deleted file mode 100644 index b365a0fd..00000000 --- a/src/square/types/transfer_order_query.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_filter import TransferOrderFilter -from .transfer_order_sort import TransferOrderSort - - -class TransferOrderQuery(UncheckedBaseModel): - """ - Query parameters for searching transfer orders - """ - - filter: typing.Optional[TransferOrderFilter] = pydantic.Field(default=None) - """ - Filter criteria - """ - - sort: typing.Optional[TransferOrderSort] = pydantic.Field(default=None) - """ - Sort configuration - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_sort.py b/src/square/types/transfer_order_sort.py deleted file mode 100644 index f6edc9c7..00000000 --- a/src/square/types/transfer_order_sort.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .sort_order import SortOrder -from .transfer_order_sort_field import TransferOrderSortField - - -class TransferOrderSort(UncheckedBaseModel): - """ - Sort configuration for search results - """ - - field: typing.Optional[TransferOrderSortField] = pydantic.Field(default=None) - """ - Field to sort by - See [TransferOrderSortField](#type-transferordersortfield) for possible values - """ - - order: typing.Optional[SortOrder] = pydantic.Field(default=None) - """ - Sort order direction - See [SortOrder](#type-sortorder) for possible values - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_sort_field.py b/src/square/types/transfer_order_sort_field.py deleted file mode 100644 index f785b651..00000000 --- a/src/square/types/transfer_order_sort_field.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TransferOrderSortField = typing.Union[typing.Literal["CREATED_AT", "UPDATED_AT"], typing.Any] diff --git a/src/square/types/transfer_order_status.py b/src/square/types/transfer_order_status.py deleted file mode 100644 index 894cee4d..00000000 --- a/src/square/types/transfer_order_status.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TransferOrderStatus = typing.Union[ - typing.Literal["DRAFT", "STARTED", "PARTIALLY_RECEIVED", "COMPLETED", "CANCELED"], typing.Any -] diff --git a/src/square/types/transfer_order_updated_event.py b/src/square/types/transfer_order_updated_event.py deleted file mode 100644 index 35942a7d..00000000 --- a/src/square/types/transfer_order_updated_event.py +++ /dev/null @@ -1,48 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_updated_event_data import TransferOrderUpdatedEventData - - -class TransferOrderUpdatedEvent(UncheckedBaseModel): - """ - Published when a transfer_order is updated. - """ - - merchant_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the target merchant associated with the event. - """ - - type: typing.Optional[str] = pydantic.Field(default=None) - """ - The type of event this represents, `"transfer_order.updated"`. - """ - - event_id: typing.Optional[str] = pydantic.Field(default=None) - """ - A unique ID for the event. - """ - - created_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Timestamp of when the event was created, in RFC 3339 format. - """ - - data: typing.Optional[TransferOrderUpdatedEventData] = pydantic.Field(default=None) - """ - Data associated with the event. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_updated_event_data.py b/src/square/types/transfer_order_updated_event_data.py deleted file mode 100644 index 3c0c177f..00000000 --- a/src/square/types/transfer_order_updated_event_data.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order_updated_event_object import TransferOrderUpdatedEventObject - - -class TransferOrderUpdatedEventData(UncheckedBaseModel): - type: typing.Optional[str] = pydantic.Field(default=None) - """ - Name of the affected object’s type, `"transfer_order"`. - """ - - id: typing.Optional[str] = pydantic.Field(default=None) - """ - ID of the affected transfer_order. - """ - - object: typing.Optional[TransferOrderUpdatedEventObject] = pydantic.Field(default=None) - """ - An object containing the updated transfer_order. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/transfer_order_updated_event_object.py b/src/square/types/transfer_order_updated_event_object.py deleted file mode 100644 index d29e8489..00000000 --- a/src/square/types/transfer_order_updated_event_object.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_order import TransferOrder - - -class TransferOrderUpdatedEventObject(UncheckedBaseModel): - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The updated transfer_order. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/unlink_customer_from_gift_card_response.py b/src/square/types/unlink_customer_from_gift_card_response.py index 0a3a4d69..ea438824 100644 --- a/src/square/types/unlink_customer_from_gift_card_response.py +++ b/src/square/types/unlink_customer_from_gift_card_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .gift_card import GiftCard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UnlinkCustomerFromGiftCardResponse(UncheckedBaseModel): diff --git a/src/square/types/update_booking_custom_attribute_definition_response.py b/src/square/types/update_booking_custom_attribute_definition_response.py index a2cf16e0..e3f86f90 100644 --- a/src/square/types/update_booking_custom_attribute_definition_response.py +++ b/src/square/types/update_booking_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateBookingCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_booking_response.py b/src/square/types/update_booking_response.py index 781964fd..358b4ce8 100644 --- a/src/square/types/update_booking_response.py +++ b/src/square/types/update_booking_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .booking import Booking +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateBookingResponse(UncheckedBaseModel): diff --git a/src/square/types/update_break_type_response.py b/src/square/types/update_break_type_response.py index 9bbf9ebe..b4343f00 100644 --- a/src/square/types/update_break_type_response.py +++ b/src/square/types/update_break_type_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .break_type import BreakType +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateBreakTypeResponse(UncheckedBaseModel): diff --git a/src/square/types/update_catalog_image_request.py b/src/square/types/update_catalog_image_request.py index 5b25edd6..f7065c8e 100644 --- a/src/square/types/update_catalog_image_request.py +++ b/src/square/types/update_catalog_image_request.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +from ..core.unchecked_base_model import UncheckedBaseModel import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +import typing class UpdateCatalogImageRequest(UncheckedBaseModel): diff --git a/src/square/types/update_catalog_image_response.py b/src/square/types/update_catalog_image_response.py index a5d8d91f..be333701 100644 --- a/src/square/types/update_catalog_image_response.py +++ b/src/square/types/update_catalog_image_response.py @@ -1,13 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan +import typing from .error import Error +import pydantic +from .catalog_object import CatalogObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateCatalogImageResponse(UncheckedBaseModel): @@ -16,7 +24,7 @@ class UpdateCatalogImageResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - image: typing.Optional["CatalogObject"] = pydantic.Field(default=None) + image: typing.Optional[CatalogObject] = pydantic.Field(default=None) """ The newly updated `CatalogImage` including a Square-generated URL for the encapsulated image file. @@ -30,18 +38,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - UpdateCatalogImageResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/update_customer_custom_attribute_definition_response.py b/src/square/types/update_customer_custom_attribute_definition_response.py index a0d678b4..b8db8ec6 100644 --- a/src/square/types/update_customer_custom_attribute_definition_response.py +++ b/src/square/types/update_customer_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateCustomerCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_customer_group_response.py b/src/square/types/update_customer_group_response.py index 6abc2678..c112bb8f 100644 --- a/src/square/types/update_customer_group_response.py +++ b/src/square/types/update_customer_group_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer_group import CustomerGroup -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateCustomerGroupResponse(UncheckedBaseModel): diff --git a/src/square/types/update_customer_response.py b/src/square/types/update_customer_response.py index f894b19e..15163056 100644 --- a/src/square/types/update_customer_response.py +++ b/src/square/types/update_customer_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .customer import Customer -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateCustomerResponse(UncheckedBaseModel): diff --git a/src/square/types/update_invoice_response.py b/src/square/types/update_invoice_response.py index 1a3d6d27..fdc87474 100644 --- a/src/square/types/update_invoice_response.py +++ b/src/square/types/update_invoice_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .invoice import Invoice import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .invoice import Invoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateInvoiceResponse(UncheckedBaseModel): diff --git a/src/square/types/update_item_modifier_lists_response.py b/src/square/types/update_item_modifier_lists_response.py index df256188..a88b6b08 100644 --- a/src/square/types/update_item_modifier_lists_response.py +++ b/src/square/types/update_item_modifier_lists_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class UpdateItemModifierListsResponse(UncheckedBaseModel): diff --git a/src/square/types/update_item_taxes_response.py b/src/square/types/update_item_taxes_response.py index 1630227f..96c7c729 100644 --- a/src/square/types/update_item_taxes_response.py +++ b/src/square/types/update_item_taxes_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class UpdateItemTaxesResponse(UncheckedBaseModel): diff --git a/src/square/types/update_job_response.py b/src/square/types/update_job_response.py index 75e299f5..f68f1046 100644 --- a/src/square/types/update_job_response.py +++ b/src/square/types/update_job_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .job import Job import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .job import Job +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateJobResponse(UncheckedBaseModel): diff --git a/src/square/types/update_location_custom_attribute_definition_response.py b/src/square/types/update_location_custom_attribute_definition_response.py index f08f9005..047b8af3 100644 --- a/src/square/types/update_location_custom_attribute_definition_response.py +++ b/src/square/types/update_location_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateLocationCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_location_response.py b/src/square/types/update_location_response.py index 0c5e7f44..e841ec2e 100644 --- a/src/square/types/update_location_response.py +++ b/src/square/types/update_location_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .location import Location +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateLocationResponse(UncheckedBaseModel): diff --git a/src/square/types/update_location_settings_response.py b/src/square/types/update_location_settings_response.py index a37dc787..6b6efa16 100644 --- a/src/square/types/update_location_settings_response.py +++ b/src/square/types/update_location_settings_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .checkout_location_settings import CheckoutLocationSettings -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateLocationSettingsResponse(UncheckedBaseModel): diff --git a/src/square/types/update_merchant_custom_attribute_definition_response.py b/src/square/types/update_merchant_custom_attribute_definition_response.py index 174630c7..db2b924c 100644 --- a/src/square/types/update_merchant_custom_attribute_definition_response.py +++ b/src/square/types/update_merchant_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateMerchantCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_merchant_settings_response.py b/src/square/types/update_merchant_settings_response.py index 31971d81..30e2bc90 100644 --- a/src/square/types/update_merchant_settings_response.py +++ b/src/square/types/update_merchant_settings_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .checkout_merchant_settings import CheckoutMerchantSettings -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateMerchantSettingsResponse(UncheckedBaseModel): diff --git a/src/square/types/update_order_custom_attribute_definition_response.py b/src/square/types/update_order_custom_attribute_definition_response.py index b84de324..0b01f719 100644 --- a/src/square/types/update_order_custom_attribute_definition_response.py +++ b/src/square/types/update_order_custom_attribute_definition_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute_definition import CustomAttributeDefinition +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateOrderCustomAttributeDefinitionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_order_response.py b/src/square/types/update_order_response.py index 66461c39..2e8e72d7 100644 --- a/src/square/types/update_order_response.py +++ b/src/square/types/update_order_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .order import Order import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .order import Order +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateOrderResponse(UncheckedBaseModel): diff --git a/src/square/types/update_payment_link_response.py b/src/square/types/update_payment_link_response.py index 7f3b3ef0..cb85cbf8 100644 --- a/src/square/types/update_payment_link_response.py +++ b/src/square/types/update_payment_link_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment_link import PaymentLink +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdatePaymentLinkResponse(UncheckedBaseModel): diff --git a/src/square/types/update_payment_response.py b/src/square/types/update_payment_response.py index 0a3ffb0e..8f4cce62 100644 --- a/src/square/types/update_payment_response.py +++ b/src/square/types/update_payment_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .payment import Payment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdatePaymentResponse(UncheckedBaseModel): diff --git a/src/square/types/update_scheduled_shift_response.py b/src/square/types/update_scheduled_shift_response.py index 3767cde7..61f5f2c9 100644 --- a/src/square/types/update_scheduled_shift_response.py +++ b/src/square/types/update_scheduled_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .scheduled_shift import ScheduledShift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .scheduled_shift import ScheduledShift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateScheduledShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/update_shift_response.py b/src/square/types/update_shift_response.py index 77cb7903..706356fd 100644 --- a/src/square/types/update_shift_response.py +++ b/src/square/types/update_shift_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .shift import Shift import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .shift import Shift +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateShiftResponse(UncheckedBaseModel): diff --git a/src/square/types/update_subscription_response.py b/src/square/types/update_subscription_response.py index ce0604a5..a641bc9b 100644 --- a/src/square/types/update_subscription_response.py +++ b/src/square/types/update_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .subscription import Subscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_team_member_request.py b/src/square/types/update_team_member_request.py index 9a1ce566..5fde7795 100644 --- a/src/square/types/update_team_member_request.py +++ b/src/square/types/update_team_member_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .team_member import TeamMember class UpdateTeamMemberRequest(UncheckedBaseModel): diff --git a/src/square/types/update_team_member_response.py b/src/square/types/update_team_member_response.py index 0af78489..47a21d55 100644 --- a/src/square/types/update_team_member_response.py +++ b/src/square/types/update_team_member_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .team_member import TeamMember import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .team_member import TeamMember +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateTeamMemberResponse(UncheckedBaseModel): diff --git a/src/square/types/update_timecard_response.py b/src/square/types/update_timecard_response.py index 83d6c73e..08428265 100644 --- a/src/square/types/update_timecard_response.py +++ b/src/square/types/update_timecard_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .timecard import Timecard import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .timecard import Timecard +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateTimecardResponse(UncheckedBaseModel): diff --git a/src/square/types/update_transfer_order_data.py b/src/square/types/update_transfer_order_data.py deleted file mode 100644 index 56e35fac..00000000 --- a/src/square/types/update_transfer_order_data.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .update_transfer_order_line_data import UpdateTransferOrderLineData - - -class UpdateTransferOrderData(UncheckedBaseModel): - """ - Data model for updating a transfer order. All fields are optional. - """ - - source_location_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The source [Location](entity:Location) that will send the items. Must be an active location - in your Square account with sufficient inventory of the requested items. - """ - - destination_location_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The destination [Location](entity:Location) that will receive the items. Must be an active location - in your Square account. - """ - - expected_at: typing.Optional[str] = pydantic.Field(default=None) - """ - Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). - """ - - notes: typing.Optional[str] = pydantic.Field(default=None) - """ - Optional notes about the transfer - """ - - tracking_number: typing.Optional[str] = pydantic.Field(default=None) - """ - Shipment tracking number - """ - - line_items: typing.Optional[typing.List[UpdateTransferOrderLineData]] = pydantic.Field(default=None) - """ - List of items being transferred - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/update_transfer_order_line_data.py b/src/square/types/update_transfer_order_line_data.py deleted file mode 100644 index a2b3bc8b..00000000 --- a/src/square/types/update_transfer_order_line_data.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class UpdateTransferOrderLineData(UncheckedBaseModel): - """ - Represents a line item update in a transfer order - """ - - uid: typing.Optional[str] = pydantic.Field(default=None) - """ - Line item id being updated. Required for updating/removing existing line items, but should not be set for new line items. - """ - - item_variation_id: typing.Optional[str] = pydantic.Field(default=None) - """ - Catalog item variation being transferred - - Required for new line items, but otherwise is not updatable. - """ - - quantity_ordered: typing.Optional[str] = pydantic.Field(default=None) - """ - Total quantity ordered - """ - - remove: typing.Optional[bool] = pydantic.Field(default=None) - """ - Flag to remove the line item during update. Must include `uid` in removal request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/update_transfer_order_response.py b/src/square/types/update_transfer_order_response.py deleted file mode 100644 index c76abd76..00000000 --- a/src/square/types/update_transfer_order_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .transfer_order import TransferOrder - - -class UpdateTransferOrderResponse(UncheckedBaseModel): - """ - Response for updating a transfer order - """ - - transfer_order: typing.Optional[TransferOrder] = pydantic.Field(default=None) - """ - The updated transfer order - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/update_vendor_request.py b/src/square/types/update_vendor_request.py index 4d4dcde0..11ab8c91 100644 --- a/src/square/types/update_vendor_request.py +++ b/src/square/types/update_vendor_request.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor import Vendor +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateVendorRequest(UncheckedBaseModel): diff --git a/src/square/types/update_vendor_response.py b/src/square/types/update_vendor_response.py index 89873e6f..ec88f014 100644 --- a/src/square/types/update_vendor_response.py +++ b/src/square/types/update_vendor_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .vendor import Vendor +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateVendorResponse(UncheckedBaseModel): diff --git a/src/square/types/update_wage_setting_response.py b/src/square/types/update_wage_setting_response.py index 7ffcb822..daf2a67a 100644 --- a/src/square/types/update_wage_setting_response.py +++ b/src/square/types/update_wage_setting_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .wage_setting import WageSetting import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .wage_setting import WageSetting +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateWageSettingResponse(UncheckedBaseModel): diff --git a/src/square/types/update_webhook_subscription_response.py b/src/square/types/update_webhook_subscription_response.py index 09de73e2..19ed439c 100644 --- a/src/square/types/update_webhook_subscription_response.py +++ b/src/square/types/update_webhook_subscription_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .webhook_subscription import WebhookSubscription +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateWebhookSubscriptionResponse(UncheckedBaseModel): diff --git a/src/square/types/update_webhook_subscription_signature_key_response.py b/src/square/types/update_webhook_subscription_signature_key_response.py index 4965ff7f..a991ab89 100644 --- a/src/square/types/update_webhook_subscription_signature_key_response.py +++ b/src/square/types/update_webhook_subscription_signature_key_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class UpdateWebhookSubscriptionSignatureKeyResponse(UncheckedBaseModel): diff --git a/src/square/types/update_workweek_config_response.py b/src/square/types/update_workweek_config_response.py index b5c22959..26b1ef6e 100644 --- a/src/square/types/update_workweek_config_response.py +++ b/src/square/types/update_workweek_config_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .workweek_config import WorkweekConfig import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .error import Error -from .workweek_config import WorkweekConfig +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpdateWorkweekConfigResponse(UncheckedBaseModel): diff --git a/src/square/types/upsert_booking_custom_attribute_response.py b/src/square/types/upsert_booking_custom_attribute_response.py index 72f5ce5c..4f28c387 100644 --- a/src/square/types/upsert_booking_custom_attribute_response.py +++ b/src/square/types/upsert_booking_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertBookingCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/upsert_catalog_object_response.py b/src/square/types/upsert_catalog_object_response.py index 2e34176e..16cbf9c9 100644 --- a/src/square/types/upsert_catalog_object_response.py +++ b/src/square/types/upsert_catalog_object_response.py @@ -1,14 +1,22 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - +from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_category import CatalogCategory +from .catalog_item import CatalogItem +from .catalog_item_option import CatalogItemOption +from .catalog_modifier_list import CatalogModifierList +from .catalog_object_category import CatalogObjectCategory +from .catalog_object_item import CatalogObjectItem +from .catalog_object_item_option import CatalogObjectItemOption +from .catalog_object_modifier_list import CatalogObjectModifierList +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan +from .catalog_subscription_plan import CatalogSubscriptionPlan import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel +from .catalog_object import CatalogObject from .catalog_id_mapping import CatalogIdMapping -from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertCatalogObjectResponse(UncheckedBaseModel): @@ -17,7 +25,7 @@ class UpsertCatalogObjectResponse(UncheckedBaseModel): Any errors that occurred during the request. """ - catalog_object: typing.Optional["CatalogObject"] = pydantic.Field(default=None) + catalog_object: typing.Optional[CatalogObject] = pydantic.Field(default=None) """ The successfully created or updated CatalogObject. """ @@ -35,18 +43,3 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - -from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 -from .catalog_object import CatalogObject # noqa: E402, I001 - -update_forward_refs( - UpsertCatalogObjectResponse, - CatalogObjectItemOption=CatalogObjectItemOption, - CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, - CatalogObjectItem=CatalogObjectItem, - CatalogObjectModifierList=CatalogObjectModifierList, -) diff --git a/src/square/types/upsert_customer_custom_attribute_response.py b/src/square/types/upsert_customer_custom_attribute_response.py index e5bed92a..bc2cdbee 100644 --- a/src/square/types/upsert_customer_custom_attribute_response.py +++ b/src/square/types/upsert_customer_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertCustomerCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/upsert_location_custom_attribute_response.py b/src/square/types/upsert_location_custom_attribute_response.py index 665752a2..5d3f1f3a 100644 --- a/src/square/types/upsert_location_custom_attribute_response.py +++ b/src/square/types/upsert_location_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertLocationCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/upsert_merchant_custom_attribute_response.py b/src/square/types/upsert_merchant_custom_attribute_response.py index 2754a6a1..1049406d 100644 --- a/src/square/types/upsert_merchant_custom_attribute_response.py +++ b/src/square/types/upsert_merchant_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertMerchantCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/upsert_order_custom_attribute_response.py b/src/square/types/upsert_order_custom_attribute_response.py index ded81590..1f6dbf15 100644 --- a/src/square/types/upsert_order_custom_attribute_response.py +++ b/src/square/types/upsert_order_custom_attribute_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .custom_attribute import CustomAttribute +import pydantic from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertOrderCustomAttributeResponse(UncheckedBaseModel): diff --git a/src/square/types/upsert_snippet_response.py b/src/square/types/upsert_snippet_response.py index eee955d8..ef081467 100644 --- a/src/square/types/upsert_snippet_response.py +++ b/src/square/types/upsert_snippet_response.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +import typing from .error import Error +import pydantic from .snippet import Snippet +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class UpsertSnippetResponse(UncheckedBaseModel): diff --git a/src/square/types/v1get_payment_request.py b/src/square/types/v1get_payment_request.py index 6d3cf15c..6d09cf01 100644 --- a/src/square/types/v1get_payment_request.py +++ b/src/square/types/v1get_payment_request.py @@ -2,4 +2,4 @@ import typing -V1GetPaymentRequest = typing.Any +V1GetPaymentRequest = typing.Optional[typing.Any] diff --git a/src/square/types/v1get_settlement_request.py b/src/square/types/v1get_settlement_request.py index 0204d1e4..f6741366 100644 --- a/src/square/types/v1get_settlement_request.py +++ b/src/square/types/v1get_settlement_request.py @@ -2,4 +2,4 @@ import typing -V1GetSettlementRequest = typing.Any +V1GetSettlementRequest = typing.Optional[typing.Any] diff --git a/src/square/types/v1money.py b/src/square/types/v1money.py index 7aed356a..19def97c 100644 --- a/src/square/types/v1money.py +++ b/src/square/types/v1money.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .currency import Currency +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class V1Money(UncheckedBaseModel): diff --git a/src/square/types/v1order.py b/src/square/types/v1order.py index 6cbbab09..4247f4d8 100644 --- a/src/square/types/v1order.py +++ b/src/square/types/v1order.py @@ -1,16 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel +from .v1order_state import V1OrderState from .address import Address -from .error import Error from .v1money import V1Money -from .v1order_history_entry import V1OrderHistoryEntry -from .v1order_state import V1OrderState from .v1tender import V1Tender +from .v1order_history_entry import V1OrderHistoryEntry +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class V1Order(UncheckedBaseModel): diff --git a/src/square/types/v1order_history_entry.py b/src/square/types/v1order_history_entry.py index d14d9f22..c0b60462 100644 --- a/src/square/types/v1order_history_entry.py +++ b/src/square/types/v1order_history_entry.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .v1order_history_entry_action import V1OrderHistoryEntryAction import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .v1order_history_entry_action import V1OrderHistoryEntryAction class V1OrderHistoryEntry(UncheckedBaseModel): diff --git a/src/square/types/v1tender.py b/src/square/types/v1tender.py index 62732ec1..de11fd69 100644 --- a/src/square/types/v1tender.py +++ b/src/square/types/v1tender.py @@ -1,14 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .v1money import V1Money +from .v1tender_type import V1TenderType from .v1tender_card_brand import V1TenderCardBrand from .v1tender_entry_method import V1TenderEntryMethod -from .v1tender_type import V1TenderType +from .v1money import V1Money +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class V1Tender(UncheckedBaseModel): diff --git a/src/square/types/vendor.py b/src/square/types/vendor.py index d36736fd..13dfe71c 100644 --- a/src/square/types/vendor.py +++ b/src/square/types/vendor.py @@ -1,13 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .address import Address from .vendor_contact import VendorContact from .vendor_status import VendorStatus +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class Vendor(UncheckedBaseModel): diff --git a/src/square/types/vendor_contact.py b/src/square/types/vendor_contact.py index 59fbf12a..1ba85a35 100644 --- a/src/square/types/vendor_contact.py +++ b/src/square/types/vendor_contact.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class VendorContact(UncheckedBaseModel): diff --git a/src/square/types/vendor_created_event.py b/src/square/types/vendor_created_event.py index c8954e1d..0e6c394f 100644 --- a/src/square/types/vendor_created_event.py +++ b/src/square/types/vendor_created_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor_created_event_data import VendorCreatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class VendorCreatedEvent(UncheckedBaseModel): diff --git a/src/square/types/vendor_created_event_data.py b/src/square/types/vendor_created_event_data.py index 02e877ca..ac5fc2d9 100644 --- a/src/square/types/vendor_created_event_data.py +++ b/src/square/types/vendor_created_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor_created_event_object import VendorCreatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class VendorCreatedEventData(UncheckedBaseModel): diff --git a/src/square/types/vendor_created_event_object.py b/src/square/types/vendor_created_event_object.py index 4246ce5d..4d54070d 100644 --- a/src/square/types/vendor_created_event_object.py +++ b/src/square/types/vendor_created_event_object.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .vendor_created_event_object_operation import VendorCreatedEventObjectOperation import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor import Vendor -from .vendor_created_event_object_operation import VendorCreatedEventObjectOperation +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class VendorCreatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/vendor_updated_event.py b/src/square/types/vendor_updated_event.py index 0445eaaf..e3e00f96 100644 --- a/src/square/types/vendor_updated_event.py +++ b/src/square/types/vendor_updated_event.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor_updated_event_data import VendorUpdatedEventData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class VendorUpdatedEvent(UncheckedBaseModel): diff --git a/src/square/types/vendor_updated_event_data.py b/src/square/types/vendor_updated_event_data.py index 76cfa95d..2ed1f340 100644 --- a/src/square/types/vendor_updated_event_data.py +++ b/src/square/types/vendor_updated_event_data.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor_updated_event_object import VendorUpdatedEventObject +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class VendorUpdatedEventData(UncheckedBaseModel): diff --git a/src/square/types/vendor_updated_event_object.py b/src/square/types/vendor_updated_event_object.py index 4fa355b3..52e8d9bf 100644 --- a/src/square/types/vendor_updated_event_object.py +++ b/src/square/types/vendor_updated_event_object.py @@ -1,12 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .vendor_updated_event_object_operation import VendorUpdatedEventObjectOperation import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .vendor import Vendor -from .vendor_updated_event_object_operation import VendorUpdatedEventObjectOperation +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class VendorUpdatedEventObject(UncheckedBaseModel): diff --git a/src/square/types/void_transaction_response.py b/src/square/types/void_transaction_response.py index 8c12f32e..7882dedb 100644 --- a/src/square/types/void_transaction_response.py +++ b/src/square/types/void_transaction_response.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - +from .error import Error import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error class VoidTransactionResponse(UncheckedBaseModel): diff --git a/src/square/types/wage_setting.py b/src/square/types/wage_setting.py index 3ab91671..bc778b18 100644 --- a/src/square/types/wage_setting.py +++ b/src/square/types/wage_setting.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .job_assignment import JobAssignment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class WageSetting(UncheckedBaseModel): diff --git a/src/square/types/webhook_subscription.py b/src/square/types/webhook_subscription.py index 1bfb5791..547b5223 100644 --- a/src/square/types/webhook_subscription.py +++ b/src/square/types/webhook_subscription.py @@ -1,10 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel class WebhookSubscription(UncheckedBaseModel): diff --git a/src/square/types/workweek_config.py b/src/square/types/workweek_config.py index 17bda221..b55081c3 100644 --- a/src/square/types/workweek_config.py +++ b/src/square/types/workweek_config.py @@ -1,11 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +from ..core.unchecked_base_model import UncheckedBaseModel import typing - import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel from .weekday import Weekday +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class WorkweekConfig(UncheckedBaseModel): diff --git a/src/square/v1transactions/__init__.py b/src/square/v1transactions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/v1transactions/__init__.py +++ b/src/square/v1transactions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/v1transactions/client.py b/src/square/v1transactions/client.py index 1fb8e5ff..a2ccfdc9 100644 --- a/src/square/v1transactions/client.py +++ b/src/square/v1transactions/client.py @@ -1,13 +1,14 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawV1TransactionsClient from ..types.sort_order import SortOrder +from ..core.request_options import RequestOptions from ..types.v1order import V1Order from ..types.v1update_order_request_action import V1UpdateOrderRequestAction -from .raw_client import AsyncRawV1TransactionsClient, RawV1TransactionsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawV1TransactionsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -77,10 +78,10 @@ def v1list_orders( batch_token="batch_token", ) """ - _response = self._raw_client.v1list_orders( + response = self._raw_client.v1list_orders( location_id, order=order, limit=limit, batch_token=batch_token, request_options=request_options ) - return _response.data + return response.data def v1retrieve_order( self, location_id: str, order_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -116,8 +117,8 @@ def v1retrieve_order( order_id="order_id", ) """ - _response = self._raw_client.v1retrieve_order(location_id, order_id, request_options=request_options) - return _response.data + response = self._raw_client.v1retrieve_order(location_id, order_id, request_options=request_options) + return response.data def v1update_order( self, @@ -179,7 +180,7 @@ def v1update_order( action="COMPLETE", ) """ - _response = self._raw_client.v1update_order( + response = self._raw_client.v1update_order( location_id, order_id, action=action, @@ -189,7 +190,7 @@ def v1update_order( canceled_note=canceled_note, request_options=request_options, ) - return _response.data + return response.data class AsyncV1TransactionsClient: @@ -264,10 +265,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.v1list_orders( + response = await self._raw_client.v1list_orders( location_id, order=order, limit=limit, batch_token=batch_token, request_options=request_options ) - return _response.data + return response.data async def v1retrieve_order( self, location_id: str, order_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -311,8 +312,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.v1retrieve_order(location_id, order_id, request_options=request_options) - return _response.data + response = await self._raw_client.v1retrieve_order(location_id, order_id, request_options=request_options) + return response.data async def v1update_order( self, @@ -382,7 +383,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.v1update_order( + response = await self._raw_client.v1update_order( location_id, order_id, action=action, @@ -392,4 +393,4 @@ async def main() -> None: canceled_note=canceled_note, request_options=request_options, ) - return _response.data + return response.data diff --git a/src/square/v1transactions/raw_client.py b/src/square/v1transactions/raw_client.py index 5ed5246c..19cb25a6 100644 --- a/src/square/v1transactions/raw_client.py +++ b/src/square/v1transactions/raw_client.py @@ -1,17 +1,18 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type +from ..core.client_wrapper import SyncClientWrapper from ..types.sort_order import SortOrder +from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse from ..types.v1order import V1Order +from ..core.jsonable_encoder import jsonable_encoder +from ..core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.v1update_order_request_action import V1UpdateOrderRequestAction +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -78,8 +79,8 @@ def v1list_orders( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def v1retrieve_order( self, location_id: str, order_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -120,8 +121,8 @@ def v1retrieve_order( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def v1update_order( self, @@ -198,8 +199,8 @@ def v1update_order( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawV1TransactionsClient: @@ -263,8 +264,8 @@ async def v1list_orders( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def v1retrieve_order( self, location_id: str, order_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -305,8 +306,8 @@ async def v1retrieve_order( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def v1update_order( self, @@ -383,5 +384,5 @@ async def v1update_order( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/vendors/__init__.py b/src/square/vendors/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/vendors/__init__.py +++ b/src/square/vendors/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/vendors/client.py b/src/square/vendors/client.py index 288d6041..17f82302 100644 --- a/src/square/vendors/client.py +++ b/src/square/vendors/client.py @@ -1,21 +1,22 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..requests.search_vendors_request_filter import SearchVendorsRequestFilterParams -from ..requests.search_vendors_request_sort import SearchVendorsRequestSortParams -from ..requests.update_vendor_request import UpdateVendorRequestParams +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawVendorsClient from ..requests.vendor import VendorParams +from ..core.request_options import RequestOptions from ..types.batch_create_vendors_response import BatchCreateVendorsResponse from ..types.batch_get_vendors_response import BatchGetVendorsResponse +from ..requests.update_vendor_request import UpdateVendorRequestParams from ..types.batch_update_vendors_response import BatchUpdateVendorsResponse from ..types.create_vendor_response import CreateVendorResponse -from ..types.get_vendor_response import GetVendorResponse +from ..requests.search_vendors_request_filter import SearchVendorsRequestFilterParams +from ..requests.search_vendors_request_sort import SearchVendorsRequestSortParams from ..types.search_vendors_response import SearchVendorsResponse +from ..types.get_vendor_response import GetVendorResponse from ..types.update_vendor_response import UpdateVendorResponse -from .raw_client import AsyncRawVendorsClient, RawVendorsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawVendorsClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -88,8 +89,8 @@ def batch_create( }, ) """ - _response = self._raw_client.batch_create(vendors=vendors, request_options=request_options) - return _response.data + response = self._raw_client.batch_create(vendors=vendors, request_options=request_options) + return response.data def batch_get( self, @@ -124,8 +125,8 @@ def batch_get( vendor_ids=["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"], ) """ - _response = self._raw_client.batch_get(vendor_ids=vendor_ids, request_options=request_options) - return _response.data + response = self._raw_client.batch_get(vendor_ids=vendor_ids, request_options=request_options) + return response.data def batch_update( self, @@ -164,8 +165,8 @@ def batch_update( }, ) """ - _response = self._raw_client.batch_update(vendors=vendors, request_options=request_options) - return _response.data + response = self._raw_client.batch_update(vendors=vendors, request_options=request_options) + return response.data def create( self, @@ -229,10 +230,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( idempotency_key=idempotency_key, vendor=vendor, request_options=request_options ) - return _response.data + return response.data def search( self, @@ -276,8 +277,8 @@ def search( ) client.vendors.search() """ - _response = self._raw_client.search(filter=filter, sort=sort, cursor=cursor, request_options=request_options) - return _response.data + response = self._raw_client.search(filter=filter, sort=sort, cursor=cursor, request_options=request_options) + return response.data def get(self, vendor_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetVendorResponse: """ @@ -307,8 +308,8 @@ def get(self, vendor_id: str, *, request_options: typing.Optional[RequestOptions vendor_id="vendor_id", ) """ - _response = self._raw_client.get(vendor_id, request_options=request_options) - return _response.data + response = self._raw_client.get(vendor_id, request_options=request_options) + return response.data def update( self, @@ -363,10 +364,10 @@ def update( }, ) """ - _response = self._raw_client.update( + response = self._raw_client.update( vendor_id, vendor=vendor, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data class AsyncVendorsClient: @@ -444,8 +445,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_create(vendors=vendors, request_options=request_options) - return _response.data + response = await self._raw_client.batch_create(vendors=vendors, request_options=request_options) + return response.data async def batch_get( self, @@ -488,8 +489,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_get(vendor_ids=vendor_ids, request_options=request_options) - return _response.data + response = await self._raw_client.batch_get(vendor_ids=vendor_ids, request_options=request_options) + return response.data async def batch_update( self, @@ -536,8 +537,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.batch_update(vendors=vendors, request_options=request_options) - return _response.data + response = await self._raw_client.batch_update(vendors=vendors, request_options=request_options) + return response.data async def create( self, @@ -609,10 +610,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( idempotency_key=idempotency_key, vendor=vendor, request_options=request_options ) - return _response.data + return response.data async def search( self, @@ -664,10 +665,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.search( + response = await self._raw_client.search( filter=filter, sort=sort, cursor=cursor, request_options=request_options ) - return _response.data + return response.data async def get( self, vendor_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -707,8 +708,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(vendor_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(vendor_id, request_options=request_options) + return response.data async def update( self, @@ -771,7 +772,7 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( vendor_id, vendor=vendor, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data diff --git a/src/square/vendors/raw_client.py b/src/square/vendors/raw_client.py index a3187be4..b220f201 100644 --- a/src/square/vendors/raw_client.py +++ b/src/square/vendors/raw_client.py @@ -1,26 +1,27 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import SyncClientWrapper +from ..requests.vendor import VendorParams from ..core.request_options import RequestOptions +from ..core.http_response import HttpResponse +from ..types.batch_create_vendors_response import BatchCreateVendorsResponse from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..requests.search_vendors_request_filter import SearchVendorsRequestFilterParams -from ..requests.search_vendors_request_sort import SearchVendorsRequestSortParams -from ..requests.update_vendor_request import UpdateVendorRequestParams -from ..requests.vendor import VendorParams -from ..types.batch_create_vendors_response import BatchCreateVendorsResponse +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError from ..types.batch_get_vendors_response import BatchGetVendorsResponse +from ..requests.update_vendor_request import UpdateVendorRequestParams from ..types.batch_update_vendors_response import BatchUpdateVendorsResponse from ..types.create_vendor_response import CreateVendorResponse -from ..types.get_vendor_response import GetVendorResponse +from ..requests.search_vendors_request_filter import SearchVendorsRequestFilterParams +from ..requests.search_vendors_request_sort import SearchVendorsRequestSortParams from ..types.search_vendors_response import SearchVendorsResponse +from ..types.get_vendor_response import GetVendorResponse +from ..core.jsonable_encoder import jsonable_encoder from ..types.update_vendor_response import UpdateVendorResponse +from ..core.client_wrapper import AsyncClientWrapper +from ..core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -75,8 +76,8 @@ def batch_create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_get( self, @@ -124,8 +125,8 @@ def batch_get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def batch_update( self, @@ -176,8 +177,8 @@ def batch_update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -236,8 +237,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def search( self, @@ -302,8 +303,8 @@ def search( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, vendor_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -341,8 +342,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -388,9 +389,6 @@ def update( object_=vendor, annotation=VendorParams, direction="write" ), }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -406,8 +404,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawVendorsClient: @@ -459,8 +457,8 @@ async def batch_create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_get( self, @@ -508,8 +506,8 @@ async def batch_get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def batch_update( self, @@ -560,8 +558,8 @@ async def batch_update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -620,8 +618,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def search( self, @@ -686,8 +684,8 @@ async def search( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, vendor_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -725,8 +723,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -772,9 +770,6 @@ async def update( object_=vendor, annotation=VendorParams, direction="write" ), }, - headers={ - "content-type": "application/json", - }, request_options=request_options, omit=OMIT, ) @@ -790,5 +785,5 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/webhooks/__init__.py b/src/square/webhooks/__init__.py index 022f9d17..d9d0e844 100644 --- a/src/square/webhooks/__init__.py +++ b/src/square/webhooks/__init__.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import event_types, subscriptions -_dynamic_imports: typing.Dict[str, str] = {"event_types": ".event_types", "subscriptions": ".subscriptions"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - +from . import event_types, subscriptions __all__ = ["event_types", "subscriptions"] diff --git a/src/square/webhooks/client.py b/src/square/webhooks/client.py index ab1deaf3..8f633628 100644 --- a/src/square/webhooks/client.py +++ b/src/square/webhooks/client.py @@ -1,23 +1,21 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .raw_client import AsyncRawWebhooksClient, RawWebhooksClient - -if typing.TYPE_CHECKING: - from .event_types.client import AsyncEventTypesClient, EventTypesClient - from .subscriptions.client import AsyncSubscriptionsClient, SubscriptionsClient +from ..core.client_wrapper import SyncClientWrapper +from .raw_client import RawWebhooksClient +from .event_types.client import EventTypesClient +from .subscriptions.client import SubscriptionsClient +from ..core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawWebhooksClient +from .event_types.client import AsyncEventTypesClient +from .subscriptions.client import AsyncSubscriptionsClient class WebhooksClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawWebhooksClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._event_types: typing.Optional[EventTypesClient] = None - self._subscriptions: typing.Optional[SubscriptionsClient] = None + self.event_types = EventTypesClient(client_wrapper=client_wrapper) + + self.subscriptions = SubscriptionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> RawWebhooksClient: @@ -30,29 +28,13 @@ def with_raw_response(self) -> RawWebhooksClient: """ return self._raw_client - @property - def event_types(self): - if self._event_types is None: - from .event_types.client import EventTypesClient # noqa: E402 - - self._event_types = EventTypesClient(client_wrapper=self._client_wrapper) - return self._event_types - - @property - def subscriptions(self): - if self._subscriptions is None: - from .subscriptions.client import SubscriptionsClient # noqa: E402 - - self._subscriptions = SubscriptionsClient(client_wrapper=self._client_wrapper) - return self._subscriptions - class AsyncWebhooksClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawWebhooksClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._event_types: typing.Optional[AsyncEventTypesClient] = None - self._subscriptions: typing.Optional[AsyncSubscriptionsClient] = None + self.event_types = AsyncEventTypesClient(client_wrapper=client_wrapper) + + self.subscriptions = AsyncSubscriptionsClient(client_wrapper=client_wrapper) @property def with_raw_response(self) -> AsyncRawWebhooksClient: @@ -64,19 +46,3 @@ def with_raw_response(self) -> AsyncRawWebhooksClient: AsyncRawWebhooksClient """ return self._raw_client - - @property - def event_types(self): - if self._event_types is None: - from .event_types.client import AsyncEventTypesClient # noqa: E402 - - self._event_types = AsyncEventTypesClient(client_wrapper=self._client_wrapper) - return self._event_types - - @property - def subscriptions(self): - if self._subscriptions is None: - from .subscriptions.client import AsyncSubscriptionsClient # noqa: E402 - - self._subscriptions = AsyncSubscriptionsClient(client_wrapper=self._client_wrapper) - return self._subscriptions diff --git a/src/square/webhooks/event_types/__init__.py b/src/square/webhooks/event_types/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/webhooks/event_types/__init__.py +++ b/src/square/webhooks/event_types/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/webhooks/event_types/client.py b/src/square/webhooks/event_types/client.py index 1fd60550..f93a7b74 100644 --- a/src/square/webhooks/event_types/client.py +++ b/src/square/webhooks/event_types/client.py @@ -1,11 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawEventTypesClient import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions from ...types.list_webhook_event_types_response import ListWebhookEventTypesResponse -from .raw_client import AsyncRawEventTypesClient, RawEventTypesClient +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawEventTypesClient class EventTypesClient: @@ -53,8 +54,8 @@ def list( api_version="api_version", ) """ - _response = self._raw_client.list(api_version=api_version, request_options=request_options) - return _response.data + response = self._raw_client.list(api_version=api_version, request_options=request_options) + return response.data class AsyncEventTypesClient: @@ -110,5 +111,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list(api_version=api_version, request_options=request_options) - return _response.data + response = await self._raw_client.list(api_version=api_version, request_options=request_options) + return response.data diff --git a/src/square/webhooks/event_types/raw_client.py b/src/square/webhooks/event_types/raw_client.py index 91faa77f..b837ed34 100644 --- a/src/square/webhooks/event_types/raw_client.py +++ b/src/square/webhooks/event_types/raw_client.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from ...core.client_wrapper import SyncClientWrapper import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.request_options import RequestOptions -from ...core.unchecked_base_model import construct_type +from ...core.http_response import HttpResponse from ...types.list_webhook_event_types_response import ListWebhookEventTypesResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse class RawEventTypesClient: @@ -54,8 +55,8 @@ def list( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawEventTypesClient: @@ -101,5 +102,5 @@ async def list( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/square/webhooks/raw_client.py b/src/square/webhooks/raw_client.py index 74782346..0a57a3ef 100644 --- a/src/square/webhooks/raw_client.py +++ b/src/square/webhooks/raw_client.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.client_wrapper import SyncClientWrapper +from ..core.client_wrapper import AsyncClientWrapper class RawWebhooksClient: diff --git a/src/square/webhooks/subscriptions/__init__.py b/src/square/webhooks/subscriptions/__init__.py index 5cde0202..f3ea2659 100644 --- a/src/square/webhooks/subscriptions/__init__.py +++ b/src/square/webhooks/subscriptions/__init__.py @@ -1,4 +1,2 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file - diff --git a/src/square/webhooks/subscriptions/client.py b/src/square/webhooks/subscriptions/client.py index 684bff7c..74462fb3 100644 --- a/src/square/webhooks/subscriptions/client.py +++ b/src/square/webhooks/subscriptions/client.py @@ -1,21 +1,26 @@ # This file was auto-generated by Fern from our API Definition. import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from .raw_client import RawSubscriptionsClient +from ...types.sort_order import SortOrder from ...core.request_options import RequestOptions +from ...core.pagination import SyncPager +from ...types.webhook_subscription import WebhookSubscription +from ...types.list_webhook_subscriptions_response import ListWebhookSubscriptionsResponse +from ...core.unchecked_base_model import construct_type +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...requests.webhook_subscription import WebhookSubscriptionParams from ...types.create_webhook_subscription_response import CreateWebhookSubscriptionResponse -from ...types.delete_webhook_subscription_response import DeleteWebhookSubscriptionResponse from ...types.get_webhook_subscription_response import GetWebhookSubscriptionResponse -from ...types.list_webhook_subscriptions_response import ListWebhookSubscriptionsResponse -from ...types.sort_order import SortOrder -from ...types.test_webhook_subscription_response import TestWebhookSubscriptionResponse from ...types.update_webhook_subscription_response import UpdateWebhookSubscriptionResponse +from ...types.delete_webhook_subscription_response import DeleteWebhookSubscriptionResponse from ...types.update_webhook_subscription_signature_key_response import UpdateWebhookSubscriptionSignatureKeyResponse -from ...types.webhook_subscription import WebhookSubscription -from .raw_client import AsyncRawSubscriptionsClient, RawSubscriptionsClient +from ...types.test_webhook_subscription_response import TestWebhookSubscriptionResponse +from ...core.client_wrapper import AsyncClientWrapper +from .raw_client import AsyncRawSubscriptionsClient +from ...core.pagination import AsyncPager # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -44,7 +49,7 @@ def list( sort_order: typing.Optional[SortOrder] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: + ) -> SyncPager[WebhookSubscription]: """ Lists all webhook subscriptions owned by your application. @@ -76,7 +81,7 @@ def list( Returns ------- - SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] + SyncPager[WebhookSubscription] Success Examples @@ -98,13 +103,41 @@ def list( for page in response.iter_pages(): yield page """ - return self._raw_client.list( - cursor=cursor, - include_disabled=include_disabled, - sort_order=sort_order, - limit=limit, + _response = self._raw_client._client_wrapper.httpx_client.request( + "v2/webhooks/subscriptions", + method="GET", + params={ + "cursor": cursor, + "include_disabled": include_disabled, + "sort_order": sort_order, + "limit": limit, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListWebhookSubscriptionsResponse, + construct_type( + type_=ListWebhookSubscriptionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + include_disabled=include_disabled, + sort_order=sort_order, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.subscriptions + return SyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def create( self, @@ -149,10 +182,10 @@ def create( }, ) """ - _response = self._raw_client.create( + response = self._raw_client.create( subscription=subscription, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def get( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -184,8 +217,8 @@ def get( subscription_id="subscription_id", ) """ - _response = self._raw_client.get(subscription_id, request_options=request_options) - return _response.data + response = self._raw_client.get(subscription_id, request_options=request_options) + return response.data def update( self, @@ -228,8 +261,8 @@ def update( }, ) """ - _response = self._raw_client.update(subscription_id, subscription=subscription, request_options=request_options) - return _response.data + response = self._raw_client.update(subscription_id, subscription=subscription, request_options=request_options) + return response.data def delete( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -261,8 +294,8 @@ def delete( subscription_id="subscription_id", ) """ - _response = self._raw_client.delete(subscription_id, request_options=request_options) - return _response.data + response = self._raw_client.delete(subscription_id, request_options=request_options) + return response.data def update_signature_key( self, @@ -302,10 +335,10 @@ def update_signature_key( idempotency_key="ed80ae6b-0654-473b-bbab-a39aee89a60d", ) """ - _response = self._raw_client.update_signature_key( + response = self._raw_client.update_signature_key( subscription_id, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data def test( self, @@ -346,8 +379,8 @@ def test( event_type="payment.created", ) """ - _response = self._raw_client.test(subscription_id, event_type=event_type, request_options=request_options) - return _response.data + response = self._raw_client.test(subscription_id, event_type=event_type, request_options=request_options) + return response.data class AsyncSubscriptionsClient: @@ -373,7 +406,7 @@ async def list( sort_order: typing.Optional[SortOrder] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: + ) -> AsyncPager[WebhookSubscription]: """ Lists all webhook subscriptions owned by your application. @@ -405,7 +438,7 @@ async def list( Returns ------- - AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] + AsyncPager[WebhookSubscription] Success Examples @@ -428,7 +461,6 @@ async def main() -> None: ) async for item in response: yield item - # alternatively, you can paginate page-by-page async for page in response.iter_pages(): yield page @@ -436,13 +468,41 @@ async def main() -> None: asyncio.run(main()) """ - return await self._raw_client.list( - cursor=cursor, - include_disabled=include_disabled, - sort_order=sort_order, - limit=limit, + _response = await self._raw_client._client_wrapper.httpx_client.request( + "v2/webhooks/subscriptions", + method="GET", + params={ + "cursor": cursor, + "include_disabled": include_disabled, + "sort_order": sort_order, + "limit": limit, + }, request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + ListWebhookSubscriptionsResponse, + construct_type( + type_=ListWebhookSubscriptionsResponse, # type: ignore + object_=_response.json(), + ), + ) + _parsed_next = _parsed_response.cursor + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.list( + cursor=_parsed_next, + include_disabled=include_disabled, + sort_order=sort_order, + limit=limit, + request_options=request_options, + ) + _items = _parsed_response.subscriptions + return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def create( self, @@ -495,10 +555,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.create( + response = await self._raw_client.create( subscription=subscription, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def get( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -538,8 +598,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.get(subscription_id, request_options=request_options) - return _response.data + response = await self._raw_client.get(subscription_id, request_options=request_options) + return response.data async def update( self, @@ -590,10 +650,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update( + response = await self._raw_client.update( subscription_id, subscription=subscription, request_options=request_options ) - return _response.data + return response.data async def delete( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -633,8 +693,8 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.delete(subscription_id, request_options=request_options) - return _response.data + response = await self._raw_client.delete(subscription_id, request_options=request_options) + return response.data async def update_signature_key( self, @@ -682,10 +742,10 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.update_signature_key( + response = await self._raw_client.update_signature_key( subscription_id, idempotency_key=idempotency_key, request_options=request_options ) - return _response.data + return response.data async def test( self, @@ -734,5 +794,5 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.test(subscription_id, event_type=event_type, request_options=request_options) - return _response.data + response = await self._raw_client.test(subscription_id, event_type=event_type, request_options=request_options) + return response.data diff --git a/src/square/webhooks/subscriptions/raw_client.py b/src/square/webhooks/subscriptions/raw_client.py index 2f5d0d92..628f448e 100644 --- a/src/square/webhooks/subscriptions/raw_client.py +++ b/src/square/webhooks/subscriptions/raw_client.py @@ -1,26 +1,23 @@ # This file was auto-generated by Fern from our API Definition. import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.jsonable_encoder import jsonable_encoder -from ...core.pagination import AsyncPager, SyncPager +from ...core.client_wrapper import SyncClientWrapper +from ...requests.webhook_subscription import WebhookSubscriptionParams from ...core.request_options import RequestOptions +from ...core.http_response import HttpResponse +from ...types.create_webhook_subscription_response import CreateWebhookSubscriptionResponse from ...core.serialization import convert_and_respect_annotation_metadata from ...core.unchecked_base_model import construct_type -from ...requests.webhook_subscription import WebhookSubscriptionParams -from ...types.create_webhook_subscription_response import CreateWebhookSubscriptionResponse -from ...types.delete_webhook_subscription_response import DeleteWebhookSubscriptionResponse +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError from ...types.get_webhook_subscription_response import GetWebhookSubscriptionResponse -from ...types.list_webhook_subscriptions_response import ListWebhookSubscriptionsResponse -from ...types.sort_order import SortOrder -from ...types.test_webhook_subscription_response import TestWebhookSubscriptionResponse +from ...core.jsonable_encoder import jsonable_encoder from ...types.update_webhook_subscription_response import UpdateWebhookSubscriptionResponse +from ...types.delete_webhook_subscription_response import DeleteWebhookSubscriptionResponse from ...types.update_webhook_subscription_signature_key_response import UpdateWebhookSubscriptionSignatureKeyResponse -from ...types.webhook_subscription import WebhookSubscription +from ...types.test_webhook_subscription_response import TestWebhookSubscriptionResponse +from ...core.client_wrapper import AsyncClientWrapper +from ...core.http_response import AsyncHttpResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -30,85 +27,6 @@ class RawSubscriptionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list( - self, - *, - cursor: typing.Optional[str] = None, - include_disabled: typing.Optional[bool] = None, - sort_order: typing.Optional[SortOrder] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: - """ - Lists all webhook subscriptions owned by your application. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - include_disabled : typing.Optional[bool] - Includes disabled [Subscription](entity:WebhookSubscription)s. - By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. - - sort_order : typing.Optional[SortOrder] - Sorts the returned list by when the [Subscription](entity:WebhookSubscription) was created with the specified order. - This field defaults to ASC. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - The default value of 100 is also the maximum allowed value. - - Default: 100 - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] - Success - """ - _response = self._client_wrapper.httpx_client.request( - "v2/webhooks/subscriptions", - method="GET", - params={ - "cursor": cursor, - "include_disabled": include_disabled, - "sort_order": sort_order, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListWebhookSubscriptionsResponse, - construct_type( - type_=ListWebhookSubscriptionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.subscriptions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - cursor=_parsed_next, - include_disabled=include_disabled, - sort_order=sort_order, - limit=limit, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( self, *, @@ -162,8 +80,8 @@ def create( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def get( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -201,8 +119,8 @@ def get( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update( self, @@ -256,8 +174,8 @@ def update( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def delete( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -295,8 +213,8 @@ def delete( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def update_signature_key( self, @@ -348,8 +266,8 @@ def update_signature_key( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) def test( self, @@ -402,96 +320,14 @@ def test( return HttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) class AsyncRawSubscriptionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list( - self, - *, - cursor: typing.Optional[str] = None, - include_disabled: typing.Optional[bool] = None, - sort_order: typing.Optional[SortOrder] = None, - limit: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: - """ - Lists all webhook subscriptions owned by your application. - - Parameters - ---------- - cursor : typing.Optional[str] - A pagination cursor returned by a previous call to this endpoint. - Provide this to retrieve the next set of results for your original query. - - For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). - - include_disabled : typing.Optional[bool] - Includes disabled [Subscription](entity:WebhookSubscription)s. - By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. - - sort_order : typing.Optional[SortOrder] - Sorts the returned list by when the [Subscription](entity:WebhookSubscription) was created with the specified order. - This field defaults to ASC. - - limit : typing.Optional[int] - The maximum number of results to be returned in a single page. - It is possible to receive fewer results than the specified limit on a given page. - The default value of 100 is also the maximum allowed value. - - Default: 100 - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] - Success - """ - _response = await self._client_wrapper.httpx_client.request( - "v2/webhooks/subscriptions", - method="GET", - params={ - "cursor": cursor, - "include_disabled": include_disabled, - "sort_order": sort_order, - "limit": limit, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListWebhookSubscriptionsResponse, - construct_type( - type_=ListWebhookSubscriptionsResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.subscriptions - _parsed_next = _parsed_response.cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - cursor=_parsed_next, - include_disabled=include_disabled, - sort_order=sort_order, - limit=limit, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def create( self, *, @@ -545,8 +381,8 @@ async def create( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def get( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -584,8 +420,8 @@ async def get( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update( self, @@ -639,8 +475,8 @@ async def update( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def delete( self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None @@ -678,8 +514,8 @@ async def delete( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def update_signature_key( self, @@ -731,8 +567,8 @@ async def update_signature_key( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) async def test( self, @@ -785,5 +621,5 @@ async def test( return AsyncHttpResponse(response=_response, data=_data) _response_json = _response.json() except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/tests/custom/test_client.py b/tests/custom/test_client.py index ab04ce63..73f811f5 100644 --- a/tests/custom/test_client.py +++ b/tests/custom/test_client.py @@ -4,4 +4,4 @@ # Get started with writing tests with pytest at https://docs.pytest.org @pytest.mark.skip(reason="Unimplemented") def test_client() -> None: - assert True + assert True == True diff --git a/tests/utils/assets/models/__init__.py b/tests/utils/assets/models/__init__.py index 2cf01263..3a1c852e 100644 --- a/tests/utils/assets/models/__init__.py +++ b/tests/utils/assets/models/__init__.py @@ -5,7 +5,7 @@ from .circle import CircleParams from .object_with_defaults import ObjectWithDefaultsParams from .object_with_optional_field import ObjectWithOptionalFieldParams -from .shape import Shape_CircleParams, Shape_SquareParams, ShapeParams +from .shape import ShapeParams, Shape_CircleParams, Shape_SquareParams from .square import SquareParams from .undiscriminated_shape import UndiscriminatedShapeParams diff --git a/tests/utils/assets/models/circle.py b/tests/utils/assets/models/circle.py index 2557fdc9..c2b8a6ec 100644 --- a/tests/utils/assets/models/circle.py +++ b/tests/utils/assets/models/circle.py @@ -3,7 +3,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions - +import typing_extensions from square.core.serialization import FieldMetadata diff --git a/tests/utils/assets/models/object_with_defaults.py b/tests/utils/assets/models/object_with_defaults.py index a977b1d2..ef14f7b2 100644 --- a/tests/utils/assets/models/object_with_defaults.py +++ b/tests/utils/assets/models/object_with_defaults.py @@ -3,6 +3,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions +import typing_extensions class ObjectWithDefaultsParams(typing_extensions.TypedDict): diff --git a/tests/utils/assets/models/object_with_optional_field.py b/tests/utils/assets/models/object_with_optional_field.py index 54a8d7bd..f05e8a97 100644 --- a/tests/utils/assets/models/object_with_optional_field.py +++ b/tests/utils/assets/models/object_with_optional_field.py @@ -2,17 +2,16 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +import typing_extensions import typing -import uuid - import typing_extensions +from square.core.serialization import FieldMetadata +import datetime as dt +import uuid from .color import Color from .shape import ShapeParams from .undiscriminated_shape import UndiscriminatedShapeParams -from square.core.serialization import FieldMetadata - class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): literal: typing.Literal["lit_one"] diff --git a/tests/utils/assets/models/shape.py b/tests/utils/assets/models/shape.py index b5195609..b286b6c8 100644 --- a/tests/utils/assets/models/shape.py +++ b/tests/utils/assets/models/shape.py @@ -3,11 +3,9 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations - -import typing - import typing_extensions - +import typing_extensions +import typing from square.core.serialization import FieldMetadata diff --git a/tests/utils/assets/models/square.py b/tests/utils/assets/models/square.py index dac450bb..36ca42e8 100644 --- a/tests/utils/assets/models/square.py +++ b/tests/utils/assets/models/square.py @@ -3,7 +3,7 @@ # This file was auto-generated by Fern from our API Definition. import typing_extensions - +import typing_extensions from square.core.serialization import FieldMetadata diff --git a/tests/utils/assets/models/undiscriminated_shape.py b/tests/utils/assets/models/undiscriminated_shape.py index 99f12b30..68876a23 100644 --- a/tests/utils/assets/models/undiscriminated_shape.py +++ b/tests/utils/assets/models/undiscriminated_shape.py @@ -3,7 +3,6 @@ # This file was auto-generated by Fern from our API Definition. import typing - from .circle import CircleParams from .square import SquareParams diff --git a/tests/utils/test_query_encoding.py b/tests/utils/test_query_encoding.py index eedb28a4..5a1e8bc8 100644 --- a/tests/utils/test_query_encoding.py +++ b/tests/utils/test_query_encoding.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. + from square.core.query_encoder import encode_query @@ -33,4 +34,4 @@ def test_query_encoding_deep_object_arrays() -> None: def test_encode_query_with_none() -> None: encoded = encode_query(None) - assert encoded is None + assert encoded == None diff --git a/tests/utils/test_serialization.py b/tests/utils/test_serialization.py index 928ebfb7..26772f31 100644 --- a/tests/utils/test_serialization.py +++ b/tests/utils/test_serialization.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -from typing import Any, List - -from .assets.models import ObjectWithOptionalFieldParams, ShapeParams +from typing import List, Any from square.core.serialization import convert_and_respect_annotation_metadata +from .assets.models import ShapeParams, ObjectWithOptionalFieldParams + UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"}